All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] blk: do not select PFLASH device for internal snapshot
@ 2016-01-12  6:03 Denis V. Lunev
  2016-01-12 14:16 ` Kevin Wolf
  2016-01-14 11:33 ` [Qemu-devel] [PATCH 1/1] RESUME " Denis V. Lunev
  0 siblings, 2 replies; 25+ messages in thread
From: Denis V. Lunev @ 2016-01-12  6:03 UTC (permalink / raw)
  Cc: Kevin Wolf, qemu-block, qemu-devel, Paolo Bonzini,
	Denis V. Lunev, Laszlo Ersek

There is a long-long story. OVMF VMs can not be snapsotted using
'virsh snapshot' as they have "pflash" device which is configured as
"raw" image. There was a discussion in the past about that.

Good description has been provided on topic by Laszlo Ersek, see below:

"It is true that a pflash drive is "just a drive" *internally* to QEMU.
It is also true that it more or less takes the same -drive options as
any other *disk* drive. But those facts are just implementation details.

The relevant trait of pflash storage files is that they are not *disk
images*, on the libvirt domain XML level. They are not created in
storage pools, you cannot specify their caching attributes, you don't
specify their guest-visible frontend in separation (like virtio-blk /
    virtio-scsi / pflash). Those details are hidden (on purpose).

Consequently, pflash storage files are expected to be *small* in size
(in practice: identically sized to the varstore template they are
instantiated from). They are created under /var/lib/libvirt/qemu/nvram.
Although you can edit their path in the domain XML, they are not
considered disks."

Thus we should avoid selection of "pflash" drives for VM state saving.

For now "pflash" is read-write raw image as it configured by libvirt.
Thus there are no such images in the field and we could safely disable
ability to save state to those images inside QEMU.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Laszlo Ersek <lersek@redhat.com>
CC: qemu-block@nongnu.org
---
 block/snapshot.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/block/snapshot.c b/block/snapshot.c
index 2d86b88..1a03581 100644
--- a/block/snapshot.c
+++ b/block/snapshot.c
@@ -25,6 +25,7 @@
 #include "block/snapshot.h"
 #include "block/block_int.h"
 #include "qapi/qmp/qerror.h"
+#include "sysemu/blockdev.h"
 
 QemuOptsList internal_snapshot_opts = {
     .name = "snapshot",
@@ -481,8 +482,14 @@ BlockDriverState *bdrv_all_find_vmstate_bs(void)
     BlockDriverState *bs = NULL;
 
     while (not_found && (bs = bdrv_next(bs))) {
+        DriveInfo *dinfo;
         AioContext *ctx = bdrv_get_aio_context(bs);
 
+        dinfo = bs->blk != NULL ? blk_legacy_dinfo(bs->blk) : NULL;
+        if (dinfo != NULL && dinfo->type == IF_PFLASH) {
+            continue;
+        }
+
         aio_context_acquire(ctx);
         not_found = !bdrv_can_snapshot(bs);
         aio_context_release(ctx);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2016-01-14 11:33 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-12  6:03 [Qemu-devel] [PATCH 1/1] blk: do not select PFLASH device for internal snapshot Denis V. Lunev
2016-01-12 14:16 ` Kevin Wolf
2016-01-12 14:59   ` Paolo Bonzini
2016-01-12 15:13     ` Denis V. Lunev
2016-01-12 15:16       ` Peter Maydell
2016-01-12 15:26         ` Kevin Wolf
2016-01-12 15:20     ` Kevin Wolf
2016-01-12 15:35       ` Paolo Bonzini
2016-01-12 15:47       ` Denis V. Lunev
2016-01-12 16:35         ` Denis V. Lunev
2016-01-12 16:52           ` Kevin Wolf
2016-01-12 16:58             ` Denis V. Lunev
2016-01-12 17:40             ` Markus Armbruster
2016-01-12 17:50               ` Kevin Wolf
2016-01-12 17:54                 ` Denis V. Lunev
2016-01-13  8:09                 ` Markus Armbruster
2016-01-13 10:43                 ` Laszlo Ersek
2016-01-12 17:53               ` Denis V. Lunev
2016-01-13 10:41               ` Laszlo Ersek
2016-01-13 10:37         ` Laszlo Ersek
2016-01-13 11:11           ` Denis V. Lunev
2016-01-13 12:15             ` Laszlo Ersek
2016-01-12 15:10   ` Denis V. Lunev
2016-01-12 15:28     ` Kevin Wolf
2016-01-14 11:33 ` [Qemu-devel] [PATCH 1/1] RESUME " Denis V. Lunev

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.