[PATCH] domain_conf: Replace the name string with 'vcpu' if it is 'vcpus'

Yi Wang posted 1 patch 3 years, 9 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1593646780-8655-1-git-send-email-wang.yi59@zte.com.cn
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] domain_conf: Replace the name string with 'vcpu' if it is 'vcpus'
Posted by Yi Wang 3 years, 9 months ago
From: Liao Pingfang <liao.pingfang@zte.com.cn>

If the name is 'vcpus', we will get 'vcpussched' instead of 'vcpusched'
in the error message as following:

	... 19155 : vcpussched attributes 'vcpus' must not overlap

So we use 'vcpu' to replace 'vcpus'.

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
---
 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 0c883cd..5dcc836 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -20050,7 +20050,7 @@ virDomainThreadSchedParseHelper(xmlNodePtr node,
         if (sched->policy != VIR_PROC_POLICY_NONE) {
             virReportError(VIR_ERR_XML_DETAIL,
                            _("%ssched attributes 'vcpus' must not overlap"),
-                           name);
+                           STREQ(name, "vcpus") ? "vcpu" : name);
             return -1;
         }
 
-- 
2.9.5

Re: [PATCH] domain_conf: Replace the name string with 'vcpu' if it is 'vcpus'
Posted by Daniel Henrique Barboza 3 years, 9 months ago

On 7/1/20 8:39 PM, Yi Wang wrote:
> From: Liao Pingfang <liao.pingfang@zte.com.cn>
> 
> If the name is 'vcpus', we will get 'vcpussched' instead of 'vcpusched'
> in the error message as following:
> 
> 	... 19155 : vcpussched attributes 'vcpus' must not overlap
> 
> So we use 'vcpu' to replace 'vcpus'.
> 
> Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
> ---

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

Re: [PATCH] domain_conf: Replace the name string with 'vcpu' if it is 'vcpus'
Posted by Michal Privoznik 3 years, 9 months ago
On 7/2/20 1:37 PM, Daniel Henrique Barboza wrote:
> 
> 
> On 7/1/20 8:39 PM, Yi Wang wrote:
>> From: Liao Pingfang <liao.pingfang@zte.com.cn>
>>
>> If the name is 'vcpus', we will get 'vcpussched' instead of 'vcpusched'
>> in the error message as following:
>>
>>     ... 19155 : vcpussched attributes 'vcpus' must not overlap
>>
>> So we use 'vcpu' to replace 'vcpus'.
>>
>> Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
>> ---
> 
> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> 

Pushed now.

Michal