* [PATCH v2] x86/hvm: Change return error for offline vcpus
@ 2018-09-21 7:30 Alexandru Isaila
2018-09-21 8:43 ` Wei Liu
2018-09-21 10:34 ` Jan Beulich
0 siblings, 2 replies; 6+ messages in thread
From: Alexandru Isaila @ 2018-09-21 7:30 UTC (permalink / raw)
To: xen-devel; +Cc: Alexandru Isaila, andrew.cooper3, wei.liu2, jbeulich
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>
---
Changes since V1:
- Add conditional statement in order to have a difference between
per_vcpu and per_dom return error.
---
xen/arch/x86/hvm/save.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index d520898843..1764fb0918 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -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;
--
2.17.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] x86/hvm: Change return error for offline vcpus
2018-09-21 7:30 [PATCH v2] x86/hvm: Change return error for offline vcpus Alexandru Isaila
@ 2018-09-21 8:43 ` Wei Liu
2018-09-21 8:44 ` Wei Liu
2018-09-21 10:34 ` Jan Beulich
1 sibling, 1 reply; 6+ messages in thread
From: Wei Liu @ 2018-09-21 8:43 UTC (permalink / raw)
To: Alexandru Isaila; +Cc: xen-devel, wei.liu2, jbeulich, andrew.cooper3
On Fri, Sep 21, 2018 at 10:30:30AM +0300, Alexandru Isaila wrote:
> This patch is needed in order to have a different return error for invalid vcpu
> and offline vcpu on the per vcpu king.
Sorry, I can't parse this sentence. What is "per vcpu king"?
>
> Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
>
> ---
> Changes since V1:
> - Add conditional statement in order to have a difference between
> per_vcpu and per_dom return error.
> ---
> xen/arch/x86/hvm/save.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
> index d520898843..1764fb0918 100644
> --- a/xen/arch/x86/hvm/save.c
> +++ b/xen/arch/x86/hvm/save.c
> @@ -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;
>
> --
> 2.17.1
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] x86/hvm: Change return error for offline vcpus
2018-09-21 8:43 ` Wei Liu
@ 2018-09-21 8:44 ` Wei Liu
2018-09-21 8:55 ` Isaila Alexandru
0 siblings, 1 reply; 6+ messages in thread
From: Wei Liu @ 2018-09-21 8:44 UTC (permalink / raw)
To: Alexandru Isaila; +Cc: xen-devel, wei.liu2, jbeulich, andrew.cooper3
On Fri, Sep 21, 2018 at 09:43:22AM +0100, Wei Liu wrote:
> On Fri, Sep 21, 2018 at 10:30:30AM +0300, Alexandru Isaila wrote:
> > This patch is needed in order to have a different return error for invalid vcpu
> > and offline vcpu on the per vcpu king.
>
> Sorry, I can't parse this sentence. What is "per vcpu king"?
Oh, "king" should be "kind".
>
> >
> > Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
> >
> > ---
> > Changes since V1:
> > - Add conditional statement in order to have a difference between
> > per_vcpu and per_dom return error.
> > ---
> > xen/arch/x86/hvm/save.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
> > index d520898843..1764fb0918 100644
> > --- a/xen/arch/x86/hvm/save.c
> > +++ b/xen/arch/x86/hvm/save.c
> > @@ -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;
> >
> > --
> > 2.17.1
> >
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] x86/hvm: Change return error for offline vcpus
2018-09-21 8:44 ` Wei Liu
@ 2018-09-21 8:55 ` Isaila Alexandru
0 siblings, 0 replies; 6+ messages in thread
From: Isaila Alexandru @ 2018-09-21 8:55 UTC (permalink / raw)
To: Wei Liu; +Cc: xen-devel, jbeulich, andrew.cooper3
On Fri, 2018-09-21 at 09:44 +0100, Wei Liu wrote:
> On Fri, Sep 21, 2018 at 09:43:22AM +0100, Wei Liu wrote:
> > On Fri, Sep 21, 2018 at 10:30:30AM +0300, Alexandru Isaila wrote:
> > > This patch is needed in order to have a different return error
> > > for invalid vcpu
> > > and offline vcpu on the per vcpu king.
> >
> > Sorry, I can't parse this sentence. What is "per vcpu king"?
>
> Oh, "king" should be "kind".
Yes, king = kind, sorry for that
>
> >
> > >
> > > Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
> > >
> > > ---
> > > Changes since V1:
> > > - Add conditional statement in order to have a difference
> > > between
> > > per_vcpu and per_dom return error.
> > > ---
> > > xen/arch/x86/hvm/save.c | 3 ++-
> > > 1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
> > > index d520898843..1764fb0918 100644
> > > --- a/xen/arch/x86/hvm/save.c
> > > +++ b/xen/arch/x86/hvm/save.c
> > > @@ -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;
> > >
> > > --
> > > 2.17.1
> > >
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] x86/hvm: Change return error for offline vcpus
2018-09-21 7:30 [PATCH v2] x86/hvm: Change return error for offline vcpus Alexandru Isaila
2018-09-21 8:43 ` Wei Liu
@ 2018-09-21 10:34 ` Jan Beulich
2018-09-21 14:23 ` Isaila Alexandru
1 sibling, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2018-09-21 10:34 UTC (permalink / raw)
To: aisaila; +Cc: Andrew Cooper, Wei Liu, xen-devel
>>> On 21.09.18 at 09:30, <aisaila@bitdefender.com> wrote:
> --- a/xen/arch/x86/hvm/save.c
> +++ b/xen/arch/x86/hvm/save.c
> @@ -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) )
This very certainly needs parenthesizes, since if asked explicitly I
don't think many people will be able to quickly answer the question
of precedence between the ?: and , operators. I'm happy to add
these while committing, and with them in place
Acked-by: Jan Beulich <jbeulich@suse.com>
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] x86/hvm: Change return error for offline vcpus
2018-09-21 10:34 ` Jan Beulich
@ 2018-09-21 14:23 ` Isaila Alexandru
0 siblings, 0 replies; 6+ messages in thread
From: Isaila Alexandru @ 2018-09-21 14:23 UTC (permalink / raw)
To: Jan Beulich; +Cc: Andrew Cooper, Wei Liu, xen-devel
On Fri, 2018-09-21 at 04:34 -0600, Jan Beulich wrote:
> > > > On 21.09.18 at 09:30, <aisaila@bitdefender.com> wrote:
> >
> > --- a/xen/arch/x86/hvm/save.c
> > +++ b/xen/arch/x86/hvm/save.c
> > @@ -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) )
>
> This very certainly needs parenthesizes, since if asked explicitly I
> don't think many people will be able to quickly answer the question
> of precedence between the ?: and , operators. I'm happy to add
> these while committing, and with them in place
> Acked-by: Jan Beulich <jbeulich@suse.com>
>
Ok, thanks for the help.
Alex
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-09-21 14:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-21 7:30 [PATCH v2] x86/hvm: Change return error for offline vcpus Alexandru Isaila
2018-09-21 8:43 ` Wei Liu
2018-09-21 8:44 ` Wei Liu
2018-09-21 8:55 ` Isaila Alexandru
2018-09-21 10:34 ` Jan Beulich
2018-09-21 14:23 ` Isaila Alexandru
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.