[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.1-testing] Allow VMs to query their own grant table version.



# HG changeset patch
# User Paul Durrant <paul.durrant@xxxxxxxxxx>
# Date 1324219643 0
# Node ID 6ccf1820fb942ddf8b54bd4dc1ddb2eae4667d3d
# Parent  c62738ea1bb4dd183b94127e4bcc4586514101f9
Allow VMs to query their own grant table version.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
Committed-by: Keir Fraser <keir@xxxxxxx>
xen-unstable changeset:   24427:931bf1105730
xen-unstable date:        Sun Dec 18 14:38:32 2011 +0000
---


diff -r c62738ea1bb4 -r 6ccf1820fb94 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Sun Dec 18 14:45:44 2011 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Sun Dec 18 14:47:23 2011 +0000
@@ -2523,6 +2523,7 @@
     case GNTTABOP_query_size:
     case GNTTABOP_setup_table:
     case GNTTABOP_set_version:
+    case GNTTABOP_get_version:
     case GNTTABOP_copy:
     case GNTTABOP_map_grant_ref:
     case GNTTABOP_unmap_grant_ref:
diff -r c62738ea1bb4 -r 6ccf1820fb94 xen/common/grant_table.c
--- a/xen/common/grant_table.c  Sun Dec 18 14:45:44 2011 +0000
+++ b/xen/common/grant_table.c  Sun Dec 18 14:47:23 2011 +0000
@@ -2227,17 +2227,15 @@
 {
     gnttab_get_version_t op;
     struct domain *d;
+    int rc;
 
     if ( copy_from_guest(&op, uop, 1) )
         return -EFAULT;
-    d = rcu_lock_domain_by_id(op.dom);
-    if ( d == NULL )
-        return -ESRCH;
-    if ( !IS_PRIV_FOR(current->domain, d) )
-    {
-        rcu_unlock_domain(d);
-        return -EPERM;
-    }
+
+    rc = rcu_lock_target_domain_by_id(op.dom, &d);
+    if ( rc < 0 )
+        return rc;
+
     spin_lock(&d->grant_table->lock);
     op.version = d->grant_table->gt_version;
     spin_unlock(&d->grant_table->lock);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.