]> xenbits.xensource.com Git - xen.git/commitdiff
x86/domctl: don't pause the whole domain if only getting vcpu state
authorAlexandru Isaila <aisaila@bitdefender.com>
Mon, 10 Sep 2018 14:27:00 +0000 (16:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 12 Sep 2018 14:43:13 +0000 (16:43 +0200)
This patch is focused on moving changing hvm_save_one() to save one
typecode from one vcpu and now that the save functions get data from a
single vcpu we can pause the specific vcpu instead of the domain.

Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domctl.c
xen/arch/x86/hvm/save.c

index 797841e80359dc46a7a545ce98a13500c4b50d70..2284128e930593f19adba65057e4d6e84515b39f 100644 (file)
@@ -599,12 +599,10 @@ long arch_do_domctl(
              !is_hvm_domain(d) )
             break;
 
-        domain_pause(d);
         ret = hvm_save_one(d, domctl->u.hvmcontext_partial.type,
                            domctl->u.hvmcontext_partial.instance,
                            domctl->u.hvmcontext_partial.buffer,
                            &domctl->u.hvmcontext_partial.bufsz);
-        domain_unpause(d);
 
         if ( !ret )
             copyback = true;
index 3a7291949faaa51cc827ebbbaf6cd7d15c665d3e..d5208988430b36da20dadf4f36a82a8d574d08c7 100644 (file)
@@ -157,6 +157,11 @@ int hvm_save_one(struct domain *d, unsigned int typecode, unsigned int instance,
     if ( !ctxt.data )
         return -ENOMEM;
 
+    if ( hvm_sr_handlers[typecode].kind == HVMSR_PER_VCPU )
+        vcpu_pause(v);
+    else
+        domain_pause(d);
+
     if ( (rv = hvm_sr_handlers[typecode].save(v, &ctxt)) != 0 )
         printk(XENLOG_G_ERR "HVM%d save: failed to save type %"PRIu16" (%d)\n",
                d->domain_id, typecode, rv);
@@ -188,6 +193,11 @@ int hvm_save_one(struct domain *d, unsigned int typecode, unsigned int instance,
         }
     }
 
+    if ( hvm_sr_handlers[typecode].kind == HVMSR_PER_VCPU )
+        vcpu_unpause(v);
+    else
+        domain_unpause(d);
+
     xfree(ctxt.data);
     return rv;
 }