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

Re: [libvirt] [PATCH 29/40] Simplify the Xen domain stats/peek / node memory driver methods



On Wed, May 08, 2013 at 05:33:13PM -0600, Jim Fehlig wrote:
> Daniel P. Berrange wrote:
> > From: "Daniel P. Berrange" <berrange redhat com>
> >
> > Make the Xen domain stats / peek and node memory driver
> > methods unconditionally call the sub-drivers which are
> > guaranteed to be open.
> >
> > Signed-off-by: Daniel P. Berrange <berrange redhat com>
> > ---
> >  src/xen/xen_driver.c    | 59 +++++++++----------------------------------------
> >  src/xen/xend_internal.c |  3 ---
> >  2 files changed, 11 insertions(+), 51 deletions(-)
> >
> > diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
> > index 1941dbe..d6817eb 100644
> > --- a/src/xen/xen_driver.c
> > +++ b/src/xen/xen_driver.c
> > @@ -1566,26 +1566,14 @@ static int
> >  xenUnifiedDomainBlockStats(virDomainPtr dom, const char *path,
> >                             struct _virDomainBlockStats *stats)
> >  {
> > -    xenUnifiedPrivatePtr priv = dom->conn->privateData;
> > -
> > -    if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET])
> > -        return xenHypervisorDomainBlockStats(dom, path, stats);
> > -
> > -    virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
> > -    return -1;
> > +    return xenHypervisorDomainBlockStats(dom, path, stats);
> >  }
> >  
> >  static int
> >  xenUnifiedDomainInterfaceStats(virDomainPtr dom, const char *path,
> >                                 struct _virDomainInterfaceStats *stats)
> >  {
> > -    xenUnifiedPrivatePtr priv = dom->conn->privateData;
> > -
> > -    if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET])
> > -        return xenHypervisorDomainInterfaceStats(dom, path, stats);
> > -
> > -    virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
> > -    return -1;
> > +    return xenHypervisorDomainInterfaceStats(dom, path, stats);
> >  }
> >  
> >  static int
> > @@ -1593,57 +1581,32 @@ xenUnifiedDomainBlockPeek(virDomainPtr dom, const char *path,
> >                            unsigned long long offset, size_t size,
> >                            void *buffer, unsigned int flags)
> >  {
> > -    int r;
> >      xenUnifiedPrivatePtr priv = dom->conn->privateData;
> >  
> >      virCheckFlags(0, -1);
> >  
> > -    if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) {
> > -        r = xenDaemonDomainBlockPeek(dom, path, offset, size, buffer);
> > -        if (r != -2) return r;
> > -        /* r == -2 means declined, so fall through to XM driver ... */
> > -    }
> >   
> 
> Heh, hack to make the unified driver keep trying. We won't miss this
> code. BTW, it would be good to remove the "-2 if declined" comment in
> the function description. I didn't look for these now outdated comments
> in your previous patches where similar changes were made.

Yep, there were a couple more comments to be removed in the
domain vcpu patch, which I've now modified.

Thanks for all the reviews so far ! I'm going to push the first 29
patches now. I've tested basic operations and things seem to be
working sanely to me.

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


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