[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-4.0-testing] Allow VMs to query their own grant table version.
# HG changeset patch # User Paul Durrant <paul.durrant@xxxxxxxxxx> # Date 1324219864 0 # Node ID 5d372b8bccefea17a57a887f5828a57ee6adf2b5 # Parent 47bec9555bb4f6b10d9c7e57affc2401287c7f99 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 47bec9555bb4 -r 5d372b8bccef xen/arch/x86/hvm/hvm.c --- a/xen/arch/x86/hvm/hvm.c Sun Dec 18 14:49:59 2011 +0000 +++ b/xen/arch/x86/hvm/hvm.c Sun Dec 18 14:51:04 2011 +0000 @@ -2181,6 +2181,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 47bec9555bb4 -r 5d372b8bccef xen/common/grant_table.c --- a/xen/common/grant_table.c Sun Dec 18 14:49:59 2011 +0000 +++ b/xen/common/grant_table.c Sun Dec 18 14:51:04 2011 +0000 @@ -2199,17 +2199,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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |