From: Kevin Wolf <kwolf@redhat.com>
To: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: [Qemu-devel] Re: [PATCH v2] loadvm: improve tests before bdrv_snapshot_goto()
Date: Tue, 20 Jul 2010 12:09:31 +0200 [thread overview]
Message-ID: <4C4575DB.1090001@redhat.com> (raw)
In-Reply-To: <1279563901-28590-1-git-send-email-miguel.filho@gmail.com>
Am 19.07.2010 20:25, schrieb Miguel Di Ciurcio Filho:
> This patch improves the resilience of the load_vmstate() function, doing
> further and better ordered tests.
>
> In load_vmstate(), if there is any error on bdrv_snapshot_goto(), except if the
> error is on VM state device, load_vmstate() will return zero and the VM will be
> started with major corruption chances.
>
> The current process:
> - test if there is any writable device without snapshot support
> - if exists return -error
> - get the device that saves the VM state, possible return -error but unlikely
> because it was tested earlier
> - flush I/O
> - run bdrv_snapshot_goto() on devices
> - if fails, give an warning and goes to the next (not good!)
> - if fails on the VM state device, return zero (not good!)
> - check if the requested snapshot exists on the device that saves the VM state
> and the state is not zero
> - if fails return -error
> - open the file with the VM state
> - if fails return -error
> - load the VM state
> - if fails return -error
> - return zero
>
> New behavior:
> - get the device that saves the VM state
> - if fails return -error
> - check if the requested snapshot exists on the device that saves the VM state
> and the state is not zero
> - if fails return -error
> - test if there is any writable device without snapshot support
> - if exists return -error
> - test if the devices with snapshot support have the requested snapshot
> - if anyone fails, return -error
> - flush I/O
> - run snapshot_goto() on devices
> - if anyone fails, return -error
> - open the file with the VM state
> - if fails return -error
> - load the VM state
> - if fails return -error
> - return zero
>
> do_loadvm must not call vm_start if any error has occurred in load_vmstate.
>
> Changelog from v1
> ---------------
> - Use -ENOTSUP instead of -EINVAL when no device supports snapshots
> - Split the verification of the existance of an snapshot on the VM state device
> and the verification of the size of the saved VM state
>
> Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
Thanks, applied to the block branch.
Kevin
prev parent reply other threads:[~2010-07-20 10:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-19 18:25 [Qemu-devel] [PATCH v2] loadvm: improve tests before bdrv_snapshot_goto() Miguel Di Ciurcio Filho
2010-07-20 10:09 ` Kevin Wolf [this message]
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=4C4575DB.1090001@redhat.com \
--to=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=miguel.filho@gmail.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 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.