diff options
author | Cornelia Huck <cohuck@redhat.com> | 2018-12-05 15:35:03 +0100 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2018-12-12 10:39:28 +0100 |
commit | 1883e8fc8005e9ef452890a075bae98e8c432968 (patch) | |
tree | d8deebf0e3b9950abf3cdb1f4e6ec62311d046b8 /hw/vfio | |
parent | 9bc9d3d1ae3bcd1caaad1946494726b52f58b291 (diff) | |
download | qemu-1883e8fc8005e9ef452890a075bae98e8c432968.zip qemu-1883e8fc8005e9ef452890a075bae98e8c432968.tar.gz qemu-1883e8fc8005e9ef452890a075bae98e8c432968.tar.bz2 |
vfio-ap: flag as compatible with balloon
vfio-ap devices do not pin any pages in the host. Therefore, they
are compatible with memory ballooning.
Flag them as compatible, so both vfio-ap and a balloon can be
used simultaneously.
Cc: qemu-stable@nongnu.org
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Tested-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r-- | hw/vfio/ap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 65de952..0a25f5e 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -104,6 +104,14 @@ static void vfio_ap_realize(DeviceState *dev, Error **errp) vapdev->vdev.name = g_strdup_printf("%s", mdevid); vapdev->vdev.dev = dev; + /* + * vfio-ap devices operate in a way compatible with + * memory ballooning, as no pages are pinned in the host. + * This needs to be set before vfio_get_device() for vfio common to + * handle the balloon inhibitor. + */ + vapdev->vdev.balloon_allowed = true; + ret = vfio_get_device(vfio_group, mdevid, &vapdev->vdev, &local_err); if (ret) { goto out_get_dev_err; |