Received: from eggs.gnu.org ([2001:4830:134:3::10]:39132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB4gU-0003km-7h for qemu-devel@nongnu.org; Mon, 21 Dec 2015 12:55:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aB4gR-0003Qs-1R for qemu-devel@nongnu.org; Mon, 21 Dec 2015 12:55:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB4gQ-0003QV-Sd for qemu-devel@nongnu.org; Mon, 21 Dec 2015 12:55:42 -0500 Date: Mon, 21 Dec 2015 23:25:35 +0530 (IST) From: P J P In-Reply-To: <1450710967-24399-1-git-send-email-qhjin_dev@163.com> Message-ID: References: <1450710967-24399-1-git-send-email-qhjin_dev@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH] 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: qemu-devel@nongnu.org, Markus Armbruster +-- On Mon, 21 Dec 2015, Qinghua Jin wrote --+ | -void qmp_system_powerdown(Error **erp) | +void qmp_system_powerdown(Error **errp) | { | + if (!runstate_is_running()) { | + error_setg(errp, "Can't powerdown the Virtual Machine when it isn't running"); | + return; | + } | qemu_system_powerdown_request(); | } - Maybe direct call to 'if (!runstate_check(RUN_STATE_RUNNING))' is better? runstate_is_running too invokes the same. Not sure why are there two functions 'runstate_is_running' & 'runstate_check'. - Can't -> Can not - "...the Virtual Machine.." -> "...virtual machine.." (not capitalised) - "...when it isn't.." -> "as it is not..." - OR maybe just say -> "Virtual machine is not running" -- Prasad J Pandit / Red Hat Product Security Team 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F