Class: Libvirt::Spec::Domain::OSBooting
- Inherits:
-
Object
- Object
- Libvirt::Spec::Domain::OSBooting
- Defined in:
- lib/libvirt/spec/domain/os_booting.rb
Overview
The OS booting section of a domain specification indicates to libvirt how to configure the virtual machine to boot. There are three main ways to configure booting. Each hypervisor supports one or more of the following:
- BIOS bootloader
- Host bootloader
- Direct kernel boot
TODO: Host bootloader and direct kernel bootloader options.
Instance Attribute Summary (collapse)
-
- (Object) arch
Returns the value of attribute arch.
-
- (Object) boot
Returns the value of attribute boot.
-
- (Object) bootloader
Host bootloader configuration options.
-
- (Object) bootloader_args
Returns the value of attribute bootloader_args.
-
- (Object) bootmenu_enabled
Returns the value of attribute bootmenu_enabled.
-
- (Object) cmdline
Returns the value of attribute cmdline.
-
- (Object) initrd
Returns the value of attribute initrd.
-
- (Object) kernel
Direct kernel boot.
-
- (Object) loader
Part of the BIOS bootloader.
-
- (Object) type
Returns the value of attribute type.
Instance Method Summary (collapse)
-
- (OSBooting) initialize
constructor
A new instance of OSBooting.
-
- (Object) to_xml(parent = Nokogiri::XML::Builder.new)
Convert just the OS booting section to its XML representation.
Constructor Details
- (OSBooting) initialize
A new instance of OSBooting
29 30 31 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 29 def initialize @boot = [] end |
Instance Attribute Details
- (Object) arch
Returns the value of attribute arch
15 16 17 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 15 def arch @arch end |
- (Object) boot
Returns the value of attribute boot
17 18 19 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 17 def boot @boot end |
- (Object) bootloader
Host bootloader configuration options
21 22 23 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 21 def bootloader @bootloader end |
- (Object) bootloader_args
Returns the value of attribute bootloader_args
22 23 24 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 22 def bootloader_args @bootloader_args end |
Returns the value of attribute bootmenu_enabled
18 19 20 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 18 def @bootmenu_enabled end |
- (Object) cmdline
Returns the value of attribute cmdline
27 28 29 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 27 def cmdline @cmdline end |
- (Object) initrd
Returns the value of attribute initrd
26 27 28 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 26 def initrd @initrd end |
- (Object) kernel
Direct kernel boot
25 26 27 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 25 def kernel @kernel end |
- (Object) loader
Part of the BIOS bootloader
16 17 18 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 16 def loader @loader end |
- (Object) type
Returns the value of attribute type
14 15 16 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 14 def type @type end |
Instance Method Details
- (Object) to_xml(parent = Nokogiri::XML::Builder.new)
Convert just the OS booting section to its XML representation.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/libvirt/spec/domain/os_booting.rb', line 40 def to_xml(parent=Nokogiri::XML::Builder.new) parent.os do |os| # Build the arguments for the OS booting type type_args = [type] type_args << { :arch => arch } if arch # Setup the specification os.type_ *type_args os.loader loader if loader os.(:enable => ? 'yes' : 'no') if !.nil? # Boot order for BIOS booting boot.each { |dev| os.boot :dev => dev } if boot.is_a?(Array) # Host bootloader configuration options os.bootloader bootloader if bootloader os.bootloader_args bootloader_args if bootloader_args # Direct kernel boot options os.kernel kernel if kernel os.initrd initrd if initrd os.cmdline cmdline if cmdline end parent.to_xml end |