int xc_domain_maximum_gpfn(xc_interface *xch, uint32_t domid, xen_pfn_t *gpfns)
{
- long rc = do_memory_op(xch, XENMEM_maximum_gpfn, &domid, sizeof(domid));
+ struct xen_memory_domain dom = { .domid = domid };
+ long rc = do_memory_op(xch, XENMEM_maximum_gpfn, &dom, sizeof(dom));
if ( rc >= 0 )
{
long rc;
struct xen_memory_reservation reservation;
struct memop_args args;
- domid_t domid;
unsigned long start_extent = cmd >> MEMOP_EXTENT_SHIFT;
int op = cmd & MEMOP_CMD_MASK;
case XENMEM_current_reservation:
case XENMEM_maximum_reservation:
case XENMEM_maximum_gpfn:
+ {
+ struct xen_memory_domain domain;
+
if ( unlikely(start_extent) )
return -EINVAL;
- if ( copy_from_guest(&domid, arg, 1) )
+ if ( copy_from_guest(&domain, arg, 1) )
return -EFAULT;
- d = rcu_lock_domain_by_any_id(domid);
+ d = rcu_lock_domain_by_any_id(domain.domid);
if ( d == NULL )
return -ESRCH;
rcu_unlock_domain(d);
break;
+ }
case XENMEM_add_to_physmap:
{
*/
#define XENMEM_maximum_ram_page 2
+struct xen_memory_domain {
+ /* [IN] Domain information is being queried for. */
+ domid_t domid;
+};
+
/*
* Returns the current or maximum memory reservation, in pages, of the
* specified domain (may be DOMID_SELF). Returns -ve errcode on failure.
- * arg == addr of domid_t.
+ * arg == addr of struct xen_memory_domain.
*/
#define XENMEM_current_reservation 3
#define XENMEM_maximum_reservation 4
/*
- * Returns the maximum GPFN in use by the guest, or -ve errcode on failure.
+ * Returns the maximum GFN in use by the specified domain (may be DOMID_SELF).
+ * Returns -ve errcode on failure.
+ * arg == addr of struct xen_memory_domain.
*/
#define XENMEM_maximum_gpfn 14