From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4alP-0006Er-93 for qemu-devel@nongnu.org; Wed, 21 Apr 2010 10:18:51 -0400 Received: from [140.186.70.92] (port=36171 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4alN-0006DZ-QM for qemu-devel@nongnu.org; Wed, 21 Apr 2010 10:18:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4alL-0004di-Rq for qemu-devel@nongnu.org; Wed, 21 Apr 2010 10:18:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43189) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4alL-0004dW-KF for qemu-devel@nongnu.org; Wed, 21 Apr 2010 10:18:47 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3LEIkpH029854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 21 Apr 2010 10:18:46 -0400 Message-ID: <4BCF092A.2080005@redhat.com> Date: Wed, 21 Apr 2010 16:18:18 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1271797792-24571-1-git-send-email-lcapitulino@redhat.com> <1271797792-24571-19-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1271797792-24571-19-git-send-email-lcapitulino@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 18/22] savevm: Convert do_delvm() to QObject, QError List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: quintela@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com Am 20.04.2010 23:09, schrieb Luiz Capitulino: > Signed-off-by: Luiz Capitulino > --- > qemu-monitor.hx | 3 ++- > savevm.c | 14 ++++++++++---- > sysemu.h | 2 +- > 3 files changed, 13 insertions(+), 6 deletions(-) > > diff --git a/qemu-monitor.hx b/qemu-monitor.hx > index 5ea5748..71cb1a2 100644 > --- a/qemu-monitor.hx > +++ b/qemu-monitor.hx > @@ -274,7 +274,8 @@ ETEXI > .args_type = "name:s", > .params = "tag|id", > .help = "delete a VM snapshot from its tag or id", > - .mhandler.cmd = do_delvm, > + .user_print = monitor_user_noop, > + .mhandler.cmd_new = do_delvm, > }, > > STEXI > diff --git a/savevm.c b/savevm.c > index 643273e..031eeff 100644 > --- a/savevm.c > +++ b/savevm.c > @@ -1815,24 +1815,30 @@ int load_vmstate(const char *name) > return 0; > } > > -void do_delvm(Monitor *mon, const QDict *qdict) > +int do_delvm(Monitor *mon, const QDict *qdict, QObject **ret_data) > { > + int ret; > DriveInfo *dinfo; > BlockDriverState *bs, *bs1; > const char *name = qdict_get_str(qdict, "name"); > > bs = get_bs_snapshots(); > if (!bs) { > - monitor_printf(mon, "No block device supports snapshots\n"); > - return; > + qerror_report(QERR_SNAPSHOT_NO_DEVICE); > + return -1; > } > > + ret = -1; > + > QTAILQ_FOREACH(dinfo, &drives, next) { > bs1 = dinfo->bdrv; > if (bdrv_has_snapshot(bs1)) { > - delete_snapshot(bs1, name); > + /* FIXME: will report multiple failures in QMP */ > + ret = delete_snapshot(bs1, name); > } > } > + > + return (ret < 0 ? -1 : 0); Doesn't this return success when the first drive fails and the second one succeeds? Kevin