mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
qemu: command: Use -name guest= if available
-name guest= is the explicit parameter for passing a VM name. Using it is required to allow a VM with an '=' in the name https://bugzilla.redhat.com/show_bug.cgi?id=1276485
This commit is contained in:
parent
7dbbc0ca07
commit
e3a6859019
@ -328,6 +328,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
|
|||||||
"device-tray-moved-event",
|
"device-tray-moved-event",
|
||||||
"nec-usb-xhci-ports",
|
"nec-usb-xhci-ports",
|
||||||
"virtio-scsi-pci.iothread",
|
"virtio-scsi-pci.iothread",
|
||||||
|
"name-guest",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -2667,6 +2668,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = {
|
|||||||
{ "spice", "gl", QEMU_CAPS_SPICE_GL },
|
{ "spice", "gl", QEMU_CAPS_SPICE_GL },
|
||||||
{ "chardev", "logfile", QEMU_CAPS_CHARDEV_LOGFILE },
|
{ "chardev", "logfile", QEMU_CAPS_CHARDEV_LOGFILE },
|
||||||
{ "name", "debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS },
|
{ "name", "debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS },
|
||||||
|
{ "name", "guest", QEMU_CAPS_NAME_GUEST },
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -359,6 +359,7 @@ typedef enum {
|
|||||||
QEMU_CAPS_DEVICE_TRAY_MOVED, /* DEVICE_TRAY_MOVED event */
|
QEMU_CAPS_DEVICE_TRAY_MOVED, /* DEVICE_TRAY_MOVED event */
|
||||||
QEMU_CAPS_NEC_USB_XHCI_PORTS, /* -device nec-usb-xhci.p3 ports setting */
|
QEMU_CAPS_NEC_USB_XHCI_PORTS, /* -device nec-usb-xhci.p3 ports setting */
|
||||||
QEMU_CAPS_VIRTIO_SCSI_IOTHREAD, /* virtio-scsi-{pci,ccw}.iothread */
|
QEMU_CAPS_VIRTIO_SCSI_IOTHREAD, /* virtio-scsi-{pci,ccw}.iothread */
|
||||||
|
QEMU_CAPS_NAME_GUEST, /* -name guest= */
|
||||||
|
|
||||||
QEMU_CAPS_LAST /* this must always be the last item */
|
QEMU_CAPS_LAST /* this must always be the last item */
|
||||||
} virQEMUCapsFlags;
|
} virQEMUCapsFlags;
|
||||||
|
@ -6869,6 +6869,10 @@ qemuBuildNameCommandLine(virCommandPtr cmd,
|
|||||||
|
|
||||||
virCommandAddArg(cmd, "-name");
|
virCommandAddArg(cmd, "-name");
|
||||||
|
|
||||||
|
/* The 'guest' option let's us handle a name with '=' embedded in it */
|
||||||
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NAME_GUEST))
|
||||||
|
virBufferAddLit(&buf, "guest=");
|
||||||
|
|
||||||
qemuBufferEscapeComma(&buf, def->name);
|
qemuBufferEscapeComma(&buf, def->name);
|
||||||
|
|
||||||
if (cfg->setProcessName &&
|
if (cfg->setProcessName &&
|
||||||
|
@ -168,6 +168,7 @@
|
|||||||
<flag name='debug-threads'/>
|
<flag name='debug-threads'/>
|
||||||
<flag name='device-tray-moved-event'/>
|
<flag name='device-tray-moved-event'/>
|
||||||
<flag name='nec-usb-xhci-ports'/>
|
<flag name='nec-usb-xhci-ports'/>
|
||||||
|
<flag name='name-guest'/>
|
||||||
<version>2001001</version>
|
<version>2001001</version>
|
||||||
<kvmVersion>0</kvmVersion>
|
<kvmVersion>0</kvmVersion>
|
||||||
<package></package>
|
<package></package>
|
||||||
|
@ -181,6 +181,7 @@
|
|||||||
<flag name='device-tray-moved-event'/>
|
<flag name='device-tray-moved-event'/>
|
||||||
<flag name='nec-usb-xhci-ports'/>
|
<flag name='nec-usb-xhci-ports'/>
|
||||||
<flag name='virtio-scsi-pci.iothread'/>
|
<flag name='virtio-scsi-pci.iothread'/>
|
||||||
|
<flag name='name-guest'/>
|
||||||
<version>2004000</version>
|
<version>2004000</version>
|
||||||
<kvmVersion>0</kvmVersion>
|
<kvmVersion>0</kvmVersion>
|
||||||
<package></package>
|
<package></package>
|
||||||
|
@ -182,6 +182,7 @@
|
|||||||
<flag name='device-tray-moved-event'/>
|
<flag name='device-tray-moved-event'/>
|
||||||
<flag name='nec-usb-xhci-ports'/>
|
<flag name='nec-usb-xhci-ports'/>
|
||||||
<flag name='virtio-scsi-pci.iothread'/>
|
<flag name='virtio-scsi-pci.iothread'/>
|
||||||
|
<flag name='name-guest'/>
|
||||||
<version>2004000</version>
|
<version>2004000</version>
|
||||||
<kvmVersion>0</kvmVersion>
|
<kvmVersion>0</kvmVersion>
|
||||||
<package></package>
|
<package></package>
|
||||||
|
@ -158,6 +158,7 @@
|
|||||||
<flag name='device-tray-moved-event'/>
|
<flag name='device-tray-moved-event'/>
|
||||||
<flag name='nec-usb-xhci-ports'/>
|
<flag name='nec-usb-xhci-ports'/>
|
||||||
<flag name='virtio-scsi-pci.iothread'/>
|
<flag name='virtio-scsi-pci.iothread'/>
|
||||||
|
<flag name='name-guest'/>
|
||||||
<version>2005094</version>
|
<version>2005094</version>
|
||||||
<kvmVersion>0</kvmVersion>
|
<kvmVersion>0</kvmVersion>
|
||||||
<package></package>
|
<package></package>
|
||||||
|
@ -158,6 +158,7 @@
|
|||||||
<flag name='device-tray-moved-event'/>
|
<flag name='device-tray-moved-event'/>
|
||||||
<flag name='nec-usb-xhci-ports'/>
|
<flag name='nec-usb-xhci-ports'/>
|
||||||
<flag name='virtio-scsi-pci.iothread'/>
|
<flag name='virtio-scsi-pci.iothread'/>
|
||||||
|
<flag name='name-guest'/>
|
||||||
<version>2005094</version>
|
<version>2005094</version>
|
||||||
<kvmVersion>0</kvmVersion>
|
<kvmVersion>0</kvmVersion>
|
||||||
<package></package>
|
<package></package>
|
||||||
|
@ -152,6 +152,7 @@
|
|||||||
<flag name='device-tray-moved-event'/>
|
<flag name='device-tray-moved-event'/>
|
||||||
<flag name='nec-usb-xhci-ports'/>
|
<flag name='nec-usb-xhci-ports'/>
|
||||||
<flag name='virtio-scsi-pci.iothread'/>
|
<flag name='virtio-scsi-pci.iothread'/>
|
||||||
|
<flag name='name-guest'/>
|
||||||
<version>2005094</version>
|
<version>2005094</version>
|
||||||
<kvmVersion>0</kvmVersion>
|
<kvmVersion>0</kvmVersion>
|
||||||
<package></package>
|
<package></package>
|
||||||
|
@ -187,6 +187,7 @@
|
|||||||
<flag name='device-tray-moved-event'/>
|
<flag name='device-tray-moved-event'/>
|
||||||
<flag name='nec-usb-xhci-ports'/>
|
<flag name='nec-usb-xhci-ports'/>
|
||||||
<flag name='virtio-scsi-pci.iothread'/>
|
<flag name='virtio-scsi-pci.iothread'/>
|
||||||
|
<flag name='name-guest'/>
|
||||||
<version>2005050</version>
|
<version>2005050</version>
|
||||||
<kvmVersion>0</kvmVersion>
|
<kvmVersion>0</kvmVersion>
|
||||||
<package></package>
|
<package></package>
|
||||||
|
@ -125,4 +125,5 @@
|
|||||||
<flag name='pvpanic'/>
|
<flag name='pvpanic'/>
|
||||||
<flag name='reboot-timeout'/>
|
<flag name='reboot-timeout'/>
|
||||||
<flag name='enable-fips'/>
|
<flag name='enable-fips'/>
|
||||||
|
<flag name='name-guest'/>
|
||||||
</qemuCaps>
|
</qemuCaps>
|
||||||
|
@ -124,4 +124,5 @@
|
|||||||
<flag name='pvpanic'/>
|
<flag name='pvpanic'/>
|
||||||
<flag name='reboot-timeout'/>
|
<flag name='reboot-timeout'/>
|
||||||
<flag name='enable-fips'/>
|
<flag name='enable-fips'/>
|
||||||
|
<flag name='name-guest'/>
|
||||||
</qemuCaps>
|
</qemuCaps>
|
||||||
|
@ -5,16 +5,16 @@ USER=test \
|
|||||||
LOGNAME=test \
|
LOGNAME=test \
|
||||||
QEMU_AUDIO_DRV=none \
|
QEMU_AUDIO_DRV=none \
|
||||||
/usr/bin/qemu \
|
/usr/bin/qemu \
|
||||||
-name foo,,bar,debug-threads=on \
|
-name guest=foo=1,,bar=2,debug-threads=on \
|
||||||
-S \
|
-S \
|
||||||
-object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-foo,,\
|
-object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-foo=1,,\
|
||||||
bar/master-key.aes \
|
bar=2/master-key.aes \
|
||||||
-M pc \
|
-M pc \
|
||||||
-m 214 \
|
-m 214 \
|
||||||
-smp 1 \
|
-smp 1 \
|
||||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||||
-nodefaults \
|
-nodefaults \
|
||||||
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo,,bar/monitor.sock,\
|
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo=1,,bar=2/monitor.sock,\
|
||||||
server,nowait \
|
server,nowait \
|
||||||
-mon chardev=charmonitor,id=monitor,mode=readline \
|
-mon chardev=charmonitor,id=monitor,mode=readline \
|
||||||
-no-acpi \
|
-no-acpi \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<domain type='qemu'>
|
<domain type='qemu'>
|
||||||
<name>foo,bar</name>
|
<name>foo=1,bar=2</name>
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
<memory unit='KiB'>219100</memory>
|
<memory unit='KiB'>219100</memory>
|
||||||
<currentMemory unit='KiB'>219100</currentMemory>
|
<currentMemory unit='KiB'>219100</currentMemory>
|
||||||
|
@ -1903,7 +1903,8 @@ mymain(void)
|
|||||||
NONE);
|
NONE);
|
||||||
|
|
||||||
DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS,
|
DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS,
|
||||||
QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC);
|
QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC,
|
||||||
|
QEMU_CAPS_NAME_GUEST);
|
||||||
DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS);
|
DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS);
|
||||||
|
|
||||||
DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);
|
DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);
|
||||||
|
Loading…
Reference in New Issue
Block a user