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

Re: [libvirt] [PATCH v3 RESEND 3/4] NUMA: cleanup for numa related codes



On Wed, Mar 20, 2013 at 09:26:36AM +0800, Gao feng wrote:
> 于 2013/03/19/ 17:59, Daniel P. Berrange wrote:
> > On Tue, Mar 19, 2013 at 09:59:37AM +0800, Gao feng wrote:
> >> Intend to reduce the redundant code,use virNumaSetupMemoryPolicy
> >> to replace virLXCControllerSetupNUMAPolicy and
> >> qemuProcessInitNumaMemoryPolicy.
> >>
> >> This patch also moves the numa related codes to the
> >> file virnuma.c and virnuma.h
> >>
> >> Signed-off-by: Gao feng <gaofeng cn fujitsu com>
> >> ---
> >>  src/conf/domain_conf.c   |  17 ++-----
> >>  src/conf/domain_conf.h   |  17 +------
> >>  src/libvirt_private.syms |   5 +-
> >>  src/lxc/lxc_controller.c | 114 +-----------------------------------------
> >>  src/qemu/qemu_cgroup.c   |   4 +-
> >>  src/qemu/qemu_process.c  | 121 +--------------------------------------------
> >>  src/util/virnuma.c       | 126 +++++++++++++++++++++++++++++++++++++++++++++++
> >>  src/util/virnuma.h       |  30 +++++++++++
> >>  8 files changed, 168 insertions(+), 266 deletions(-)
> >>
> > 
> >> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> >> index 96f11ba..98c4745 100644
> >> --- a/src/conf/domain_conf.h
> >> +++ b/src/conf/domain_conf.h
> >> @@ -47,6 +47,7 @@
> >>  # include "device_conf.h"
> >>  # include "virbitmap.h"
> >>  # include "virstoragefile.h"
> >> +# include "virnuma.h"
> >>  
> >>  /* forward declarations of all device types, required by
> >>   * virDomainDeviceDef
> >> @@ -1700,18 +1701,6 @@ virDomainVcpuPinDefPtr virDomainVcpuPinFindByVcpu(virDomainVcpuPinDefPtr *def,
> >>                                                    int nvcpupin,
> >>                                                    int vcpu);
> >>  
> >> -typedef struct _virDomainNumatuneDef virDomainNumatuneDef;
> >> -typedef virDomainNumatuneDef *virDomainNumatuneDefPtr;
> >> -struct _virDomainNumatuneDef {
> >> -    struct {
> >> -        virBitmapPtr nodemask;
> >> -        int mode;
> >> -        int placement_mode; /* enum virDomainNumatuneMemPlacementMode */
> >> -    } memory;
> >> -
> >> -    /* Future NUMA tuning related stuff should go here. */
> >> -};
> >> -
> >>  typedef struct _virBlkioDeviceWeight virBlkioDeviceWeight;
> >>  typedef virBlkioDeviceWeight *virBlkioDeviceWeightPtr;
> >>  struct _virBlkioDeviceWeight {
> >> @@ -1801,7 +1790,7 @@ struct _virDomainDef {
> >>          virDomainVcpuPinDefPtr emulatorpin;
> >>      } cputune;
> >>  
> >> -    virDomainNumatuneDef numatune;
> >> +    virNumatuneDef numatune;
> >>  
> >>      /* These 3 are based on virDomainLifeCycleAction enum flags */
> >>      int onReboot;
> >> @@ -2396,8 +2385,6 @@ VIR_ENUM_DECL(virDomainGraphicsSpicePlaybackCompression)
> >>  VIR_ENUM_DECL(virDomainGraphicsSpiceStreamingMode)
> >>  VIR_ENUM_DECL(virDomainGraphicsSpiceClipboardCopypaste)
> >>  VIR_ENUM_DECL(virDomainGraphicsSpiceMouseMode)
> >> -VIR_ENUM_DECL(virDomainNumatuneMemMode)
> >> -VIR_ENUM_DECL(virDomainNumatuneMemPlacementMode)
> >>  VIR_ENUM_DECL(virDomainHyperv)
> >>  VIR_ENUM_DECL(virDomainRNGModel)
> >>  VIR_ENUM_DECL(virDomainRNGBackend)
> >> diff --git a/src/util/virnuma.h b/src/util/virnuma.h
> >> index d3d7d3e..ef201b9 100644
> >> --- a/src/util/virnuma.h
> >> +++ b/src/util/virnuma.h
> >> @@ -22,7 +22,37 @@
> >>  #ifndef __VIR_NUMA_H__
> >>  # define __VIR_NUMA_H__
> >>  
> >> +# include "internal.h"
> >> +# include "virbitmap.h"
> >> +# include "virutil.h"
> >> +
> >> +enum virNumatuneMemPlacementMode {
> >> +    VIR_NUMATUNE_MEM_PLACEMENT_MODE_DEFAULT = 0,
> >> +    VIR_NUMATUNE_MEM_PLACEMENT_MODE_STATIC,
> >> +    VIR_NUMATUNE_MEM_PLACEMENT_MODE_AUTO,
> >> +
> >> +    VIR_NUMATUNE_MEM_PLACEMENT_MODE_LAST
> >> +};
> > 
> > This enum is previously defined in domain_conf.h, but you've
> > not removed it from there, so now we have 2 enums for the same
> > thing.
> > 
> 
> Oops,I forgot to remove it.
> 
> > Also you've ignore my request to use virNumaTune as the
> > capatilization and VIR_NUMA_TUNE for enums
> > 
> 
> Get it,if I use virNumatune as the capatilization,I need to
> change virnuma.[c|h] to virnumatune.[c|h]?

No, do not rename the file; do not use virNumatune.

The enum values should use VIR_NUMA_TUNE and functions should use
virNumaTune

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