[PATCH v4 5/6] qemu: add machine vmport argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fill qemu command line vmport argument as required.
---
 src/qemu/qemu_command.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f25a75f..7304d90 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7294,6 +7294,7 @@ qemuBuildMachineArgStr(virCommandPtr cmd,
         obsoleteAccel = true;
     } else {
         virBuffer buf = VIR_BUFFER_INITIALIZER;
+        virTristateSwitch vmport = def->features[VIR_DOMAIN_FEATURE_VMPORT];
 
         virCommandAddArg(cmd, "-machine");
         virBufferAdd(&buf, def->os.machine, -1);
@@ -7311,6 +7312,19 @@ qemuBuildMachineArgStr(virCommandPtr cmd,
         if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_USB_OPT))
             virBufferAddLit(&buf, ",usb=off");
 
+        if (vmport) {
+            if (!virQEMUCapsSupportsVmport(qemuCaps, def)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("vmport is not available "
+                                 "with this QEMU binary"));
+                virBufferFreeAndReset(&buf);
+                return -1;
+            }
+
+            virBufferAsprintf(&buf, ",vmport=%s",
+                              virTristateSwitchTypeToString(vmport));
+        }
+
         if (def->mem.dump_core) {
             if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DUMP_GUEST_CORE)) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-- 
2.1.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]