]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86/hvm: change gethvmcontext_partial error code for offline vcpus
authorAlexandru Isaila <aisaila@bitdefender.com>
Tue, 25 Sep 2018 14:29:18 +0000 (16:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 25 Sep 2018 14:29:18 +0000 (16:29 +0200)
This patch is needed in order to have a different return error for invalid vcpu
and offline vcpu on the per vcpu king.

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

index d5208988430b36da20dadf4f36a82a8d574d08c7..0fc59d3487ec55e3fe6532930c14fac923dbe29a 100644 (file)
@@ -165,7 +165,8 @@ int hvm_save_one(struct domain *d, unsigned int typecode, unsigned int instance,
     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);
-    else if ( rv = -ENOENT, ctxt.cur >= sizeof(*desc) )
+    else if ( (rv = hvm_sr_handlers[typecode].kind == HVMSR_PER_VCPU ?
+               -ENODATA : -ENOENT), ctxt.cur >= sizeof(*desc) )
     {
         uint32_t off;