Re: [PATCH v3 13/13] Initialize qemuImageBinary path at startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 01, 2013 at 14:00:47 +0100, Jiri Denemark wrote:
> On Fri, Feb 01, 2013 at 11:18:35 +0000, Daniel P. Berrange wrote:
> > From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> > 
> > ---
> >  src/qemu/qemu_domain.c | 11 +++--------
> >  src/qemu/qemu_driver.c |  3 +++
> >  2 files changed, 6 insertions(+), 8 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> > index cb031d8..5bf0ab0 100644
> > --- a/src/qemu/qemu_domain.c
> > +++ b/src/qemu/qemu_domain.c
> > @@ -1612,14 +1612,9 @@ cleanup:
> >  const char *
> >  qemuFindQemuImgBinary(virQEMUDriverPtr driver)
> >  {
> > -    if (!driver->qemuImgBinary) {
> > -        driver->qemuImgBinary = virFindFileInPath("kvm-img");
> > -        if (!driver->qemuImgBinary)
> > -            driver->qemuImgBinary = virFindFileInPath("qemu-img");
> > -        if (!driver->qemuImgBinary)
> > -            virReportError(VIR_ERR_INTERNAL_ERROR,
> > -                           "%s", _("unable to find kvm-img or qemu-img"));
> > -    }
> > +    if (!driver->qemuImgBinary)
> > +        virReportError(VIR_ERR_INTERNAL_ERROR,
> > +                       "%s", _("unable to find kvm-img or qemu-img"));
> >  
> >      return driver->qemuImgBinary;
> >  }
> > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> > index 1644792..ed44b06 100644
> > --- a/src/qemu/qemu_driver.c
> > +++ b/src/qemu/qemu_driver.c
> > @@ -738,6 +738,9 @@ qemuStartup(bool privileged,
> >                   virStrerror(-rc, ebuf, sizeof(ebuf)));
> >      }
> >  
> > +    qemu_driver->qemuImgBinary = virFindFileInPath("kvm-img");
> > +    if (!qemu_driver->qemuImgBinary)
> > +        qemu_driver->qemuImgBinary = virFindFileInPath("qemu-img");
> >  
> >      if (!(qemu_driver->lockManager =
> >            virLockManagerPluginNew(cfg->lockManagerName ?
> 
> After this patch, users cannot install missing {qemu,kvm}-img on the fly
> without restarting libvirtd. However, since the binary is either part of
> qemu package or the package depend on it and we already require libvirtd
> restart after installing qemu, this change seems fine.
> 
> ACK

And this patch should also change the annotation in

     /* Lazy-load on first use. Unsafe. XXX */
     char *qemuImgBinary;

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]