mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu: command: Assume QEMU_CAPS_DEVICE when building memballoon args
This commit is contained in:
parent
feffcc03a0
commit
c1300176f7
@ -3525,6 +3525,7 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd,
|
||||
const virDomainDef *def,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
char *optstr;
|
||||
/* QEMU changed its default behavior to not include the virtio balloon
|
||||
* device. Explicitly request it to ensure it will be present.
|
||||
*
|
||||
@ -3543,8 +3544,7 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd,
|
||||
virDomainMemballoonModelTypeToString(def->memballoon->model));
|
||||
return -1;
|
||||
}
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
||||
char *optstr;
|
||||
|
||||
virCommandAddArg(cmd, "-device");
|
||||
|
||||
optstr = qemuBuildMemballoonDevStr(def, def->memballoon, qemuCaps);
|
||||
@ -3552,9 +3552,6 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd,
|
||||
return -1;
|
||||
virCommandAddArg(cmd, optstr);
|
||||
VIR_FREE(optstr);
|
||||
} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BALLOON)) {
|
||||
virCommandAddArgList(cmd, "-balloon", "virtio", NULL);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user