[libvirt] [PATCH] Fix a string format bug in qemu_cgroup.c

Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> --- src/qemu/qemu_cgroup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index f8f375f..662d41d 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -473,8 +473,8 @@ cleanup: rc = virCgroupSetCpuCfsPeriod(cgroup, old_period); if (rc < 0) virReportSystemError(-rc, - _("%s"), - "Unable to rollback cpu bandwidth period"); + "%s", + _("Unable to rollback cpu bandwidth period")); } return -1; -- 1.7.3.1 -- Best Regards, Tang chen

At 07/06/2012 09:53 AM, tangchen Wrote:
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> --- src/qemu/qemu_cgroup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index f8f375f..662d41d 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -473,8 +473,8 @@ cleanup: rc = virCgroupSetCpuCfsPeriod(cgroup, old_period); if (rc < 0) virReportSystemError(-rc, - _("%s"), - "Unable to rollback cpu bandwidth period"); + "%s", + _("Unable to rollback cpu bandwidth period")); }
return -1;
ACK I use make syntax-check , and do not find this bug... Thanks Wen Congyang

On 2012年07月06日 11:08, Wen Congyang wrote:
At 07/06/2012 09:53 AM, tangchen Wrote:
Signed-off-by: Tang Chen<tangchen@cn.fujitsu.com> --- src/qemu/qemu_cgroup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index f8f375f..662d41d 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -473,8 +473,8 @@ cleanup: rc = virCgroupSetCpuCfsPeriod(cgroup, old_period); if (rc< 0) virReportSystemError(-rc, - _("%s"), - "Unable to rollback cpu bandwidth period"); + "%s", + _("Unable to rollback cpu bandwidth period")); }
return -1;
ACK
I use make syntax-check , and do not find this bug...
Pushed. Osier

On 07/05/2012 09:08 PM, Wen Congyang wrote:
At 07/06/2012 09:53 AM, tangchen Wrote:
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> --- src/qemu/qemu_cgroup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index f8f375f..662d41d 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -473,8 +473,8 @@ cleanup: rc = virCgroupSetCpuCfsPeriod(cgroup, old_period); if (rc < 0) virReportSystemError(-rc, - _("%s"), - "Unable to rollback cpu bandwidth period"); + "%s", + _("Unable to rollback cpu bandwidth period")); }
return -1;
ACK
I use make syntax-check , and do not find this bug...
That says our syntax-check rule is not strong enough. I'll work on a patch for that, as there are other violations of this bug. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

于 2012年07月10日 23:24, Eric Blake 写道:
On 07/05/2012 09:08 PM, Wen Congyang wrote:
At 07/06/2012 09:53 AM, tangchen Wrote:
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> --- src/qemu/qemu_cgroup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index f8f375f..662d41d 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -473,8 +473,8 @@ cleanup: rc = virCgroupSetCpuCfsPeriod(cgroup, old_period); if (rc < 0) virReportSystemError(-rc, - _("%s"), - "Unable to rollback cpu bandwidth period"); + "%s", + _("Unable to rollback cpu bandwidth period")); }
return -1;
ACK
I use make syntax-check , and do not find this bug...
That says our syntax-check rule is not strong enough. I'll work on a patch for that, as there are other violations of this bug.
We have the same problem in lxcSetVcpuBWLive. cleanup: if (period) { rc = virCgroupSetCpuCfsPeriod(cgroup, old_period); if (rc < 0) virReportSystemError(-rc, _("%s"), "Unable to rollback cpu bandwidth period"); } it seems copied from qemuSetupCgroupVcpuBW.

At 07/11/2012 09:59 AM, Gao feng Wrote:
于 2012年07月10日 23:24, Eric Blake 写道:
On 07/05/2012 09:08 PM, Wen Congyang wrote:
At 07/06/2012 09:53 AM, tangchen Wrote:
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> --- src/qemu/qemu_cgroup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index f8f375f..662d41d 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -473,8 +473,8 @@ cleanup: rc = virCgroupSetCpuCfsPeriod(cgroup, old_period); if (rc < 0) virReportSystemError(-rc, - _("%s"), - "Unable to rollback cpu bandwidth period"); + "%s", + _("Unable to rollback cpu bandwidth period")); }
return -1;
ACK
I use make syntax-check , and do not find this bug...
That says our syntax-check rule is not strong enough. I'll work on a patch for that, as there are other violations of this bug.
It seems that this rule does not work for multiple lines...
We have the same problem in lxcSetVcpuBWLive. cleanup: if (period) { rc = virCgroupSetCpuCfsPeriod(cgroup, old_period); if (rc < 0) virReportSystemError(-rc, _("%s"), "Unable to rollback cpu bandwidth period"); }
it seems copied from qemuSetupCgroupVcpuBW.
I think so. This bug is first introduced by me. :( Thanks Wen Congyang
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (5)
-
Eric Blake
-
Gao feng
-
Osier Yang
-
tangchen
-
Wen Congyang