Re: [libvirt] [PATCH] Refresh QEMU driver caps in getCapabilities

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

 



On Mon, May 04, 2009 at 03:08:20PM -0400, Cole Robinson wrote:
> Daniel P. Berrange wrote:
> > On Tue, Apr 28, 2009 at 12:25:41PM -0400, Cole Robinson wrote:
> > 
> > 
> >> diff --git a/src/qemu_driver.c b/src/qemu_driver.c
> >> index 79ee072..6b5c17f 100644
> >> --- a/src/qemu_driver.c
> >> +++ b/src/qemu_driver.c
> >> @@ -1872,10 +1872,12 @@ static int qemudGetNodeInfo(virConnectPtr conn,
> >>  
> >>  static char *qemudGetCapabilities(virConnectPtr conn) {
> >>      struct qemud_driver *driver = conn->privateData;
> >> -    char *xml;
> >> +    char *xml = NULL;
> >>  
> >>      qemuDriverLock(driver);
> >> -    if ((xml = virCapabilitiesFormatXML(driver->caps)) == NULL)
> >> +    virCapabilitiesFree(qemu_driver->caps);
> >> +    if ((qemu_driver->caps = qemudCapsInit()) == NULL ||
> >> +        (xml = virCapabilitiesFormatXML(driver->caps)) == NULL)
> >>          virReportOOMError(conn);
> >>      qemuDriverUnlock(driver);
> > 
> > The thing to be wary of now, is that all use of driver->caps needs
> > to be protected by the driver mutex. Most usages are OK, but I
> > spotted a couple that are not.
> > 
> > Daniel
> 
> Okay, updated patch attached. The only unsafe caps usage I found was in
> qemudNodeGetSecurityModel, not sure if you spotted any others.

  That patch looks fine to me, any reason not to apply it ?

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
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]