summary refs log tree commit diff stats
path: root/hw/i386/kvm/xen_gnttab.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2022-12-16 23:49:48 +0000
committerDavid Woodhouse <dwmw@amazon.co.uk>2023-03-01 09:07:52 +0000
commitb46f9745b1b5c8dd6ea1bd1361531f966c404f8c (patch)
tree3a542535cce023b749abf69a1321852ed4a1f204 /hw/i386/kvm/xen_gnttab.c
parent28b7ae94a21d37f38f7b68a9f40fa521144898a6 (diff)
downloadfocaccia-qemu-b46f9745b1b5c8dd6ea1bd1361531f966c404f8c.tar.gz
focaccia-qemu-b46f9745b1b5c8dd6ea1bd1361531f966c404f8c.zip
hw/xen: Implement GNTTABOP_query_size
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Diffstat (limited to 'hw/i386/kvm/xen_gnttab.c')
-rw-r--r--hw/i386/kvm/xen_gnttab.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/i386/kvm/xen_gnttab.c b/hw/i386/kvm/xen_gnttab.c
index b54a94e2bd..1e691ded32 100644
--- a/hw/i386/kvm/xen_gnttab.c
+++ b/hw/i386/kvm/xen_gnttab.c
@@ -211,3 +211,22 @@ int xen_gnttab_get_version_op(struct gnttab_get_version *get)
     get->version = 1;
     return 0;
 }
+
+int xen_gnttab_query_size_op(struct gnttab_query_size *size)
+{
+    XenGnttabState *s = xen_gnttab_singleton;
+
+    if (!s) {
+        return -ENOTSUP;
+    }
+
+    if (size->dom != DOMID_SELF && size->dom != xen_domid) {
+        size->status = GNTST_bad_domain;
+        return 0;
+    }
+
+    size->status = GNTST_okay;
+    size->nr_frames = s->nr_frames;
+    size->max_nr_frames = s->max_frames;
+    return 0;
+}