> -----Original Message----- > From: Andrew Cooper <andrew.coop...@citrix.com> > Sent: 28 January 2021 12:02 > To: Xen-devel <xen-devel@lists.xenproject.org> > Cc: Andrew Cooper <andrew.coop...@citrix.com>; Wei Liu <w...@xen.org>; Paul > Durrant <p...@xen.org>; > Roger Pau Monné <roger....@citrix.com>; Juergen Gross <jgr...@suse.com>; Ian > Jackson > <i...@xenproject.org>; Michał Leszczyński <michal.leszczyn...@cert.pl>; > Hubert Jasudowicz > <hubert.jasudow...@cert.pl>; Tamas K Lengyel <ta...@tklengyel.com>; Manuel > Bouyer <bou...@netbsd.org> > Subject: [PATCH v4] tools/foreignmem: Support querying the size of a resource > > With the Xen side of this interface (soon to be) fixed to return real sizes, > userspace needs to be able to make the query. > > Introduce xenforeignmemory_resource_size() for the purpose, bumping the > library minor version. > > Update both all osdep_xenforeignmemory_map_resource() implementations to > understand size requests, skip the mmap() operation, and copy back the > nr_frames field. > > For NetBSD, also fix up the ioctl() error path to issue an unmap(), which was > overlooked by c/s 4a64e2bb39 "libs/foreignmemory: Implement on NetBSD". > > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> > Reviewed-by: Roger Pau Monné <roger....@citrix.com>
Reviewed-by: Paul Durrant <p...@xen.org>