[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 5/9] savevm: add public save_vmstate function
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v5 5/9] savevm: add public save_vmstate function |
Date: |
Mon, 26 Sep 2016 10:15:15 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 26/09/2016 10:08, Pavel Dovgalyuk wrote:
> -void hmp_savevm(Monitor *mon, const QDict *qdict)
> +int save_vmstate(Monitor *mon, const char *name)
Please change this to return an Error **.
Paolo
> {
> BlockDriverState *bs, *bs1;
> QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1;
> - int ret;
> + int ret = -1;
> QEMUFile *f;
> int saved_vm_running;
> 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));
> - return;
> + return ret;
> }
>
> /* Delete old snapshots of the same name */
> - if (name && bdrv_all_delete_snapshot(name, &bs1, &local_err) < 0) {
> - error_reportf_err(local_err,
> - "Error while deleting snapshot on device '%s': ",
> - bdrv_get_device_name(bs1));
> - return;
> + if (name) {
> + ret = bdrv_all_delete_snapshot(name, &bs1, &local_err);
> + if (ret < 0) {
> + error_reportf_err(local_err,
> + "Error while deleting snapshot on device '%s':
> ",
> + bdrv_get_device_name(bs1));
> + return ret;
> + }
> }
>
> bs = bdrv_all_find_vmstate_bs();
> if (bs == NULL) {
> monitor_printf(mon, "No block device can accept snapshots\n");
> - return;
> + return ret;
> }
- [Qemu-devel] [PATCH v5 0/9] replay additions, Pavel Dovgalyuk, 2016/09/26
- [Qemu-devel] [PATCH v5 1/9] replay: move internal data to the structure, Pavel Dovgalyuk, 2016/09/26
- [Qemu-devel] [PATCH v5 3/9] replay: allow replay stopping and restarting, Pavel Dovgalyuk, 2016/09/26
- [Qemu-devel] [PATCH v5 2/9] replay: vmstate for replay module, Pavel Dovgalyuk, 2016/09/26
- [Qemu-devel] [PATCH v5 4/9] record/replay: add network support, Pavel Dovgalyuk, 2016/09/26
- [Qemu-devel] [PATCH v5 5/9] savevm: add public save_vmstate function, Pavel Dovgalyuk, 2016/09/26
- Re: [Qemu-devel] [PATCH v5 5/9] savevm: add public save_vmstate function,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v5 6/9] replay: save/load initial state, Pavel Dovgalyuk, 2016/09/26
- [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters, Pavel Dovgalyuk, 2016/09/26
- Re: [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters, Kevin Wolf, 2016/09/26
- Re: [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters, Pavel Dovgalyuk, 2016/09/26
- Re: [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters, Kevin Wolf, 2016/09/26
- Re: [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters, Pavel Dovgalyuk, 2016/09/27
- Re: [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters, Kevin Wolf, 2016/09/28
- Re: [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters, Pavel Dovgalyuk, 2016/09/28
- Re: [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters, Kevin Wolf, 2016/09/28
- Re: [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters, Pavel Dovgalyuk, 2016/09/28