mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu_command: cleanup qemuBuildVideoCommandLine
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
4c029e8cfa
commit
724d51786e
@ -4409,31 +4409,28 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!def->videos)
|
for (i = 0; i < def->nvideos; i++) {
|
||||||
return 0;
|
char *str = NULL;
|
||||||
|
virDomainVideoDefPtr video = def->videos[i];
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) {
|
if (video->primary) {
|
||||||
for (i = 0; i < def->nvideos; i++) {
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) {
|
||||||
char *str;
|
|
||||||
virCommandAddArg(cmd, "-device");
|
|
||||||
if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i],
|
|
||||||
qemuCaps)))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
virCommandAddArg(cmd, str);
|
virCommandAddArg(cmd, "-device");
|
||||||
VIR_FREE(str);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (qemuBuildVgaVideoCommand(cmd, def->videos[0], qemuCaps) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
for (i = 1; i < def->nvideos; i++) {
|
if (!(str = qemuBuildDeviceVideoStr(def, video, qemuCaps)))
|
||||||
char *str;
|
return -1;
|
||||||
|
|
||||||
|
virCommandAddArg(cmd, str);
|
||||||
|
VIR_FREE(str);
|
||||||
|
} else {
|
||||||
|
if (qemuBuildVgaVideoCommand(cmd, video, qemuCaps) < 0)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
virCommandAddArg(cmd, "-device");
|
virCommandAddArg(cmd, "-device");
|
||||||
|
|
||||||
if (!(str = qemuBuildDeviceVideoStr(def, def->videos[i],
|
if (!(str = qemuBuildDeviceVideoStr(def, video, qemuCaps)))
|
||||||
qemuCaps)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, str);
|
virCommandAddArg(cmd, str);
|
||||||
|
Loading…
Reference in New Issue
Block a user