Skip to contentSkip to conversation

x86/hvm: Change return error for offline vcpus

PATCH Superseded Alexandru Isaila 2 participants 3 messages Sep 20, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/hvm: Change return error for offline vcpus

This patch is needed in order to have a different return error for invalid vcpu and offline vcpu.

---
 xen/arch/x86/hvm/save.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/save.c +1 -1
index d520898843..465eb82bc6 100644
@@ -165,7 +165,7 @@ 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 = -ENODATA, ctxt.cur >= sizeof(*desc) )
     {
         uint32_t off;
 
Signature · 7 lines
2.17.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

xen/arch/x86/hvm/save.c int hvm_save_one(struct domain *d, unsigned int typecode, unsigned int instance, · line 168

Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 20.09.18 at 14:54, <[email protected]> wrote:
xen/arch/x86/hvm/save.c +1 -1
@@ -165,7 +165,7 @@ 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 = -ENODATA, ctxt.cur >= sizeof(*desc) )

I think this change of error code should once again only be done for HVMSR_PER_VCPU kind records. For the others no data appearing is _the_ indication of the instance not existing.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 17 lines · Jan Beulich

xen/arch/x86/hvm/save.c int hvm_save_one(struct domain *d, unsigned int · line 170

Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 20.09.18 at 14:54, <[email protected]> wrote:
xen/arch/x86/hvm/save.c +1 -1
@@ -165,7 +165,7 @@ 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 = -ENODATA, ctxt.cur >= sizeof(*desc) )

I think this change of error code should once again only be done for HVMSR_PER_VCPU kind records. For the others no data appearing is _the_ indication of the instance not existing.

Ok, I will add a conditional for this inside the if()

Thanks,
Alex

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel