[libvirt] [PATCH] qemu: Fix shutdown regression

Jiri Denemark jdenemar at redhat.com
Wed Sep 21 11:31:21 UTC 2011


On Wed, Sep 21, 2011 at 10:29:35 +0100, Daniel P. Berrange wrote:
> On Wed, Sep 21, 2011 at 10:43:32AM +0200, Jiri Denemark wrote:
> > The commit that prevents disk corruption on domain shutdown
> > (96fc4784177ecb70357518fa863442455e45ad0e) causes regression with QEMU
> > 0.14.* and 0.15.* because of a regression bug in QEMU that was fixed
> > only recently in QEMU git. The affected versions of QEMU do not quit on
> > SIGTERM if started with -no-shutdown, which we use to implement fake
> > reboot. Since -no-shutdown tells QEMU not to quit automatically on guest
> > shutdown, domains started using the affected QEMU cannot be shutdown
> > properly and stay in a paused state.
> > 
> > This patch disables fake reboot feature on such QEMU by not using
> > -no-shutdown, which makes shutdown work as expected. However,
> > virDomainReboot will not work in this case and it will report "Requested
> > operation is not valid: Reboot is not supported with this QEMU binary".
> > 
> > NB, the qemu capability is called QEMU_CAPS_NO_FAKE_REBOOT for backward
> > compatibility with running domains started by libvirtd that didn't have
> > this patch in.
> > ---
> >  src/qemu/qemu_capabilities.c |    9 +++++++++
> >  src/qemu/qemu_capabilities.h |    1 +
> >  src/qemu/qemu_command.c      |    2 +-
> >  src/qemu/qemu_driver.c       |    6 ++++++
> >  4 files changed, 17 insertions(+), 1 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> > index 36f47a9..5b9e4a9 100644
> > --- a/src/qemu/qemu_capabilities.c
> > +++ b/src/qemu/qemu_capabilities.c
> > @@ -136,6 +136,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
> >                "pci-ohci",
> >                "usb-redir",
> >                "usb-hub",
> > +              "no-fake-reboot",
> >      );
> 
> This should really be 'no-shutdown'.
> 
> The reboot code is just one current potential user of that capability.

Yeah, that makes sense. I'm just worried about compatibility with domain
started by older libvirtd since they were started with -no-shutdown but qemu
capabilities in status xml doesn't mention that. So if the qemu is old or new
enough to support -no-shutdown properly, the new libvirtd won't allow running
domains to be rebooted using virDomainReboot until they are recreated and
no-shutdown capability detected. Another issue is that domain started by older
libvirtd with -no-shutdown will remain paused on shutdown. In other words,
this patch fixes only domains that will be started in the future, not
currently running ones.

Jirka




More information about the libvir-list mailing list