[libvirt] [PATCH] virsh: add error return value

* tools/virsh.c (cmdSnapshotList): Avoiding to continue to execute subsequent codes, the programming should return false when meeting a error. For details, please see the following link: RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=807545 Signed-off-by: Alex Jia <ajia@redhat.com> --- tools/virsh.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 5009b6b..7e74744 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -16374,6 +16374,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd) if (from) { vshError(ctl, "%s", _("--roots and --from are mutually exclusive")); + return false; } flags |= VIR_DOMAIN_SNAPSHOT_LIST_ROOTS; } -- 1.7.1

On 03/28/2012 02:24 PM, Alex Jia wrote:
* tools/virsh.c (cmdSnapshotList): Avoiding to continue to execute subsequent codes, the programming should return false when meeting a error.
For details, please see the following link: RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=807545
Signed-off-by: Alex Jia<ajia@redhat.com> --- tools/virsh.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index 5009b6b..7e74744 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -16374,6 +16374,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd) if (from) { vshError(ctl, "%s", _("--roots and --from are mutually exclusive")); + return false;
Oh, you did post the patch for it. But the follow up patch for the leaks should be buit on top of this then, it depends on this patch.
} flags |= VIR_DOMAIN_SNAPSHOT_LIST_ROOTS; }
But the fix is right, ACK

On 03/28/2012 04:15 PM, Osier Yang wrote:
On 03/28/2012 02:24 PM, Alex Jia wrote:
* tools/virsh.c (cmdSnapshotList): Avoiding to continue to execute subsequent codes, the programming should return false when meeting a error.
For details, please see the following link: RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=807545
Signed-off-by: Alex Jia<ajia@redhat.com> --- tools/virsh.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index 5009b6b..7e74744 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -16374,6 +16374,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd) if (from) { vshError(ctl, "%s", _("--roots and --from are mutually exclusive")); + return false;
Oh, you did post the patch for it. But the follow up patch for the leaks should be buit on top of this then, it depends on this patch. Yeah, however, at that time, I only find return value issue, but as you said, my second patch should include this change. thanks.
} flags |= VIR_DOMAIN_SNAPSHOT_LIST_ROOTS; }
But the fix is right, ACK
participants (2)
-
Alex Jia
-
Osier Yang