All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: Eric Blake <eblake@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/5] migration: split hmp_savevm to do_savevm and hmp_savevm wrapper
Date: Fri, 8 Jan 2016 14:27:32 +0300	[thread overview]
Message-ID: <568F9D24.6090803@openvz.org> (raw)
In-Reply-To: <567B11BA.4090901@redhat.com>

On 12/24/2015 12:27 AM, Eric Blake wrote:
> On 12/04/2015 07:44 AM, Denis V. Lunev wrote:
>> This would be useful in the next step when QMP version of this call will
>> be introduced.
>>
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> Reviewed-by: Juan Quintela <quintela@redhat.com>
>> CC: Amit Shah <amit.shah@redhat.com>
>> CC: Markus Armbruster <armbru@redhat.com>
>> CC: Eric Blake <eblake@redhat.com>
>> ---
>>   migration/savevm.c | 38 +++++++++++++++++++++++---------------
>>   1 file changed, 23 insertions(+), 15 deletions(-)
>>
>> @@ -1915,28 +1915,27 @@ void hmp_savevm(Monitor *mon, const QDict *qdict)
>>       uint64_t vm_state_size;
>>       qemu_timeval tv;
>>       struct tm tm;
>> -    const char *name = qdict_get_try_str(qdict, "name");
>>       Error *local_err = NULL;
>>       AioContext *aio_context;
>>   
>>       if (!bdrv_all_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.",
> No trailing '.' in error_setg() calls.
>
>> +                   bdrv_get_device_name(bs));
>>           return;
>>       }
>>   
>>       /* Delete old snapshots of the same name */
>>       if (name && bdrv_all_delete_snapshot(name, &bs1, &local_err) < 0) {
>> -        monitor_printf(mon,
>> -                       "Error while deleting snapshot on device '%s': %s\n",
>> -                       bdrv_get_device_name(bs1), error_get_pretty(local_err));
>> +        error_setg(errp, "Error while deleting snapshot on device '%s': %s",
>> +                   bdrv_get_device_name(bs1), error_get_pretty(local_err));
> Markus' series to add a prefixing notation would be better to use here
> (although I didn't check if he caught this one in that series already):
> https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg03495.html

this series is not yet merged. I think that we could do this refactoring 
later on.
This thing could be considered independent. Anyway, this series has its 
own value
and it takes a lot of time to push it in. Could we do  error setting 
improvement later on?

Messages are not changed etc. I'll change them as you suggest.


>>   
>> +void hmp_savevm(Monitor *mon, const QDict *qdict)
>> +{
>> +    Error *local_err = NULL;
>> +
>> +    do_savevm(qdict_get_try_str(qdict, "name"), &local_err);
>> +
>> +    if (local_err != NULL) {
> I would have just written 'if (local_err) {'; but that's minor style.
from my point of view explicit != NULL exposes that local_err is a
pointer rather than a boolean value.

> Looks like a clean refactoring, other than the nit about the trailing
> '.', so with that fixed:
> Reviewed-by: Eric Blake <eblake@redhat.com>
>

  reply	other threads:[~2016-01-08 11:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 14:44 [Qemu-devel] [PATCH v2 for 2.6 0/5] QMP wrappers for VM snapshot operations Denis V. Lunev
2015-12-04 14:44 ` [Qemu-devel] [PATCH 1/5] migration: split hmp_savevm to do_savevm and hmp_savevm wrapper Denis V. Lunev
2015-12-23 21:27   ` Eric Blake
2016-01-08 11:27     ` Denis V. Lunev [this message]
2016-01-08 16:14       ` Eric Blake
2016-01-08 16:40         ` Denis V. Lunev
2016-01-08 17:54           ` Eric Blake
2016-01-08 17:59             ` Denis V. Lunev
2015-12-04 14:44 ` [Qemu-devel] [PATCH 2/5] qmp: create qmp_savevm command Denis V. Lunev
2015-12-23 21:40   ` Eric Blake
2015-12-23 21:45     ` Denis V. Lunev
2016-01-08 13:19     ` Denis V. Lunev
2015-12-04 14:44 ` [Qemu-devel] [PATCH 3/5] qmp: create qmp_delvm command Denis V. Lunev
2015-12-23 21:48   ` Eric Blake
2015-12-04 14:44 ` [Qemu-devel] [PATCH 4/5] migration: improve error reporting for load_vmstate Denis V. Lunev
2015-12-23 21:56   ` Eric Blake
2015-12-04 14:44 ` [Qemu-devel] [PATCH 5/5] qmp: create QMP implementation of loadvm command Denis V. Lunev
2015-12-23 23:15   ` Eric Blake
2015-12-11  9:33 ` [Qemu-devel] [PATCH v2 for 2.6 0/5] QMP wrappers for VM snapshot operations Denis V. Lunev
2015-12-18  6:10   ` Denis V. Lunev
2015-12-23 21:10     ` Denis V. Lunev
  -- strict thread matches above, loose matches on Subject: below --
2015-11-16 15:32 [Qemu-devel] [PATCH " Denis V. Lunev
2015-11-16 15:32 ` [Qemu-devel] [PATCH 1/5] migration: split hmp_savevm to do_savevm and hmp_savevm wrapper Denis V. Lunev
2015-11-17  8:56   ` Markus Armbruster
2015-11-18 11:29   ` Juan Quintela

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=568F9D24.6090803@openvz.org \
    --to=den@openvz.org \
    --cc=amit.shah@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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.