From: Wei Liu <wei.liu2@citrix.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>, Fatih Acar <fatih.acar@gandi.net>
Subject: Re: [PATCH 2/2] xl: disable events earlier for shutdown event
Date: Thu, 2 Feb 2017 16:00:06 +0000	[thread overview]
Message-ID: <20170202160006.65iuief63vt2m6h3@citrix.com> (raw)
In-Reply-To: <22675.21961.651818.622279@mariner.uk.xensource.com>
On Thu, Feb 02, 2017 at 03:52:41PM +0000, Ian Jackson wrote:
> Wei Liu writes ("[PATCH 2/2] xl: disable events earlier for shutdown event"):
> > We need to disable event machinery when the guest shuts down.  It
> > doesn't really matter where we disable it as long as it is within the
> > branch for shutdown event.
> 
> I don't think this is necessary.  My intent was that libxl_ctx_free
> would automatically disable all event generation, and that it is
> therefore not necessary to call _disable.
> 
> This isn't documented particularly clearly, but libxl_event.h says:
> 
>   * An evgen is associated with the libxl_ctx used for its creation.
>   * After libxl_ctx_free, all corresponding evgen handles become
>   * invalid and must no longer be passed to evdisable.
> 
> This implies it's legal to call libxl_ctx_free with some events
> enabled.
> 
That's right. But this is not saying there is bug in the event
machinery.
> But I think I don't really understand what the original bug is.
> 
The original bug is that:
1. boot a guest with no disks, so diskws is NULL, num_disks == 0
2. some removable disks are added, and domain config updated
3. guest reboots, xl gets shutdown event
4. handle_domain_death gets the latest d_config, num_disks != 0 now
5. try to disable disk eject events with evdisable_disk_ejects -> BOOM
So basically 5 needs to happen before 4. Moving that snippet seems to do
the trick, and then freeing diskws + setting it to NULL makes the
reboot path automatically re-register diskws.
Wei.
> Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply	other threads:[~2017-02-02 16:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 15:46 [PATCH 0/2] xl: event machinery fixes Wei Liu
2017-02-02 15:46 ` [PATCH 1/2] xl: free event in DOMAIN_RESTART_RENAME error path Wei Liu
2017-02-02 16:22   ` Wei Liu
2017-02-03 11:57   ` Ian Jackson
2017-02-02 15:46 ` [PATCH 2/2] xl: disable events earlier for shutdown event Wei Liu
2017-02-02 15:52   ` Ian Jackson
2017-02-02 16:00     ` Wei Liu [this message]
2017-02-02 16:05       ` Ian Jackson
2017-02-02 16:22         ` Wei Liu
2017-02-02 16:24           ` Ian Jackson
2017-02-03  9:46           ` Fatih Acar
2017-02-03 11:08             ` Wei Liu
2017-02-03 12:06 ` [PATCH 0/2] xl: event machinery fixes Wei Liu
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=20170202160006.65iuief63vt2m6h3@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=fatih.acar@gandi.net \
    --cc=ian.jackson@eu.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 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).