[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 23/24] block: Create proper size file for disk mirro
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 23/24] block: Create proper size file for disk mirror |
Date: |
Fri, 25 Jan 2013 19:45:59 +0100 |
From: Vishvananda Ishaya <address@hidden>
The qmp monitor command to mirror a disk was passing -1 for size
along with the disk's backing file. This size of the resulting disk
is the size of the backing file, which is incorrect if the disk
has been resized. Therefore we should always pass in the size of
the current disk.
Signed-off-by: Vishvananda Ishaya <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
blockdev.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index ac396f3..fdc573f 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1282,11 +1282,11 @@ void qmp_drive_mirror(const char *device, const char
*target,
return;
}
+ bdrv_get_geometry(bs, &size);
+ size *= 512;
if (sync == MIRROR_SYNC_MODE_FULL && mode != NEW_IMAGE_MODE_EXISTING) {
/* create new image w/o backing file */
assert(format && drv);
- bdrv_get_geometry(bs, &size);
- size *= 512;
bdrv_img_create(target, format,
NULL, NULL, NULL, size, flags, &local_err);
} else {
@@ -1299,7 +1299,7 @@ void qmp_drive_mirror(const char *device, const char
*target,
bdrv_img_create(target, format,
source->filename,
source->drv->format_name,
- NULL, -1, flags, &local_err);
+ NULL, size, flags, &local_err);
break;
default:
abort();
--
1.7.6.5
- [Qemu-devel] [PATCH 10/24] mirror: add buf-size argument to drive-mirror, (continued)
- [Qemu-devel] [PATCH 10/24] mirror: add buf-size argument to drive-mirror, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 11/24] mirror: support more than one in-flight AIO operation, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 13/24] block: Add special error code for wrong format, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 12/24] mirror: support arbitrarily-sized iterations, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 14/24] block: Use error code EMEDIUMTYPE for wrong format in some block drivers, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 18/24] mirror: do nothing on zero-sized disk, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 19/24] hbitmap: add assertion on hbitmap_iter_init, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 17/24] block/vdi: Check for bad signature, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 15/24] block/vdi: Improve debug output for signature, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 16/24] block/vdi: Improved return values from vdi_open, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 23/24] block: Create proper size file for disk mirror,
Kevin Wolf <=
- [Qemu-devel] [PATCH 20/24] ahci: Remove unused AHCIDevice fields, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 22/24] ahci: Add migration support, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 24/24] ide: Add fall through annotations, Kevin Wolf, 2013/01/25
- [Qemu-devel] [PATCH 21/24] ahci: Change data types in preparation for migration, Kevin Wolf, 2013/01/25