diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8236c9a32aef046d38f42a4b21aa7cdf4aac617a..774ca37dc550b580014b08267bf9625944bb70ce 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8388,12 +8388,12 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManager, /* Use -chardev with -device if they are available */ if (virQEMUCapsSupportsChardev(def, qemuCaps, serial)) { - virCommandAddArg(cmd, "-chardev"); if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, def, &serial->source, serial->info.alias, qemuCaps))) return -1; + virCommandAddArg(cmd, "-chardev"); virCommandAddArg(cmd, devstr); VIR_FREE(devstr);