Re: [libvirt] [PATCH v3 1/4] rename qemuGetNumadAdvice to virNumaGetAutoPlacementAdvice

2013-03-19 Thread Gao feng
于 2013/03/20 05:56, Eric Blake wrote:
> On 03/18/2013 03:04 AM, Gao feng wrote:
>> qemuGetNumadAdvice will be used by LXC driver,rename
> 
> space after comma
> 
>> it to virNumaGetAutoPlacementAdvice and move it to virnuma.c
>>
>> Signed-off-by: Gao feng 
>> ---
>>  po/POTFILES.in   |  1 +
>>  src/Makefile.am  |  1 +
>>  src/libvirt_private.syms |  3 +++
>>  src/qemu/qemu_process.c  | 34 +++
>>  src/util/virnuma.c   | 61 
>> 
>>  src/util/virnuma.h   | 28 ++
>>  6 files changed, 97 insertions(+), 31 deletions(-)
>>  create mode 100644 src/util/virnuma.c
>>  create mode 100644 src/util/virnuma.h
> 
> Wow, I've never seen 'git am' get so confused:
> 
> ...
> A qemu/qemu_process.c
> Falling back to patching base and 3-way merge...
> CONFLICT (rename/add): Rename Makefile.am->src/Makefile.am in rename
> qemuGetNumadAdvice to virNumaGetAutoPlacementAdvice. src/Makefile.am
> added in HEAD
> Adding as src/Makefile.am~HEAD instead
> Auto-merging src/qemu/qemu_process.c
> Auto-merging src/libvirt_private.syms
> Auto-merging src/Makefile.am
> CONFLICT (content): Merge conflict in src/Makefile.am
> ...
> 
> Thankfully, I was able to straighten it out, and have pushed this patch.
> 

Thanks for your work, I will rebase the other three patches and resend them.

Thanks!

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

Re: [libvirt] [PATCH v3 1/4] rename qemuGetNumadAdvice to virNumaGetAutoPlacementAdvice

2013-03-19 Thread Eric Blake
On 03/18/2013 03:04 AM, Gao feng wrote:
> qemuGetNumadAdvice will be used by LXC driver,rename

space after comma

> it to virNumaGetAutoPlacementAdvice and move it to virnuma.c
> 
> Signed-off-by: Gao feng 
> ---
>  po/POTFILES.in   |  1 +
>  src/Makefile.am  |  1 +
>  src/libvirt_private.syms |  3 +++
>  src/qemu/qemu_process.c  | 34 +++
>  src/util/virnuma.c   | 61 
> 
>  src/util/virnuma.h   | 28 ++
>  6 files changed, 97 insertions(+), 31 deletions(-)
>  create mode 100644 src/util/virnuma.c
>  create mode 100644 src/util/virnuma.h

Wow, I've never seen 'git am' get so confused:

...
A   qemu/qemu_process.c
Falling back to patching base and 3-way merge...
CONFLICT (rename/add): Rename Makefile.am->src/Makefile.am in rename
qemuGetNumadAdvice to virNumaGetAutoPlacementAdvice. src/Makefile.am
added in HEAD
Adding as src/Makefile.am~HEAD instead
Auto-merging src/qemu/qemu_process.c
Auto-merging src/libvirt_private.syms
Auto-merging src/Makefile.am
CONFLICT (content): Merge conflict in src/Makefile.am
...

Thankfully, I was able to straighten it out, and have pushed this patch.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v3 1/4] rename qemuGetNumadAdvice to virNumaGetAutoPlacementAdvice

2013-03-18 Thread Daniel P. Berrange
On Mon, Mar 18, 2013 at 05:04:01PM +0800, Gao feng wrote:
> qemuGetNumadAdvice will be used by LXC driver,rename
> it to virNumaGetAutoPlacementAdvice and move it to virnuma.c
> 
> Signed-off-by: Gao feng 
> ---
>  po/POTFILES.in   |  1 +
>  src/Makefile.am  |  1 +
>  src/libvirt_private.syms |  3 +++
>  src/qemu/qemu_process.c  | 34 +++
>  src/util/virnuma.c   | 61 
> 
>  src/util/virnuma.h   | 28 ++
>  6 files changed, 97 insertions(+), 31 deletions(-)
>  create mode 100644 src/util/virnuma.c
>  create mode 100644 src/util/virnuma.h

ACK


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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH v3 1/4] rename qemuGetNumadAdvice to virNumaGetAutoPlacementAdvice

2013-03-18 Thread Osier Yang

On 2013年03月18日 17:04, Gao feng wrote:

qemuGetNumadAdvice will be used by LXC driver,rename
it to virNumaGetAutoPlacementAdvice and move it to virnuma.c

Signed-off-by: Gao feng
---
  po/POTFILES.in   |  1 +
  src/Makefile.am  |  1 +
  src/libvirt_private.syms |  3 +++
  src/qemu/qemu_process.c  | 34 +++
  src/util/virnuma.c   | 61 
  src/util/virnuma.h   | 28 ++
  6 files changed, 97 insertions(+), 31 deletions(-)
  create mode 100644 src/util/virnuma.c
  create mode 100644 src/util/virnuma.h

diff --git PATCH v3po/POTFILES.in b/po/POTFILES.in
index 5b5c3c2..771e83f 100644
--- PATCH v3po/POTFILES.in  
+++ b/po/POTFILES.in
@@ -165,6 +165,7 @@ src/util/virnetdevtap.c
  src/util/virnetdevvportprofile.c
  src/util/virnetlink.c
  src/util/virnodesuspend.c
+src/util/virnuma.c
  src/util/virobject.c
  src/util/virpci.c
  src/util/virpidfile.c
diff --git PATCH v3src/Makefile.am b/src/Makefile.am
index 8b591d2..2db03cb 100644
--- PATCH v3src/Makefile.am 
+++ b/src/Makefile.am
@@ -103,6 +103,7 @@ UTIL_SOURCES =  
\
util/virnetdevvportprofile.h util/virnetdevvportprofile.c \
util/virnetlink.c util/virnetlink.h \
util/virnodesuspend.c util/virnodesuspend.h \
+   util/virnuma.c util/virnuma.h   \
util/virobject.c util/virobject.h   \
util/virpci.c util/virpci.h \
util/virpidfile.c util/virpidfile.h \
diff --git PATCH v3src/libvirt_private.syms b/src/libvirt_private.syms
index 5cad990..1374470 100644
--- PATCH v3src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1545,6 +1545,9 @@ nodeSuspendForDuration;
  virNodeSuspendGetTargetMask;


+# util/virnuma.h
+virNumaGetAutoPlacementAdvice;
+
  # util/virobject.h
  virClassForObject;
  virClassForObjectLockable;
diff --git PATCH v3src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1941d4e..96ba70a 100644
--- PATCH v3src/qemu/qemu_process.c 
+++ b/src/qemu/qemu_process.c
@@ -70,6 +70,7 @@
  #include "virnetdevtap.h"
  #include "virbitmap.h"
  #include "viratomic.h"
+#include "virnuma.h"

  #define VIR_FROM_THIS VIR_FROM_QEMU

@@ -1903,36 +1904,6 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
  }
  #endif

-#if HAVE_NUMAD
-static char *
-qemuGetNumadAdvice(virDomainDefPtr def)
-{
-virCommandPtr cmd = NULL;
-char *output = NULL;
-
-cmd = virCommandNewArgList(NUMAD, "-w", NULL);
-virCommandAddArgFormat(cmd, "%d:%llu", def->vcpus,
-   VIR_DIV_UP(def->mem.cur_balloon, 1024));
-
-virCommandSetOutputBuffer(cmd,&output);
-
-if (virCommandRun(cmd, NULL)<  0)
-virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-   _("Failed to query numad for the "
- "advisory nodeset"));
-
-virCommandFree(cmd);
-return output;
-}
-#else
-static char *
-qemuGetNumadAdvice(virDomainDefPtr def ATTRIBUTE_UNUSED)
-{
-virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-   _("numad is not available on this host"));
-return NULL;
-}
-#endif

  /* Helper to prepare cpumap for affinity setting, convert
   * NUMA nodeset into cpuset if @nodemask is not NULL, otherwise
@@ -3637,7 +3608,8 @@ int qemuProcessStart(virConnectPtr conn,
   VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) ||
  (vm->def->numatune.memory.placement_mode ==
   VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)) {
-nodeset = qemuGetNumadAdvice(vm->def);
+nodeset = virNumaGetAutoPlacementAdvice(vm->def->vcpus,
+vm->def->mem.cur_balloon);
  if (!nodeset)
  goto cleanup;

diff --git PATCH v3src/util/virnuma.c b/src/util/virnuma.c
new file mode 100644
index 000..f6a6eb2
--- /dev/null
+++ b/src/util/virnuma.c
@@ -0,0 +1,61 @@
+/*
+ * virnuma.c: helper APIs for managing numa
+ *
+ * Copyright (C) 2011-2013 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ *.
+ *
+ */
+
+#include
+
+#include "virnuma.h"
+#include "vircommand.h"
+#include "virerror.h"
+
+#define VIR_FROM_THIS VIR_FROM_NONE
+
+#if HAVE_NUMAD
+char *
+