mirror of https://gitee.com/openkylin/libvirt.git
qemu: caps: Always assume QEMU_CAPS_BALLOON_EVENT
The event was added to qemu by commit 973603a813c5d60 which is contained in the 1.2.0 release. Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
6d3c96f0d9
commit
3f2fa8f303
|
@ -987,7 +987,6 @@ struct virQEMUCapsStringFlags virQEMUCapsMigration[] = {
|
|||
};
|
||||
|
||||
struct virQEMUCapsStringFlags virQEMUCapsEvents[] = {
|
||||
{ "BALLOON_CHANGE", QEMU_CAPS_BALLOON_EVENT },
|
||||
{ "SPICE_MIGRATE_COMPLETED", QEMU_CAPS_SEAMLESS_MIGRATION },
|
||||
{ "DEVICE_DELETED", QEMU_CAPS_DEVICE_DEL_EVENT },
|
||||
{ "MIGRATION", QEMU_CAPS_MIGRATION_EVENT },
|
||||
|
|
|
@ -183,7 +183,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
|||
QEMU_CAPS_DUMP_GUEST_MEMORY, /* dump-guest-memory command */
|
||||
QEMU_CAPS_NEC_USB_XHCI, /* -device nec-usb-xhci */
|
||||
QEMU_CAPS_VIRTIO_S390, /* -device virtio-*-s390 */
|
||||
QEMU_CAPS_BALLOON_EVENT, /* Async event for balloon changes */
|
||||
X_QEMU_CAPS_BALLOON_EVENT, /* Async event for balloon changes */
|
||||
|
||||
/* 100 */
|
||||
X_QEMU_CAPS_NETDEV_BRIDGE, /* bridge helper support */
|
||||
|
|
|
@ -10262,21 +10262,15 @@ qemuDomainMachineHasBuiltinIDE(const char *machine)
|
|||
/**
|
||||
* qemuDomainUpdateCurrentMemorySize:
|
||||
*
|
||||
* Updates the current balloon size from the monitor if necessary. In case when
|
||||
* the balloon is not present for the domain, the function recalculates the
|
||||
* maximum size to reflect possible changes.
|
||||
* In case when the balloon is not present for the domain, the function
|
||||
* recalculates the maximum size to reflect possible changes.
|
||||
*
|
||||
* Returns 0 on success and updates vm->def->mem.cur_balloon if necessary, -1 on
|
||||
* error and reports libvirt error.
|
||||
* Returns 0 on success and updates vm->def->mem.cur_balloon if necessary.
|
||||
*/
|
||||
int
|
||||
qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
|
||||
qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
|
||||
virDomainObjPtr vm)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
unsigned long long balloon;
|
||||
int ret = -1;
|
||||
|
||||
/* inactive domain doesn't need size update */
|
||||
if (!virDomainObjIsActive(vm))
|
||||
return 0;
|
||||
|
@ -10288,35 +10282,6 @@ qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* current size is always automagically updated via the event */
|
||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BALLOON_EVENT))
|
||||
return 0;
|
||||
|
||||
/* here we need to ask the monitor */
|
||||
|
||||
/* Don't delay if someone's using the monitor, just use existing most
|
||||
* recent data instead */
|
||||
if (qemuDomainJobAllowed(priv, QEMU_JOB_QUERY)) {
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainObjCheckActive(vm) < 0)
|
||||
goto endjob;
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
ret = qemuMonitorGetBalloonInfo(priv->mon, &balloon);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||
ret = -1;
|
||||
|
||||
endjob:
|
||||
qemuDomainObjEndJob(driver, vm);
|
||||
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
|
||||
vm->def->mem.cur_balloon = balloon;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -20295,26 +20295,22 @@ qemuDomainGetStatsBalloon(virQEMUDriverPtr driver,
|
|||
int *maxparams,
|
||||
unsigned int privflags)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv = dom->privateData;
|
||||
virDomainMemoryStatStruct stats[VIR_DOMAIN_MEMORY_STAT_NR];
|
||||
int nr_stats;
|
||||
unsigned long long cur_balloon = 0;
|
||||
size_t i;
|
||||
int err = 0;
|
||||
|
||||
if (!virDomainDefHasMemballoon(dom->def)) {
|
||||
cur_balloon = virDomainDefGetMemoryTotal(dom->def);
|
||||
} else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BALLOON_EVENT)) {
|
||||
cur_balloon = dom->def->mem.cur_balloon;
|
||||
} else {
|
||||
err = -1;
|
||||
cur_balloon = dom->def->mem.cur_balloon;
|
||||
}
|
||||
|
||||
if (!err && virTypedParamsAddULLong(&record->params,
|
||||
&record->nparams,
|
||||
maxparams,
|
||||
"balloon.current",
|
||||
cur_balloon) < 0)
|
||||
if (virTypedParamsAddULLong(&record->params,
|
||||
&record->nparams,
|
||||
maxparams,
|
||||
"balloon.current",
|
||||
cur_balloon) < 0)
|
||||
return -1;
|
||||
|
||||
if (virTypedParamsAddULLong(&record->params,
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
<flag name='seccomp-sandbox'/>
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='scsi-disk.wwn'/>
|
||||
<flag name='seccomp-sandbox'/>
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
<flag name='transaction'/>
|
||||
<flag name='block-job-async'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
<flag name='usb-redir.filter'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<flag name='hda-micro'/>
|
||||
<flag name='dump-guest-memory'/>
|
||||
<flag name='nec-usb-xhci'/>
|
||||
<flag name='balloon-event'/>
|
||||
<flag name='lsi'/>
|
||||
<flag name='virtio-scsi-pci'/>
|
||||
<flag name='blockio'/>
|
||||
|
|
Loading…
Reference in New Issue