[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 10/12] savevm: update return value from qemu_
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 10/12] savevm: update return value from qemu_savevm_state |
Date: |
Tue, 26 Mar 2013 15:57:40 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
On 03/22/2013 07:16 AM, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <address@hidden>
> ---
The commit message could usefully explain _why_ it is okay to collapse
all error values into one. As written, the code appears accurate; and
the lone caller (do_savevm) handles the new semantics. But this goes
back to my question in 9/10 - why not use errp as the witness, and
return void, instead of duplicating information?
> savevm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index 45d1b09..2e5f029 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -1805,7 +1805,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
> };
>
> if (qemu_savevm_state_blocked(errp)) {
> - return -EINVAL;
> + return -1;
> }
>
> qemu_mutex_unlock_iothread();
> @@ -1826,7 +1826,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
> if (ret != 0) {
> qemu_savevm_state_cancel();
> }
> - return ret;
> + return ret == 0 ? 0 : -1;
> }
>
> static int qemu_save_device_state(QEMUFile *f)
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v2 05/12] savevm: add error parameter to qemu_savevm_state_complete(), (continued)
- [Qemu-devel] [PATCH v2 04/12] savevm: add error parameter to qemu_savevm_state_iterate(), Pavel Hrdina, 2013/03/22
- [Qemu-devel] [PATCH v2 07/12] qapi: Convert savevm, Pavel Hrdina, 2013/03/22
- [Qemu-devel] [PATCH v2 06/12] savevm: add error parameter to qemu_savevm_state(), Pavel Hrdina, 2013/03/22
- [Qemu-devel] [PATCH v2 08/12] qemu-img: introduce qemu_img_handle_error, Pavel Hrdina, 2013/03/22
- [Qemu-devel] [PATCH v2 10/12] savevm: update return value from qemu_savevm_state, Pavel Hrdina, 2013/03/22
- Re: [Qemu-devel] [PATCH v2 10/12] savevm: update return value from qemu_savevm_state,
Eric Blake <=
- [Qemu-devel] [PATCH v2 09/12] block: update return value from bdrv_snapshot_create, Pavel Hrdina, 2013/03/22
- [Qemu-devel] [PATCH v2 12/12] savevm: icrease the IO_BUF_SIZE to improve the speed of savevm, Pavel Hrdina, 2013/03/22
- [Qemu-devel] [PATCH v2 11/12] vm-snapshot-save: add force parameter, Pavel Hrdina, 2013/03/22