From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBCLI-0002g8-9I for qemu-devel@nongnu.org; Mon, 21 Dec 2015 21:06:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBCLF-0005Zz-3u for qemu-devel@nongnu.org; Mon, 21 Dec 2015 21:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBCLE-0005ZU-Ua for qemu-devel@nongnu.org; Mon, 21 Dec 2015 21:06:21 -0500 Date: Tue, 22 Dec 2015 10:06:17 +0800 From: Fam Zheng Message-ID: <20151222020617.GC9331@ad.usersys.redhat.com> References: <1450748534-5145-1-git-send-email-qhjin_dev@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450748534-5145-1-git-send-email-qhjin_dev@163.com> Subject: Re: [Qemu-devel] [PATCH v2] qmp: return err msg when powerdown a vm when it isn't in running state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qinghua Jin Cc: P J P , qemu-devel@nongnu.org, Markus Armbruster On Tue, 12/22 09:42, Qinghua Jin wrote: > This is an update of patch previously show in msg: > > http://lists.gnu.org/archive/html/qemu-devel/2015-12/msg03817.html The patch looks good to me, thanks for submitting the patch! There is only one minor comment: Patch revision note should go after the --- line (or the cover letter if you have one) so that it won't be commited into the git log (because it wouldn't be informative): When send system_powerdown to QMP when the vm isn't in RUN_STATE_RUNNING, it will be ignored by system. So reply a err msg with the situation. Signed-off-by: Qinghua Jin --- This is an update of patch previously show in msg: http://lists.gnu.org/archive/html/qemu-devel/2015-12/msg03817.html qmp.c | 7 ++++++- > > When send system_powerdown to QMP when the vm isn't in RUN_STATE_RUNNING, > it will be ignored by system. So reply a err msg with the situation. > > Signed-off-by: Qinghua Jin > --- > qmp.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/qmp.c b/qmp.c > index 0a1fa19..384df56 100644 > --- a/qmp.c > +++ b/qmp.c > @@ -114,8 +114,13 @@ void qmp_system_reset(Error **errp) > qemu_system_reset_request(); > } > > -void qmp_system_powerdown(Error **erp) > +void qmp_system_powerdown(Error **errp) > { > + if (!runstate_check(RUN_STATE_RUNNING)) { > + error_setg(errp, > + "Can not powerdown virtual machine as it is not running"); > + return; > + } > qemu_system_powerdown_request(); > } > > -- > 2.5.0 > > >