Re: [PATCH 03/11] Convert Xen domain property driver methods to use virDomainDefPtr

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

 



On Thu, May 09, 2013 at 01:07:59PM -0600, Jim Fehlig wrote:
> Daniel P. Berrange wrote:
> > From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> >
> > Introduce use of a virDomainDefPtr in the domain property
> > APIs to simplify introduction of ACL security checks.
> > The virDomainPtr cannot be safely used, since the app
> > may have supplied mis-matching name/uuid/id fields. eg
> > the name points to domain X, while the uuid points to
> > domain Y. Resolving the virDomainPtr to a virDomainDefPtr
> > ensures a consistent name/uuid/id set.
> >
> > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

> >  xenUnifiedDomainGetOSType(virDomainPtr dom)
> >  {
> >      xenUnifiedPrivatePtr priv = dom->conn->privateData;
> > +    char *ret = NULL;
> > +    virDomainDefPtr def;
> >  
> > -    if (dom->id < 0) {
> > +    if (!(def = xenGetDomainDefForDom(dom)))
> > +        goto cleanup;
> > +
> > +    if (def->id < 0) {
> >          if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) {
> >              virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> >                             _("Unable to query OS type for inactive domain"));
> >              return NULL;
> >          } else {
> > -            return xenDaemonDomainGetOSType(dom);
> > +            ret = xenHypervisorDomainGetOSType(dom->conn, def);
> >   
> 
> Should still call xenDaemonDomainGetOSType here since id < 0 right?
> 
> >          }
> >      } else {
> > -        return xenHypervisorDomainGetOSType(dom);
> > +        ret = xenDaemonDomainGetOSType(dom->conn, def);
> >   
> 
> And call the hypervisor one here when the domain is active.

Yes, dunno how i managed to screw that up :-(


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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