
On 01/31/13 07:50, Osier Yang wrote:
On 2013年01月22日 02:07, Peter Krempa wrote:
--- tools/virsh-domain-monitor.c | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-)
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 1e8b8cf..7e105fd 100644
[...]
@@ -891,7 +886,7 @@ cmdDomblkstat(vshControl *ctl, const vshCmd *cmd) if (!(dom = vshCommandOptDomain(ctl, cmd,&name))) return false;
- if (vshCommandOptString(cmd, "device",&device)<= 0) + if (vshCommandOptStringReq(ctl, cmd, "device",&device)<= 0)
I think you mean < 0 here.
right ....
goto cleanup;
rc = virDomainBlockStatsFlags(dom, device, NULL,&nparams, 0);
[...]
@@ -1055,8 +1048,9 @@ cmdDomIfstat(vshControl *ctl, const vshCmd *cmd) if (stats.tx_drop>= 0) vshPrint(ctl, "%s tx_drop %lld\n", device, stats.tx_drop);
+cleanup: virDomainFree(dom); - return true; + return ret;
Is "ret" set to true yet if success?
I forgot to put "ret = true;" before the cleanup label.
Thanks. Peter