From: Michal Novotny <minovotn@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "'xen-devel@lists.xensource.com'" <xen-devel@lists.xensource.com>,
Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [PATCH] Fix bootloader handling when empty string is being output
Date: Tue, 31 Aug 2010 12:00:50 +0200 [thread overview]
Message-ID: <4C7CD2D2.9010305@redhat.com> (raw)
In-Reply-To: <4C7CC85A.8070803@redhat.com>
On 08/31/2010 11:16 AM, Paolo Bonzini wrote:
> On 08/31/2010 10:47 AM, Ian Campbell wrote:
>> On Mon, 2010-08-30 at 14:10 +0100, Michal Novotny wrote:
>>> Hi,
>>> this is the patch to fix empty string as the output value
>>> of the bootloader string. If there is no output then
>>> xend is being hung indefinitely unless you press Ctrl + C keys
>>> to trigger SIGINT.
>>
>> I think a similar fix will be needed to libxl_bootloader.c, right?
>
> Yes.
>
>> Could we potentially avoid the need to use a select timeout to poll for
>> bootloader exit by including the bootloader FIFO FD and/or the PTY FDs
>> in the select's exceptfds array? Presumably if the process on the other
>> end of such an FD exits that causes some sort of exceptional condition
>> (although historically I've had trouble finding the actual specified
>> behaviour in cases like this).
>
> Using the FIFO is not possible in general because you cannot be sure
> that the bootloader is opening it at all. In fact, in this case both
> libxl and xend will hang at "fifo_fd = open(fifo, O_RDONLY);" so you
> have to apply O_NDELAY already when you open the FIFO.
>
> Also, in the case the bootloader is not opening the FIFO at all, doing
> the waitpid in the same thread has a race if the process exits between
> the waitpid and select. Fixing the race requires pselect and,
> especially in Python, introduces more complications than it removes.
>
> So, for RHEL5 xend, Michal has a better version of the patch that will
> run the waitpid in a separate thread, and use a pipe to wake up the
> select. This does the same thing as /proc, but portably and without
> the need for polling.
>
> However, for both current xend and libxl, using the PTY sounds better,
> and it looks like an even simpler patch will work that:
>
> - uses O_RDONLY|O_NDELAY when opening the FIFO, and
>
> - exits bootloader_interact when bootloader_fd was in the returned
> rsel but ret == 0.
>
> Paolo
So, Paolo, what do you recommend for upstream version? There's the PTY
thing already so what should we do ? Ian, also, I don't know how it's
working with upstream version since I found out that syntax like `xm
create -c PVguest` with default settings (pyGrub bootloader) doesn't
show the pyGrub at all so I don't know what's wrong with my setup. I'm
using 2.6.32.15-xen kernel/hypervisor version with latest unstable
user-space tools.
Any hint how this should be working Ian?
Thanks,
Michal
--
Michal Novotny<minovotn@redhat.com>, RHCE
Virtualization Team (xen userspace), Red Hat
next prev parent reply other threads:[~2010-08-31 10:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-30 13:10 [PATCH] Fix bootloader handling when empty string is being output Michal Novotny
2010-08-31 8:47 ` Ian Campbell
2010-08-31 9:16 ` Paolo Bonzini
2010-08-31 10:00 ` Michal Novotny [this message]
2010-08-31 10:10 ` Ian Campbell
2010-08-31 10:18 ` Michal Novotny
2010-08-31 10:30 ` Paolo Bonzini
2010-08-31 11:12 ` Michal Novotny
2010-08-31 10:37 ` Ian Campbell
2010-08-31 11:14 ` Michal Novotny
2010-08-31 11:18 ` Michal Novotny
2010-08-31 11:33 ` Michal Novotny
2010-08-31 17:56 ` Ian Jackson
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=4C7CD2D2.9010305@redhat.com \
--to=minovotn@redhat.com \
--cc=Ian.Campbell@citrix.com \
--cc=pbonzini@redhat.com \
--cc=xen-devel@lists.xensource.com \
/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.