xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters
@ 2016-04-06 20:30 Chong Li
  2016-04-06 20:35 ` Andrew Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Li @ 2016-04-06 20:30 UTC (permalink / raw)
  To: xen-devel
  Cc: Chong Li, wei.liu2, george.dunlap, dario.faggioli, ian.jackson,
	mengxu, lichong659, dgolomb

Commit 046c2b503a89d21b41e4d555a9f75d02af00dbc6 introduces a build
failure: in some cases (e.g., num_vcpus <=0),
xc_sched_rtds_vcpu_get/set returns an uninitialized variable.

Fix it.

Signed-off-by: Chong Li <chong.li@wustl.edu>

---
CC: <dario.faggioli@citrix.com>
CC: <george.dunlap@eu.citrix.com>
CC: <dgolomb@seas.upenn.edu>
CC: <mengxu@cis.upenn.edu>
CC: <wei.liu2@citrix.com>
CC: <ian.jackson@eu.citrix.com>
CC: <lichong659@gmail.com>
---
 tools/libxc/xc_rt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_rt.c b/tools/libxc/xc_rt.c
index 221d17f..77aaa36 100644
--- a/tools/libxc/xc_rt.c
+++ b/tools/libxc/xc_rt.c
@@ -68,7 +68,7 @@ int xc_sched_rtds_vcpu_set(xc_interface *xch,
                            struct xen_domctl_schedparam_vcpu *vcpus,
                            uint32_t num_vcpus)
 {
-    int rc;
+    int rc = 0;
     unsigned processed = 0;
     DECLARE_DOMCTL;
     DECLARE_HYPERCALL_BOUNCE(vcpus, sizeof(*vcpus) * num_vcpus,
@@ -102,7 +102,7 @@ int xc_sched_rtds_vcpu_get(xc_interface *xch,
                            struct xen_domctl_schedparam_vcpu *vcpus,
                            uint32_t num_vcpus)
 {
-    int rc;
+    int rc = 0;
     unsigned processed = 0;
     DECLARE_DOMCTL;
     DECLARE_HYPERCALL_BOUNCE(vcpus, sizeof(*vcpus) * num_vcpus,
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters
  2016-04-06 20:30 [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters Chong Li
@ 2016-04-06 20:35 ` Andrew Cooper
  2016-04-06 21:50   ` Dario Faggioli
  2016-04-07 10:36   ` Ian Jackson
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Cooper @ 2016-04-06 20:35 UTC (permalink / raw)
  To: Chong Li, xen-devel
  Cc: Chong Li, wei.liu2, george.dunlap, dario.faggioli, ian.jackson,
	mengxu, dgolomb

On 06/04/16 21:30, Chong Li wrote:
> Commit 046c2b503a89d21b41e4d555a9f75d02af00dbc6 introduces a build
> failure: in some cases (e.g., num_vcpus <=0),
> xc_sched_rtds_vcpu_get/set returns an uninitialized variable.
>
> Fix it.
>
> Signed-off-by: Chong Li <chong.li@wustl.edu>
>
> ---
> CC: <dario.faggioli@citrix.com>
> CC: <george.dunlap@eu.citrix.com>
> CC: <dgolomb@seas.upenn.edu>
> CC: <mengxu@cis.upenn.edu>
> CC: <wei.liu2@citrix.com>
> CC: <ian.jackson@eu.citrix.com>
> CC: <lichong659@gmail.com>

LGTM.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters
  2016-04-06 20:35 ` Andrew Cooper
@ 2016-04-06 21:50   ` Dario Faggioli
  2016-04-07 10:36   ` Ian Jackson
  1 sibling, 0 replies; 4+ messages in thread
From: Dario Faggioli @ 2016-04-06 21:50 UTC (permalink / raw)
  To: Andrew Cooper, Chong Li, xen-devel
  Cc: Chong Li, wei.liu2, george.dunlap, ian.jackson, mengxu, dgolomb


[-- Attachment #1.1: Type: text/plain, Size: 1025 bytes --]

On Wed, 2016-04-06 at 21:35 +0100, Andrew Cooper wrote:
> On 06/04/16 21:30, Chong Li wrote:
> > 
> > Commit 046c2b503a89d21b41e4d555a9f75d02af00dbc6 introduces a build
> > failure: in some cases (e.g., num_vcpus <=0),
> > xc_sched_rtds_vcpu_get/set returns an uninitialized variable.
> > 
> > Fix it.
> > 
> > Signed-off-by: Chong Li <chong.li@wustl.edu>
> > 
> > ---
> > CC: <dario.faggioli@citrix.com>
> > CC: <george.dunlap@eu.citrix.com>
> > CC: <dgolomb@seas.upenn.edu>
> > CC: <mengxu@cis.upenn.edu>
> > CC: <wei.liu2@citrix.com>
> > CC: <ian.jackson@eu.citrix.com>
> > CC: <lichong659@gmail.com>
> LGTM.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>

Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters
  2016-04-06 20:35 ` Andrew Cooper
  2016-04-06 21:50   ` Dario Faggioli
@ 2016-04-07 10:36   ` Ian Jackson
  1 sibling, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2016-04-07 10:36 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Chong Li, wei.liu2, george.dunlap, dario.faggioli, xen-devel,
	mengxu, Chong Li, dgolomb

Andrew Cooper writes ("Re: [Xen-devel] [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters"):
> On 06/04/16 21:30, Chong Li wrote:
> > Commit 046c2b503a89d21b41e4d555a9f75d02af00dbc6 introduces a build
> > failure: in some cases (e.g., num_vcpus <=0),
> > xc_sched_rtds_vcpu_get/set returns an uninitialized variable.
> 
> LGTM.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-07 10:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-06 20:30 [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters Chong Li
2016-04-06 20:35 ` Andrew Cooper
2016-04-06 21:50   ` Dario Faggioli
2016-04-07 10:36   ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).