mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +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,18 +3544,14 @@ 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);
|
||||
if (!optstr)
|
||||
return -1;
|
||||
virCommandAddArg(cmd, optstr);
|
||||
VIR_FREE(optstr);
|
||||
} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BALLOON)) {
|
||||
virCommandAddArgList(cmd, "-balloon", "virtio", NULL);
|
||||
}
|
||||
virCommandAddArg(cmd, "-device");
|
||||
|
||||
optstr = qemuBuildMemballoonDevStr(def, def->memballoon, qemuCaps);
|
||||
if (!optstr)
|
||||
return -1;
|
||||
virCommandAddArg(cmd, optstr);
|
||||
VIR_FREE(optstr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user