mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
qemu: don't append -chardev arg until after value is formatted
The act of formatting a chardev backend value may need to append command line arguments for passing FDs. If we append the -chardev arg before formatting the value, then the resulting arguments will end up interspersed Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
06cb0cf7ce
commit
0192447519
@ -4115,10 +4115,10 @@ qemuBuildMonitorCommandLine(virCommandPtr cmd,
|
|||||||
/* Use -chardev if it's available */
|
/* Use -chardev if it's available */
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) {
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) {
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-chardev");
|
|
||||||
if (!(chrdev = qemuBuildChrChardevStr(monitor_chr, "monitor",
|
if (!(chrdev = qemuBuildChrChardevStr(monitor_chr, "monitor",
|
||||||
qemuCaps)))
|
qemuCaps)))
|
||||||
return -1;
|
return -1;
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
virCommandAddArg(cmd, chrdev);
|
virCommandAddArg(cmd, chrdev);
|
||||||
VIR_FREE(chrdev);
|
VIR_FREE(chrdev);
|
||||||
|
|
||||||
@ -7959,13 +7959,13 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-chardev");
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(&smartcard->data.passthru,
|
if (!(devstr = qemuBuildChrChardevStr(&smartcard->data.passthru,
|
||||||
smartcard->info.alias,
|
smartcard->info.alias,
|
||||||
qemuCaps))) {
|
qemuCaps))) {
|
||||||
virBufferFreeAndReset(&opt);
|
virBufferFreeAndReset(&opt);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
|
|
||||||
@ -8003,11 +8003,11 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
|
|
||||||
/* Use -chardev with -device if they are available */
|
/* Use -chardev with -device if they are available */
|
||||||
if (virQEMUCapsSupportsChardev(def, qemuCaps, serial)) {
|
if (virQEMUCapsSupportsChardev(def, qemuCaps, serial)) {
|
||||||
virCommandAddArg(cmd, "-chardev");
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(&serial->source,
|
if (!(devstr = qemuBuildChrChardevStr(&serial->source,
|
||||||
serial->info.alias,
|
serial->info.alias,
|
||||||
qemuCaps)))
|
qemuCaps)))
|
||||||
goto error;
|
goto error;
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
|
|
||||||
@ -8039,11 +8039,11 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
/* Use -chardev with -device if they are available */
|
/* Use -chardev with -device if they are available */
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) &&
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) &&
|
||||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
||||||
virCommandAddArg(cmd, "-chardev");
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(¶llel->source,
|
if (!(devstr = qemuBuildChrChardevStr(¶llel->source,
|
||||||
parallel->info.alias,
|
parallel->info.alias,
|
||||||
qemuCaps)))
|
qemuCaps)))
|
||||||
goto error;
|
goto error;
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
|
|
||||||
@ -8072,11 +8072,11 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-chardev");
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(&channel->source,
|
if (!(devstr = qemuBuildChrChardevStr(&channel->source,
|
||||||
channel->info.alias,
|
channel->info.alias,
|
||||||
qemuCaps)))
|
qemuCaps)))
|
||||||
goto error;
|
goto error;
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
|
|
||||||
@ -8116,11 +8116,11 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
* the newer -chardev interface. */
|
* the newer -chardev interface. */
|
||||||
;
|
;
|
||||||
} else {
|
} else {
|
||||||
virCommandAddArg(cmd, "-chardev");
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(&channel->source,
|
if (!(devstr = qemuBuildChrChardevStr(&channel->source,
|
||||||
channel->info.alias,
|
channel->info.alias,
|
||||||
qemuCaps)))
|
qemuCaps)))
|
||||||
goto error;
|
goto error;
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
}
|
}
|
||||||
@ -8150,11 +8150,11 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-chardev");
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(&console->source,
|
if (!(devstr = qemuBuildChrChardevStr(&console->source,
|
||||||
console->info.alias,
|
console->info.alias,
|
||||||
qemuCaps)))
|
qemuCaps)))
|
||||||
goto error;
|
goto error;
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
|
|
||||||
@ -8169,11 +8169,11 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-chardev");
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(&console->source,
|
if (!(devstr = qemuBuildChrChardevStr(&console->source,
|
||||||
console->info.alias,
|
console->info.alias,
|
||||||
qemuCaps)))
|
qemuCaps)))
|
||||||
goto error;
|
goto error;
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
|
|
||||||
@ -8522,13 +8522,13 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
virDomainRedirdevDefPtr redirdev = def->redirdevs[i];
|
virDomainRedirdevDefPtr redirdev = def->redirdevs[i];
|
||||||
char *devstr;
|
char *devstr;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-chardev");
|
|
||||||
if (!(devstr = qemuBuildChrChardevStr(&redirdev->source.chr,
|
if (!(devstr = qemuBuildChrChardevStr(&redirdev->source.chr,
|
||||||
redirdev->info.alias,
|
redirdev->info.alias,
|
||||||
qemuCaps))) {
|
qemuCaps))) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virCommandAddArg(cmd, "-chardev");
|
||||||
virCommandAddArg(cmd, devstr);
|
virCommandAddArg(cmd, devstr);
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user