Re: [libvirt] [PATCH] LXC: trivially support flag VIR_DRV_FEATURE_TYPED_PARAM_STRING

2014-06-24 Thread chenhanx...@cn.fujitsu.com


 -Original Message-
 From: Ján Tomko [mailto:jto...@redhat.com]
 Sent: Monday, June 23, 2014 9:08 PM
 To: Chen, Hanxiao/陈 晗霄; libvir-list@redhat.com
 Subject: Re: [libvirt] [PATCH] LXC: trivially support flag
 VIR_DRV_FEATURE_TYPED_PARAM_STRING
 
 On 06/23/2014 09:28 AM, Chen Hanxiao wrote:
  fix:
  virsh -c lxc:/// memtune DOMAIN
  error: Unable to get number of memory parameters
  error: unsupported flags (0x4) in function lxcDomainGetMemoryParameters
 
  Signed-off-by: Chen Hanxiao chenhanx...@cn.fujitsu.com
  ---
   src/lxc/lxc_driver.c | 6 +-
   1 file changed, 5 insertions(+), 1 deletion(-)
 
 
 lxcDomainGetSchedulerParametersFlags will need a similar fix.
 
Yes, it needs a similar fix.

 It seems commit 399394 (released in v1.2.2) introduced this when it marked
 the LXC driver as supporting the option without marking it as supported in
 these APIs.
 
We should updated the comments as 399394 does.

Thanks,
- Chen

 
  diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
  index 06f3e18..6b170fe 100644
  --- a/src/lxc/lxc_driver.c
  +++ b/src/lxc/lxc_driver.c
  @@ -895,7 +895,11 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
   size_t i;
 
   virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
  -  VIR_DOMAIN_AFFECT_CONFIG, -1);
  +  VIR_DOMAIN_AFFECT_CONFIG,
  +  VIR_TYPED_PARAM_STRING_OKAY, -1);
  +
  +/* We don't return strings, and thus trivially support this flag.  */
  +flags = ~VIR_TYPED_PARAM_STRING_OKAY;
 
   if (!(vm = lxcDomObjFromDomain(dom)))
   goto cleanup;
 
 


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

[libvirt] [PATCH] LXC: trivially support flag VIR_DRV_FEATURE_TYPED_PARAM_STRING

2014-06-23 Thread Chen Hanxiao
fix:
virsh -c lxc:/// memtune DOMAIN
error: Unable to get number of memory parameters
error: unsupported flags (0x4) in function lxcDomainGetMemoryParameters

Signed-off-by: Chen Hanxiao chenhanx...@cn.fujitsu.com
---
 src/lxc/lxc_driver.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 06f3e18..6b170fe 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -895,7 +895,11 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
 size_t i;
 
 virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
-  VIR_DOMAIN_AFFECT_CONFIG, -1);
+  VIR_DOMAIN_AFFECT_CONFIG,
+  VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+/* We don't return strings, and thus trivially support this flag.  */
+flags = ~VIR_TYPED_PARAM_STRING_OKAY;
 
 if (!(vm = lxcDomObjFromDomain(dom)))
 goto cleanup;
-- 
1.9.0

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


Re: [libvirt] [PATCH] LXC: trivially support flag VIR_DRV_FEATURE_TYPED_PARAM_STRING

2014-06-23 Thread Ján Tomko
On 06/23/2014 09:28 AM, Chen Hanxiao wrote:
 fix:
 virsh -c lxc:/// memtune DOMAIN
 error: Unable to get number of memory parameters
 error: unsupported flags (0x4) in function lxcDomainGetMemoryParameters
 
 Signed-off-by: Chen Hanxiao chenhanx...@cn.fujitsu.com
 ---
  src/lxc/lxc_driver.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)


lxcDomainGetSchedulerParametersFlags will need a similar fix.

It seems commit 399394 (released in v1.2.2) introduced this when it marked
the LXC driver as supporting the option without marking it as supported in
these APIs.

 
 diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
 index 06f3e18..6b170fe 100644
 --- a/src/lxc/lxc_driver.c
 +++ b/src/lxc/lxc_driver.c
 @@ -895,7 +895,11 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
  size_t i;
  
  virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
 -  VIR_DOMAIN_AFFECT_CONFIG, -1);
 +  VIR_DOMAIN_AFFECT_CONFIG,
 +  VIR_TYPED_PARAM_STRING_OKAY, -1);
 +
 +/* We don't return strings, and thus trivially support this flag.  */
 +flags = ~VIR_TYPED_PARAM_STRING_OKAY;
  
  if (!(vm = lxcDomObjFromDomain(dom)))
  goto cleanup;
 




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