[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/7] block: pass new base image format to bdrv_chang
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 5/7] block: pass new base image format to bdrv_change_backing_file |
Date: |
Thu, 5 Apr 2012 17:42:59 +0200 |
The format was not written to the image, only the file name.
This will overwrite an auto-probe image with the right format.
Format probing is unsafe and we want to avoid it whenever possible.
An alternative would be to look out the backing file from the image
above base.
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/stream.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/block/stream.c b/block/stream.c
index 54f2b39..2b492d5 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -240,11 +240,14 @@ retry:
}
if (!block_job_is_cancelled(&s->common) && sector_num == end && ret == 0) {
- const char *base_id = NULL;
+ const char *base_id = NULL, *base_fmt = NULL;
if (base) {
base_id = s->backing_file_id;
+ if (base->drv) {
+ base_fmt = base->drv->format_name;
+ }
}
- ret = bdrv_change_backing_file(bs, base_id, NULL);
+ ret = bdrv_change_backing_file(bs, base_id, base_fmt);
close_unused_images(bs, base, base_id);
}
--
1.7.9.3
- [Qemu-devel] [PATCH 0/7] Miscellaneous fixes for block and snapshots, Paolo Bonzini, 2012/04/05
- [Qemu-devel] [PATCH 1/7] block: add mode argument to blockdev-snapshot-sync, Paolo Bonzini, 2012/04/05
- [Qemu-devel] [PATCH 2/7] block: fail live snapshot if disk has no medium, Paolo Bonzini, 2012/04/05
- [Qemu-devel] [PATCH 3/7] block: fix snapshot with QED format, Paolo Bonzini, 2012/04/05
- [Qemu-devel] [PATCH 4/7] block: close unused image files at the end of streaming, Paolo Bonzini, 2012/04/05
- [Qemu-devel] [PATCH 5/7] block: pass new base image format to bdrv_change_backing_file,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 7/7] block: update in-memory backing file and format, Paolo Bonzini, 2012/04/05
- [Qemu-devel] [PATCH 6/7] block: push bdrv_change_backing_file error checking up from drivers, Paolo Bonzini, 2012/04/05
- Re: [Qemu-devel] [PATCH 0/7] Miscellaneous fixes for block and snapshots, Paolo Bonzini, 2012/04/12