qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Hrdina <phrdina@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 07/12] qapi: Convert savevm
Date: Wed, 27 Mar 2013 19:23:54 +0100	[thread overview]
Message-ID: <5153393A.3030207@redhat.com> (raw)
In-Reply-To: <5151FD7F.2060301@redhat.com>

On 26.3.2013 20:56, Eric Blake wrote:
> On 03/22/2013 07:16 AM, Pavel Hrdina wrote:
>> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
>> ---
>>   hmp-commands.hx         |  4 ++--
>>   hmp.c                   |  9 +++++++++
>>   hmp.h                   |  1 +
>>   include/sysemu/sysemu.h |  1 -
>>   qapi-schema.json        | 18 ++++++++++++++++++
>>   qmp-commands.hx         | 29 +++++++++++++++++++++++++++++
>>   savevm.c                | 27 ++++++++++++---------------
>>   7 files changed, 71 insertions(+), 18 deletions(-)
>>
>
>> +++ b/qapi-schema.json
>> @@ -3442,3 +3442,21 @@
>>   # Since: 1.5
>>   ##
>>   { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
>> +
>> +##
>> +# @vm-snapshot-save:
>> +#
>> +# Create a snapshot of the whole virtual machine. If tag is provided as @name,
>> +# it is used as human readable identifier. If there is already a snapshot
>> +# with the same tag or ID, it is replaced.
>
> Any reason we have to fix this up later in the series, instead of
> getting the interface right to begin with (in regards to having an
> optional force argument)?

It was supposed to introduce new feature for both, but I can make it as 
you suggesting.

>
>> +#
>> +# The VM is automatically stopped and resumed and saving a snapshot can take
>> +# a long time.
>
> Transactionally, are we exposing the right building blocks?  While the
> existing HMP command pauses the domain up front, I think the QMP
> interface should be job-oriented.  That is, it should be possible to
> start a long-running job and have QMP return immediately, so that QMP
> remains responsive, and lets us do a live migrate, live bandwidth
> tuning, the ability to gracefully abort, and the ability to pause the
> domain if live migrate isn't converging fast enough.  HMP would then
> preserve its existing interface by calling multiple QMP commands,
> instead of trying to make QMP an exact analogue to the sub-par HMP
> interface.
>
> Libvirt _really_ wants to be able to cancel an in-progress snapshot
> creation action, but can't if all we expose is the same interface as HMP
> has always had.
>

I'm working on live snapshots which will introduce this functionality, 
but I couldn't give you any deadline when I'll have it done. So if you 
(libvirt) really want to have savevm and vm-snapshot-save non-blocking 
before I'll finish live snapshots, then I could rewrite this patch.

I know that current approach isn't good enough because of that blocking 
behavior.

>> +# @name: #optional tag of new snapshot or tag|id of existing snapshot
>> +#
>> +# Returns: Nothing on success
>
> Bad.  If @name is optional, and one is generated on your behalf, then
> you need to return the 'name' that was generated.  Also, even if 'name'
> is provided, knowing which 'id' was allocated is useful, since later
> APIs can operate on 'name' or 'id'.

That's a good point. I'll fix this to return all information about the 
created snapshot.

>
>> +#
>> +# Since: 1.5
>> +##
>> +{ 'command': 'vm-snapshot-save', 'data': {'*name': 'str'} }
>
> In other words, this needs a return value.
>
>
>>           if (!bdrv_can_snapshot(bs)) {
>> -            monitor_printf(mon, "Device '%s' is writable but does not support snapshots.\n",
>> -                               bdrv_get_device_name(bs));
>> +            error_setg(errp, "Device '%s' is writable but does not support "
>> +                       "snapshots.", bdrv_get_device_name(bs));
>>               return;
>>           }
>>       }
>>
>>       bs = bdrv_snapshots();
>>       if (!bs) {
>> -        monitor_printf(mon, "No block device can accept snapshots\n");
>> +        error_setg(errp, "No block device can accept snapshots.");
>
> Odd that we weren't consistent on whether errors ended with '.' when
> using monitor_printf; your patch at least tried to be self-consistent,
> even if opposite the normal usage of error_setg() :)
>

Thanks for review. I've fixed error messages and other issues you 
mentioned in other patches.

Pavel

  reply	other threads:[~2013-03-27 18:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 13:15 [Qemu-devel] [PATCH v2 00/12] convert savevm to use qapi and introduce qmp command Pavel Hrdina
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 01/12] block: add error parameter to bdrv_snapshot_create() and related functions Pavel Hrdina
2013-03-26 14:22   ` Eric Blake
2013-03-26 14:38     ` Pavel Hrdina
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 02/12] block: add error parameter to del_existing_snapshots() Pavel Hrdina
2013-03-26 16:44   ` Eric Blake
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 03/12] savevm: add error parameter to qemu_savevm_state_begin() Pavel Hrdina
2013-03-26 16:49   ` Eric Blake
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 04/12] savevm: add error parameter to qemu_savevm_state_iterate() Pavel Hrdina
2013-03-26 16:55   ` Eric Blake
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 05/12] savevm: add error parameter to qemu_savevm_state_complete() Pavel Hrdina
2013-03-26 19:41   ` Eric Blake
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 06/12] savevm: add error parameter to qemu_savevm_state() Pavel Hrdina
2013-03-26 19:41   ` Eric Blake
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 07/12] qapi: Convert savevm Pavel Hrdina
2013-03-26 19:56   ` Eric Blake
2013-03-27 18:23     ` Pavel Hrdina [this message]
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 08/12] qemu-img: introduce qemu_img_handle_error Pavel Hrdina
2013-03-26 21:26   ` Eric Blake
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 09/12] block: update return value from bdrv_snapshot_create Pavel Hrdina
2013-03-26 21:54   ` Eric Blake
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 10/12] savevm: update return value from qemu_savevm_state Pavel Hrdina
2013-03-26 21:57   ` Eric Blake
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 11/12] vm-snapshot-save: add force parameter Pavel Hrdina
2013-03-26 22:04   ` Eric Blake
2013-03-22 13:16 ` [Qemu-devel] [PATCH v2 12/12] savevm: icrease the IO_BUF_SIZE to improve the speed of savevm Pavel Hrdina
2013-03-26 22:05   ` Eric Blake
2013-03-27 17:42     ` Pavel Hrdina

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=5153393A.3030207@redhat.com \
    --to=phrdina@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).