All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Qinghua Jin <qhjin_dev@163.com>
Cc: P J P <ppandit@redhat.com>,
	qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] qmp: return err msg when powerdown a vm when it isn't in running state
Date: Tue, 22 Dec 2015 10:06:17 +0800	[thread overview]
Message-ID: <20151222020617.GC9331@ad.usersys.redhat.com> (raw)
In-Reply-To: <1450748534-5145-1-git-send-email-qhjin_dev@163.com>

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 <qhjin_dev@163.com>
    ---

    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 <qhjin_dev@163.com>
> ---
>  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
> 
> 
> 

  reply	other threads:[~2015-12-22  2:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22  1:42 [Qemu-devel] [PATCH v2] qmp: return err msg when powerdown a vm when it isn't in running state Qinghua Jin
2015-12-22  2:06 ` Fam Zheng [this message]
2015-12-22  2:40   ` Qinghua Jin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151222020617.GC9331@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qhjin_dev@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.