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