Introduce 'qemuBuildCommandLineFlags' and use it instead of specific flag booleans. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_command.c | 3 +-- src/qemu/qemu_command.h | 5 ++++- src/qemu/qemu_driver.c | 4 +++- src/qemu/qemu_process.c | 6 ++---- src/qemu/qemu_process.h | 8 ++++---- tests/qemuxml2argvtest.c | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f0d92a2a10..d3b3603fbe 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10428,7 +10428,6 @@ qemuBuildCommandLine(virQEMUDriver *driver, const char *migrateURI, virDomainMomentObj *snapshot, virNetDevVPortProfileOp vmop, - bool standalone, bool enableFips, size_t *nnicindexes, int **nicindexes, @@ -10476,7 +10475,7 @@ qemuBuildCommandLine(virQEMUDriver *driver, qemuBuildCompatDeprecatedCommandLine(cmd, cfg, def, qemuCaps); - if (!standalone) + if (!(flags & QEMU_BUILD_COMMAND_LINE_CPUS_RUNNING)) virCommandAddArg(cmd, "-S"); /* freeze CPU */ if (qemuBuildMasterKeyCommandLine(cmd, priv) < 0) diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 9e8eef1e29..df46e80067 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -43,12 +43,15 @@ VIR_ENUM_DECL(qemuVideo); VIR_ENUM_DECL(qemuSoundCodec); +typedef enum { + QEMU_BUILD_COMMAND_LINE_CPUS_RUNNING = 1 << 0, +} qemuBuildCommandLineFlags; + virCommand *qemuBuildCommandLine(virQEMUDriver *driver, virDomainObj *vm, const char *migrateURI, virDomainMomentObj *snapshot, virNetDevVPortProfileOp vmop, - bool standalone, bool enableFips, size_t *nnicindexes, int **nicindexes, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 702fd0239c..4f6b295859 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6330,6 +6330,7 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, virQEMUDriver *driver = conn->privateData; virDomainObj *vm = NULL; g_autoptr(virCommand) cmd = NULL; + unsigned int commandlineflags = QEMU_BUILD_COMMAND_LINE_CPUS_RUNNING; char *ret = NULL; size_t i; @@ -6383,7 +6384,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, goto cleanup; if (!(cmd = qemuProcessCreatePretendCmdBuild(driver, vm, NULL, - qemuCheckFips(vm), true))) + qemuCheckFips(vm), + commandlineflags))) goto cleanup; ret = virCommandToString(cmd, false); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 07e467d01e..38079ce159 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7450,7 +7450,6 @@ qemuProcessLaunch(virConnectPtr conn, vm, incoming ? "defer" : NULL, snapshot, vmop, - false, qemuCheckFips(vm), &nnicindexes, &nicindexes, 0))) goto cleanup; @@ -7952,7 +7951,7 @@ qemuProcessCreatePretendCmdBuild(virQEMUDriver *driver, virDomainObj *vm, const char *migrateURI, bool enableFips, - bool standalone) + unsigned int flags) { VIR_DEBUG("Building emulator command line"); return qemuBuildCommandLine(driver, @@ -7960,11 +7959,10 @@ qemuProcessCreatePretendCmdBuild(virQEMUDriver *driver, migrateURI, NULL, VIR_NETDEV_VPORT_PROFILE_OP_NO_OP, - standalone, enableFips, NULL, NULL, - 0); + flags); } diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index f81bfd930a..fa3634c64f 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -98,10 +98,10 @@ int qemuProcessCreatePretendCmdPrepare(virQEMUDriver *driver, unsigned int flags); virCommand *qemuProcessCreatePretendCmdBuild(virQEMUDriver *driver, - virDomainObj *vm, - const char *migrateURI, - bool enableFips, - bool standalone); + virDomainObj *vm, + const char *migrateURI, + bool enableFips, + unsigned int flags); int qemuProcessInit(virQEMUDriver *driver, virDomainObj *vm, diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7708e3ba3e..8d0d4acca9 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -488,7 +488,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriver *drv, enableFips = false; return qemuProcessCreatePretendCmdBuild(drv, vm, migrateURI, - enableFips, false); + enableFips, 0); } -- 2.35.3