add the zeroinit block driver filter
[pve-qemu-kvm.git] / debian / patches / old / 0008-vma-restore-tolerate-a-size-difference-up-to-4M.patch
blob2e76dae8c197a90132155d391bfa4491564bcb43
1 From 4ca68d0ccfd64f2fdc63ba44813bbafab8d90c81 Mon Sep 17 00:00:00 2001
2 From: Dietmar Maurer <dietmar@proxmox.com>
3 Date: Tue, 26 Mar 2013 06:21:16 +0100
4 Subject: [PATCH v5 8/8] vma restore: tolerate a size difference up to 4M
7 Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 ---
9 vma-reader.c | 8 +++++++-
10 1 files changed, 7 insertions(+), 1 deletions(-)
12 diff --git a/vma-reader.c b/vma-reader.c
13 index a740f04..69e7578 100644
14 --- a/vma-reader.c
15 +++ b/vma-reader.c
16 @@ -465,7 +465,13 @@ int vma_reader_register_bs(VmaReader *vmar, guint8 dev_id, BlockDriverState *bs,
17 assert(vmar->rstate[dev_id].bs == NULL);
19 int64_t size = bdrv_getlength(bs);
20 - if (size != vmar->devinfo[dev_id].size) {
21 + int64_t size_diff = size - vmar->devinfo[dev_id].size;
23 + /* storage types can have different size restrictions, so it
24 + * is not always possible to create an image with exact size.
25 + * So we tolerate a size difference up to 4MB.
26 + */
27 + if ((size_diff < 0) || (size_diff > 4*1024*1024)) {
28 error_setg(errp, "vma_reader_register_bs for stream %s failed - "
29 "unexpected size %zd != %zd", vmar->devinfo[dev_id].devname,
30 size, vmar->devinfo[dev_id].size);
31 --
32 1.7.2.5