From: Peter Krempa Date: Mon, 11 Oct 2021 14:21:31 +0000 (+0200) Subject: qemuBuildVMCoreInfoCommandLine: Generate via JSON X-Git-Tag: v7.9.0-rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d51f836b0be9c08f9e154c352da74d61c7e8e53;p=thirdparty%2Flibvirt.git qemuBuildVMCoreInfoCommandLine: Generate via JSON While this device doesn't have any properties it must be converted to use qemuBuildDeviceCommandlineFromJSON so that we can validate it in the future. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 86affcdf6f..56bf17b6b4 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10097,14 +10097,22 @@ qemuBuildSecCommandLine(virDomainObj *vm, virCommand *cmd, static int qemuBuildVMCoreInfoCommandLine(virCommand *cmd, - const virDomainDef *def) + const virDomainDef *def, + virQEMUCaps *qemuCaps) { - virTristateSwitch vmci = def->features[VIR_DOMAIN_FEATURE_VMCOREINFO]; + g_autoptr(virJSONValue) props = NULL; - if (vmci != VIR_TRISTATE_SWITCH_ON) + if (def->features[VIR_DOMAIN_FEATURE_VMCOREINFO] != VIR_TRISTATE_SWITCH_ON) return 0; - virCommandAddArgList(cmd, "-device", "vmcoreinfo", NULL); + if (virJSONValueObjectCreate(&props, + "s:driver", "vmcoreinfo", + NULL) < 0) + return -1; + + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + return -1; + return 0; } @@ -10785,7 +10793,7 @@ qemuBuildCommandLine(virQEMUDriver *driver, if (qemuBuildNVRAMCommandLine(cmd, def) < 0) return NULL; - if (qemuBuildVMCoreInfoCommandLine(cmd, def) < 0) + if (qemuBuildVMCoreInfoCommandLine(cmd, def, qemuCaps) < 0) return NULL; if (qemuBuildSecCommandLine(vm, cmd, def->sec) < 0)