mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
qemu: Fix memstat for (non-)transitional memballoon
Depending on the memballoon model, the corresponding QOM node will have a different type and we need to account for this when searching for it in the QOM tree. https://bugzilla.redhat.com/show_bug.cgi?id=1911786 Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
a42218cc0b
commit
0a6cb05e95
@ -1017,7 +1017,27 @@ qemuMonitorInitBalloonObjectPath(qemuMonitorPtr mon,
|
||||
|
||||
switch (balloon->info.type) {
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
|
||||
name = "virtio-balloon-pci";
|
||||
switch ((virDomainMemballoonModel) balloon->model) {
|
||||
case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO:
|
||||
name = "virtio-balloon-pci";
|
||||
break;
|
||||
case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_TRANSITIONAL:
|
||||
name = "virtio-balloon-pci-transitional";
|
||||
break;
|
||||
case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_NON_TRANSITIONAL:
|
||||
name = "virtio-balloon-pci-non-transitional";
|
||||
break;
|
||||
case VIR_DOMAIN_MEMBALLOON_MODEL_XEN:
|
||||
case VIR_DOMAIN_MEMBALLOON_MODEL_NONE:
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("invalid model for virtio-balloon-pci"));
|
||||
return;
|
||||
case VIR_DOMAIN_MEMBALLOON_MODEL_LAST:
|
||||
default:
|
||||
virReportEnumRangeError(virDomainMemballoonModel,
|
||||
balloon->model);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW:
|
||||
name = "virtio-balloon-ccw";
|
||||
|
Loading…
x
Reference in New Issue
Block a user