xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Paul Durrant <paul@xen.org>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>, "Wei Liu" <wl@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Paul Durrant" <pdurrant@amazon.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	xen-devel@lists.xenproject.org,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v5 1/5] xen/common: introduce a new framework for save/restore of 'domain' context
Date: Fri, 22 May 2020 16:24:32 +0200	[thread overview]
Message-ID: <62f13c6d-8d5f-7d06-d7e9-d17b960c8264@suse.com> (raw)
In-Reply-To: <20200521161939.4508-2-paul@xen.org>

On 21.05.2020 18:19, Paul Durrant wrote:
> To allow enlightened HVM guests (i.e. those that have PV drivers) to be
> migrated without their co-operation it will be necessary to transfer 'PV'
> state such as event channel state, grant entry state, etc.
> 
> Currently there is a framework (entered via the hvm_save/load() functions)
> that allows a domain's 'HVM' (architectural) state to be transferred but
> 'PV' state is also common with pure PV guests and so this framework is not
> really suitable.
> 
> This patch adds the new public header and low level implementation of a new
> common framework, entered via the domain_save/load() functions. Subsequent
> patches will introduce other parts of the framework, and code that will
> make use of it within the current version of the libxc migration stream.
> 
> This patch also marks the HVM-only framework as deprecated in favour of the
> new framework.
> 
> Signed-off-by: Paul Durrant <pdurrant@amazon.com>
> Acked-by: Julien Grall <julien@xen.org>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with one remark:

> +int domain_load_end(struct domain_context *c)
> +{
> +    struct domain *d = c->domain;
> +    size_t len = c->desc.length - c->len;
> +
> +    while ( c->len != c->desc.length ) /* unconsumed data or pad */
> +    {
> +        uint8_t pad;
> +        int rc = domain_load_data(c, &pad, sizeof(pad));
> +
> +        if ( rc )
> +            return rc;
> +
> +        if ( pad )
> +            return -EINVAL;
> +    }
> +
> +    gdprintk(XENLOG_INFO, "%pd load: %s[%u] +%zu (-%zu)\n", d, c->name,
> +             c->desc.instance, c->len, len);

Unlike on the save side you assume c->name to be non-NULL here.
We're not going to crash because of this, but it feels a little
odd anyway, specifically with the function being non-static
(albeit on the positive side we have the type being private to
this file).

Jan


  reply	other threads:[~2020-05-22 14:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 16:19 [PATCH v5 0/5] domain context infrastructure Paul Durrant
2020-05-21 16:19 ` [PATCH v5 1/5] xen/common: introduce a new framework for save/restore of 'domain' context Paul Durrant
2020-05-22 14:24   ` Jan Beulich [this message]
2020-05-22 14:35     ` Durrant, Paul
2020-05-21 16:19 ` [PATCH v5 2/5] xen/common/domctl: introduce XEN_DOMCTL_get/setdomaincontext Paul Durrant
2020-05-21 16:19 ` [PATCH v5 3/5] tools/misc: add xen-domctx to present domain context Paul Durrant
2020-05-21 16:19 ` [PATCH v5 4/5] common/domain: add a domain context record for shared_info Paul Durrant
2020-05-22 14:34   ` Jan Beulich
2020-05-22 14:45     ` Durrant, Paul
2020-05-21 16:19 ` [PATCH v5 5/5] tools/libxc: make use of domain context SHARED_INFO record Paul Durrant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62f13c6d-8d5f-7d06-d7e9-d17b960c8264@suse.com \
    --to=jbeulich@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien@xen.org \
    --cc=paul@xen.org \
    --cc=pdurrant@amazon.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).