[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 10/44] block/vmdk: Relative backing file for creat
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 10/44] block/vmdk: Relative backing file for creation |
Date: |
Mon, 12 Jan 2015 16:40:00 +0000 |
From: Max Reitz <address@hidden>
When a vmdk image is created with a backing file, it is opened to check
whether it is indeed a vmdk file by letting qemu probe it. When doing
so, the backing filename is relative to the image's base directory so it
should be interpreted accordingly.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vmdk.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index bfff900..52cb888 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1891,8 +1891,19 @@ static int vmdk_create(const char *filename, QemuOpts
*opts, Error **errp)
}
if (backing_file) {
BlockDriverState *bs = NULL;
- ret = bdrv_open(&bs, backing_file, NULL, NULL, BDRV_O_NO_BACKING, NULL,
+ char *full_backing = g_new0(char, PATH_MAX);
+ bdrv_get_full_backing_filename_from_filename(filename, backing_file,
+ full_backing, PATH_MAX,
+ &local_err);
+ if (local_err) {
+ g_free(full_backing);
+ error_propagate(errp, local_err);
+ ret = -ENOENT;
+ goto exit;
+ }
+ ret = bdrv_open(&bs, full_backing, NULL, NULL, BDRV_O_NO_BACKING, NULL,
errp);
+ g_free(full_backing);
if (ret != 0) {
goto exit;
}
--
2.1.0
- [Qemu-devel] [PULL v2 14/44] qapi: Comment version info in TransactionAction, (continued)
- [Qemu-devel] [PULL v2 14/44] qapi: Comment version info in TransactionAction, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 12/44] qapi: Fix document for BlockStats.node-name, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 19/44] migration/block: fix pending() return value, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 05/44] block: replace g_new0 with g_new for bottom half allocation., Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 11/44] iotests: Add test for relative backing file names, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 06/44] checkpatch: Brace handling on multi-line condition, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 18/44] iotests: Filter out "I/O thread spun..." warning, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 29/44] qemu-iotests: Add "_supported_os Linux" to 058, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 08/44] block: JSON filenames and relative backing files, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 09/44] block: Relative backing file for image creation, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 10/44] block/vmdk: Relative backing file for creation,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 13/44] block: fix spoiling all dirty bitmaps by mirror and migration, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 07/44] block: Get full backing filename from string, Stefan Hajnoczi, 2015/01/12
- [Qemu-devel] [PULL v2 31/44] coroutine-ucontext: use __thread, Stefan Hajnoczi, 2015/01/12
- Re: [Qemu-devel] [PULL v2 00/44] Block patches, Peter Maydell, 2015/01/12