From: Ian Campbell <Ian.Campbell@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: David Scott <dave.scott@citrix.com>,
wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com,
ian.jackson@eu.citrix.com, rob.hoes@citrix.com,
euan.harris@citrix.com, xen-devel@lists.xenproject.org
Subject: Re: [PATCH] libxl: a domain can be dying but not shutdown
Date: Thu, 23 Oct 2014 10:42:49 +0100 [thread overview]
Message-ID: <1414057369.19198.28.camel@citrix.com> (raw)
In-Reply-To: <5447BA71.9030405@citrix.com>
On Wed, 2014-10-22 at 15:08 +0100, Andrew Cooper wrote:
> On 22/10/14 14:52, David Scott wrote:
> > The shutdown code is only present if the domain is shutdown.
> > If we attempt to extract it from the flags from a dying but not
> > shutdown domain then we get values like '255' which is not a
> > valid LIBXL_SHUTDOWN_REASON_. We should use LIBXL_SHUTDOWN_UNKNOWN
> > in this case.
> >
> > Signed-off-by: David Scott <dave.scott@citrix.com>
> >
> > ---
> >
> > This can be tested by running 2 domUs, and having one map pages from
> > the other. I used a vchan connection, so I had a vchan_server granting
> > pages and a vchan_client mapping them. I made sure the client is
> > never going to unmap the pages (I used 'sleep' in a Mirage kernel but
> > 'xl pause' from outside would probably also work) and then I
> > 'xl destroyed' the server. The server domain ends up stuck in the dying
> > state because the client still has a page mapped. The server domain
> > is not shutdown.
> >
> > According to 'xl list':
> >
> > djs@st20:~/djs55/list$ sudo xl list
> > Name ID Mem VCPUs State Time(s)
> > Domain-0 0 5278 6 r----- 10971.2
> > fedora 12 2048 1 -b---- 5470.0
> > (null) 21 0 1 -bp--d 25.1
> > vchan_client 22 256 1 -b---- 0.0
> >
> > and according to my test program which calls libxl_list_domain:
> >
> > domain 0 shutdown = 0 dying = 0 shutdown_reason = -1
> > domain 12 shutdown = 0 dying = 0 shutdown_reason = -1
> > domain 21 shutdown = 0 dying = 1 shutdown_reason = 255
> > domain 22 shutdown = 0 dying = 0 shutdown_reason = -1
> >
> > I believe this also manifests transiently during a normal 'xl destroy'.
> >
> > Cheers,
> > Dave
> > ---
>
> Hmm. Xen unconditionally sets the shutdown code in info->flags when
> querying for dominfo.
>
> d->shutdown_code defaults to -1 (which explains the 255, given the
> mask), but only becomes valid once d->is_shutting_down gets set.
>
> This equates to XEN_DOMINF_shutdown lower in the flags field, which is
> translated to xlinfo->shutdown just ahead of the context below.
>
> It is explicitly not valid for a dying domain, as a dying domain can be
> dying for many reasons, few of which include a valid shutdown code.
I'm afraid I can't tell whether this constitutes an implicit ack or a
nack of this patch.
> Therefore, other bits of libxl.h could do with correcting, given the
> buggy changeset 4d70c9c5
Do you know of any specific locations? I don't see any relevant uses of
the word "shutdown" or "reason" in libxl.h.
Did you instead mean this from libxl_types.idl:
# Valid iff (shutdown||dying).
#
# Otherwise set to a value guaranteed not to clash with any valid
# LIBXL_SHUTDOWN_REASON_* constant.
("shutdown_reason", libxl_shutdown_reason),
?
Ian.
next prev parent reply other threads:[~2014-10-23 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-22 13:52 [PATCH] libxl: a domain can be dying but not shutdown David Scott
2014-10-22 14:02 ` Rob Hoes
2014-10-22 14:08 ` Andrew Cooper
2014-10-23 9:42 ` Ian Campbell [this message]
2014-10-23 10:00 ` Andrew Cooper
2014-11-04 10:48 ` Ian Campbell
2014-11-04 11:34 ` Dave Scott
2014-11-04 11:35 ` Ian Campbell
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=1414057369.19198.28.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=dave.scott@citrix.com \
--cc=euan.harris@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=rob.hoes@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--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 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.