Re: [libvirt] [PATCH v2 2/3] lxc controller: add check for numatune

2014-10-29 Thread Martin Kletzander

On Tue, Oct 28, 2014 at 04:22:22PM +0800, Chen Fan wrote:

Signed-off-by: Chen Fan chen.fan.f...@cn.fujitsu.com
---
src/lxc/lxc_controller.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 1861dd6..1ee89ab 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -689,7 +689,8 @@ static int 
virLXCControllerSetupResourceLimits(virLXCControllerPtr ctrl)
int ret = -1;

if (virLXCControllerGetNumadAdvice(ctrl, nodemask)  0 ||
-virNumaSetupMemoryPolicy(ctrl-def-numatune, nodemask)  0)
+(virNumaNodesetIsAvailable (ctrl-def-numatune) 
+ virNumaSetupMemoryPolicy(ctrl-def-numatune, nodemask)  0))
goto cleanup;



This would mean it will succeed if the numa node is not available on
the host.  Don't you want to error out?  By the way, it would make
sense to make the check in virNumaSetupMemoryPolicy() itself.

Martin


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

Re: [libvirt] [PATCH v2 2/3] lxc controller: add check for numatune

2014-10-29 Thread Chen, Fan
On Wed, 2014-10-29 at 08:00 +0100, Martin Kletzander wrote: 
 On Tue, Oct 28, 2014 at 04:22:22PM +0800, Chen Fan wrote:
 Signed-off-by: Chen Fan chen.fan.f...@cn.fujitsu.com
 ---
  src/lxc/lxc_controller.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
 index 1861dd6..1ee89ab 100644
 --- a/src/lxc/lxc_controller.c
 +++ b/src/lxc/lxc_controller.c
 @@ -689,7 +689,8 @@ static int 
 virLXCControllerSetupResourceLimits(virLXCControllerPtr ctrl)
  int ret = -1;
 
  if (virLXCControllerGetNumadAdvice(ctrl, nodemask)  0 ||
 -virNumaSetupMemoryPolicy(ctrl-def-numatune, nodemask)  0)
 +(virNumaNodesetIsAvailable (ctrl-def-numatune) 
 + virNumaSetupMemoryPolicy(ctrl-def-numatune, nodemask)  0))
  goto cleanup;
 
 
 This would mean it will succeed if the numa node is not available on
 the host.  Don't you want to error out?  By the way, it would make
 sense to make the check in virNumaSetupMemoryPolicy() itself.

Oh, you are right. As for output because virNumaNodesetIsAvailable is
self error output. so I think it not necessary.

I think the check
!virNumaNodesetIsAvailable (ctrl-def-numatune) ||
  virNumaSetupMemoryPolicy(ctrl-def-numatune, nodemask)  0
would be OK.

Thanks,
Chen

 
 Martin


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


[libvirt] [PATCH v2 2/3] lxc controller: add check for numatune

2014-10-28 Thread Chen Fan
Signed-off-by: Chen Fan chen.fan.f...@cn.fujitsu.com
---
 src/lxc/lxc_controller.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 1861dd6..1ee89ab 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -689,7 +689,8 @@ static int 
virLXCControllerSetupResourceLimits(virLXCControllerPtr ctrl)
 int ret = -1;
 
 if (virLXCControllerGetNumadAdvice(ctrl, nodemask)  0 ||
-virNumaSetupMemoryPolicy(ctrl-def-numatune, nodemask)  0)
+(virNumaNodesetIsAvailable (ctrl-def-numatune) 
+ virNumaSetupMemoryPolicy(ctrl-def-numatune, nodemask)  0))
 goto cleanup;
 
 if (virLXCControllerSetupCpuAffinity(ctrl)  0)
-- 
1.9.3

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