mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-09 04:28:32 -05:00
bhyve: implement support for commandline args
Implement support for passing custom command line arguments
to bhyve using the 'bhyve:commandline' element:
<bhyve:commandline>
<bhyve:arg value='-newarg'/>
</bhyve:commandline>
* Define virDomainXMLNamespace for the bhyve driver, which
at this point supports only the 'commandline' element
described above,
* Update command generation code to inject these command line
arguments between driver-generated arguments and the vmname
positional argument.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/usr/sbin/bhyve \
|
||||
-c 1 \
|
||||
-m 214 \
|
||||
-u \
|
||||
-H \
|
||||
-P \
|
||||
-s 0:0,hostbridge \
|
||||
-s 2:0,ahci,hd:/tmp/freebsd.img \
|
||||
-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 ARGUMENT1 ARGUMENT2 bhyve
|
||||
@@ -0,0 +1,3 @@
|
||||
/usr/sbin/bhyveload \
|
||||
-m 214 \
|
||||
-d /tmp/freebsd.img bhyve
|
||||
@@ -0,0 +1,27 @@
|
||||
<domain type='bhyve' xmlns:bhyve="http://libvirt.org/schemas/domain/bhyve/1.0">
|
||||
<name>bhyve</name>
|
||||
<uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
|
||||
<memory>219136</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
</os>
|
||||
<devices>
|
||||
<disk type='file'>
|
||||
<driver name='file' type='raw'/>
|
||||
<source file='/tmp/freebsd.img'/>
|
||||
<target dev='hda' bus='sata'/>
|
||||
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<mac address='52:54:00:b9:94:02'/>
|
||||
<model type='virtio'/>
|
||||
<source bridge="virbr0"/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</interface>
|
||||
</devices>
|
||||
<bhyve:commandline>
|
||||
<bhyve:arg value='ARGUMENT1'/>
|
||||
<bhyve:arg value='ARGUMENT2'/>
|
||||
</bhyve:commandline>
|
||||
</domain>
|
||||
@@ -210,6 +210,7 @@ mymain(void)
|
||||
DO_TEST("vnc-autoport");
|
||||
DO_TEST("cputopology");
|
||||
DO_TEST_FAILURE("cputopology-nvcpu-mismatch");
|
||||
DO_TEST("commandline");
|
||||
|
||||
/* Address allocation tests */
|
||||
DO_TEST("addr-single-sata-disk");
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<domain type='bhyve' xmlns:bhyve='http://libvirt.org/schemas/domain/bhyve/1.0'>
|
||||
<name>bhyve</name>
|
||||
<uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<currentMemory unit='KiB'>219136</currentMemory>
|
||||
<vcpu placement='static'>1</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='file' type='raw'/>
|
||||
<source file='/tmp/freebsd.img'/>
|
||||
<target dev='hda' bus='sata'/>
|
||||
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
|
||||
</disk>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<controller type='sata' index='0'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||
</controller>
|
||||
<interface type='bridge'>
|
||||
<mac address='52:54:00:b9:94:02'/>
|
||||
<source bridge='virbr0'/>
|
||||
<model type='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</interface>
|
||||
</devices>
|
||||
<bhyve:commandline>
|
||||
<bhyve:arg value='ARGUMENT1'/>
|
||||
<bhyve:arg value='ARGUMENT2'/>
|
||||
</bhyve:commandline>
|
||||
</domain>
|
||||
@@ -110,6 +110,7 @@ mymain(void)
|
||||
DO_TEST_DIFFERENT("vnc-vgaconf-off");
|
||||
DO_TEST_DIFFERENT("vnc-vgaconf-io");
|
||||
DO_TEST_DIFFERENT("vnc-autoport");
|
||||
DO_TEST_DIFFERENT("commandline");
|
||||
|
||||
/* Address allocation tests */
|
||||
DO_TEST_DIFFERENT("addr-single-sata-disk");
|
||||
|
||||
Reference in New Issue
Block a user