qemuBuildConsoleCommandLine: Remove identical code

Unify the cases for SCLP/SCLPLM/VIRTIO consoles as the code is
identical.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-11-04 14:12:05 +01:00
parent 850a7311b8
commit dc3f025617

View File

@ -9513,35 +9513,7 @@ qemuBuildConsoleCommandLine(virCommand *cmd,
switch (console->targetType) {
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP:
if (!(devstr = qemuBuildChrChardevStr(cmd,
cfg,
console->source,
console->info.alias,
qemuCaps)))
return -1;
virCommandAddArg(cmd, "-chardev");
virCommandAddArg(cmd, devstr);
VIR_FREE(devstr);
if (qemuBuildChrDeviceCommandLine(cmd, def, console, qemuCaps) < 0)
return -1;
break;
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM:
if (!(devstr = qemuBuildChrChardevStr(cmd,
cfg,
console->source,
console->info.alias,
qemuCaps)))
return -1;
virCommandAddArg(cmd, "-chardev");
virCommandAddArg(cmd, devstr);
VIR_FREE(devstr);
if (qemuBuildChrDeviceCommandLine(cmd, def, console, qemuCaps) < 0)
return -1;
break;
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO:
if (!(devstr = qemuBuildChrChardevStr(cmd,
cfg,