From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW5Gn-0001la-QN for qemu-devel@nongnu.org; Fri, 04 Apr 2014 10:39:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WW5Gh-0001Mz-7g for qemu-devel@nongnu.org; Fri, 04 Apr 2014 10:39:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW5Gg-0001Me-So for qemu-devel@nongnu.org; Fri, 04 Apr 2014 10:38:55 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s34EcsJo013088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 4 Apr 2014 10:38:54 -0400 Message-ID: <533EC3F4.1020302@redhat.com> Date: Fri, 04 Apr 2014 16:38:44 +0200 From: Max Reitz MIME-Version: 1.0 References: <1396613033-20222-1-git-send-email-kwolf@redhat.com> <1396613033-20222-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1396613033-20222-4-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/3] block: Fix snapshot=on for protocol parsed from filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: stefanha@redhat.com On 04.04.2014 14:03, Kevin Wolf wrote: > Since commit 9fd3171a, BDRV_O_SNAPSHOT uses an option QDict to specify > the originally requested image as the backing file of the newly created= > temporary snapshot. This means that the filename is stored in > "file.filename", which is an option that is not parsed for protocol > names. Therefore things like -drive file=3Dnbd:localhost:10809 were > broken because it looked for a local file with the literal name > 'nbd:localhost:10809'. > > This patch changes the way BDRV_O_SNAPSHOT works once again. We now ope= n > the originally requested image as normal, and then do a similar > operation as for live snapshots to put the temporary snapshot on top. > This way, both driver specific options and parsed filenames work. > > As a nice side effect, this results in code movement to factor > bdrv_append_temp_snapshot() out. This is a good preparation for moving > its call to drive_init() and friends eventually. > > Signed-off-by: Kevin Wolf > --- > block.c | 144 +++++++++++++++++++++++-------------= --------- > include/block/block.h | 1 + > tests/qemu-iotests/051 | 2 + > tests/qemu-iotests/051.out | 14 +++++ > 4 files changed, 91 insertions(+), 70 deletions(-) > > diff --git a/block.c b/block.c > index df2b8d1..7817fea 100644 > --- a/block.c > +++ b/block.c > @@ -1162,6 +1162,69 @@ done: > return ret; > } > =20 > +void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp) > +{ > + /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows.= */ > + char tmp_filename[PATH_MAX + 1]; > + > + int64_t total_size; > + BlockDriver *bdrv_qcow2; > + QEMUOptionParameter *create_options; > + QDict *snapshot_options; > + BlockDriverState *bs_snapshot; > + Error *local_err; > + int ret; > + > + /* if snapshot, we create a temporary backing file and open it > + instead of opening 'filename' directly */ > + > + /* Get the required size from the image */ > + total_size =3D bdrv_getlength(bs) & BDRV_SECTOR_MASK; bdrv_getlength() may fail. > + > + /* Create the temporary image */ > + ret =3D get_tmp_filename(tmp_filename, sizeof(tmp_filename)); > + if (ret < 0) { > + error_setg_errno(errp, -ret, "Could not get temporary filename= "); > + return; > + } > + > + bdrv_qcow2 =3D bdrv_find_format("qcow2"); > + create_options =3D parse_option_parameters("", bdrv_qcow2->create_= options, > + NULL); > + > + set_option_parameter_int(create_options, BLOCK_OPT_SIZE, total_siz= e); > + > + ret =3D bdrv_create(bdrv_qcow2, tmp_filename, create_options, &loc= al_err); > + free_option_parameters(create_options); > + if (ret < 0) { > + error_setg_errno(errp, -ret, "Could not create temporary overl= ay " > + "'%s': %s", tmp_filename, > + error_get_pretty(local_err)); > + error_free(local_err); > + return; > + } > + > + /* Prepare a new options QDict for the temporary file */ > + snapshot_options =3D qdict_new(); > + qdict_put(snapshot_options, "file.driver", > + qstring_from_str("file")); > + qdict_put(snapshot_options, "file.filename", > + qstring_from_str(tmp_filename)); > + > + bs_snapshot =3D bdrv_new(""); > + bs_snapshot->is_temporary =3D 1; > + > + ret =3D bdrv_open(&bs_snapshot, NULL, NULL, snapshot_options, > + bs->open_flags & ~BDRV_O_SNAPSHOT, bdrv_qcow2, &lo= cal_err); > + if (ret < 0) { > + error_propagate(errp, local_err); > + return; > + } > + > + bdrv_append(bs_snapshot, bs); > + bdrv_reopen(bs_snapshot, bs_snapshot->open_flags & ~BDRV_O_RDWR, N= ULL); This may fail as well. I don't know how likely that is, but it might=20 (for qcow2 at least after your patch "qcow2: Flush metadata during=20 read-only reopen"). > +} > + > /* > * Opens a disk image (raw, qcow2, vmdk, ...) > * > @@ -1182,8 +1245,6 @@ int bdrv_open(BlockDriverState **pbs, const char = *filename, > BlockDriver *drv, Error **errp) > { > int ret; > - /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows.= */ > - char tmp_filename[PATH_MAX + 1]; > BlockDriverState *file =3D NULL, *bs; > const char *drvname; > Error *local_err =3D NULL; > @@ -1243,74 +1304,6 @@ int bdrv_open(BlockDriverState **pbs, const char= *filename, > } > } > =20 > - /* For snapshot=3Don, create a temporary qcow2 overlay */ > - if (flags & BDRV_O_SNAPSHOT) { > - BlockDriverState *bs1; > - int64_t total_size; > - BlockDriver *bdrv_qcow2; > - QEMUOptionParameter *create_options; > - QDict *snapshot_options; > - > - /* if snapshot, we create a temporary backing file and open it= > - instead of opening 'filename' directly */ > - > - /* Get the required size from the image */ > - QINCREF(options); > - bs1 =3D NULL; > - ret =3D bdrv_open(&bs1, filename, NULL, options, BDRV_O_NO_BAC= KING, > - drv, &local_err); > - if (ret < 0) { > - goto fail; > - } > - total_size =3D bdrv_getlength(bs1) & BDRV_SECTOR_MASK; > - > - bdrv_unref(bs1); > - > - /* Create the temporary image */ > - ret =3D get_tmp_filename(tmp_filename, sizeof(tmp_filename)); > - if (ret < 0) { > - error_setg_errno(errp, -ret, "Could not get temporary file= name"); > - goto fail; > - } > - > - bdrv_qcow2 =3D bdrv_find_format("qcow2"); > - create_options =3D parse_option_parameters("", bdrv_qcow2->cre= ate_options, > - NULL); > - > - set_option_parameter_int(create_options, BLOCK_OPT_SIZE, total= _size); > - > - ret =3D bdrv_create(bdrv_qcow2, tmp_filename, create_options, = &local_err); > - free_option_parameters(create_options); > - if (ret < 0) { > - error_setg_errno(errp, -ret, "Could not create temporary o= verlay " > - "'%s': %s", tmp_filename, > - error_get_pretty(local_err)); > - error_free(local_err); > - local_err =3D NULL; > - goto fail; > - } > - > - /* Prepare a new options QDict for the temporary file, where u= ser > - * options refer to the backing file */ > - if (filename) { > - qdict_put(options, "file.filename", qstring_from_str(filen= ame)); > - } > - if (drv) { > - qdict_put(options, "driver", qstring_from_str(drv->format_= name)); > - } > - > - snapshot_options =3D qdict_new(); > - qdict_put(snapshot_options, "backing", options); > - qdict_flatten(snapshot_options); > - > - bs->options =3D snapshot_options; > - options =3D qdict_clone_shallow(bs->options); > - > - filename =3D tmp_filename; > - drv =3D bdrv_qcow2; > - bs->is_temporary =3D 1; > - } > - > /* Open image file without format layer */ > if (flags & BDRV_O_RDWR) { > flags |=3D BDRV_O_ALLOW_RDWR; > @@ -1372,6 +1365,17 @@ int bdrv_open(BlockDriverState **pbs, const char= *filename, > } > } > =20 > + /* For snapshot=3Don, create a temporary qcow2 overlay. bs points = to the > + * temporary snapshot afterwards. */ > + if (flags & BDRV_O_SNAPSHOT) { > + bdrv_append_temp_snapshot(bs, &local_err); > + if (local_err) { > + error_propagate(errp, local_err); > + goto close_and_fail; > + } > + } > + > + > done: > /* Check if any unknown options were used */ > if (options && (qdict_size(options) !=3D 0)) { > diff --git a/include/block/block.h b/include/block/block.h > index 1ed55d8..b3230a2 100644 > --- a/include/block/block.h > +++ b/include/block/block.h > @@ -190,6 +190,7 @@ int bdrv_open_image(BlockDriverState **pbs, const c= har *filename, > QDict *options, const char *bdref_key, int flags,= > bool allow_none, Error **errp); > int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Erro= r **errp); > +void bdrv_append_temp_snapshot(BlockDriverState *bs, Error **errp); > int bdrv_open(BlockDriverState **pbs, const char *filename, > const char *reference, QDict *options, int flags, > BlockDriver *drv, Error **errp); > diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 > index 2f79b26..d6d926a 100755 > --- a/tests/qemu-iotests/051 > +++ b/tests/qemu-iotests/051 > @@ -218,6 +218,8 @@ echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_= qemu -drive file=3D"$TEST_IMG" > echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file=3D= "$TEST_IMG",snapshot=3Don | _filter_qemu_io > echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.f= ilename=3D"$TEST_IMG",driver=3Dqcow2,snapshot=3Don | _filter_qemu_io > echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.f= ilename=3D"$TEST_IMG",driver=3Dqcow2 -snapshot | _filter_qemu_io > +echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file=3D= "file:$TEST_IMG" -snapshot | _filter_qemu_io > +echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file=3D= "file:$TEST_IMG",snapshot=3Don | _filter_qemu_io > =20 > $QEMU_IO -c "read -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io > =20 > diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out > index a631b0b..dae0f1c 100644 > --- a/tests/qemu-iotests/051.out > +++ b/tests/qemu-iotests/051.out > @@ -319,6 +319,20 @@ wrote 4096/4096 bytes at offset 0 > 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > (qemu) q=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[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dqemu-io ide0-hd0 "write -P 0x22= 0 4k"=1B[K The splitting if this one overly long line into three single lines gave=20 git a hard time, but after manual fixing, it applies. > +wrote 4096/4096 bytes at offset 0 > +4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > +(qemu) q=1B[K=1B[Dqu=1B[K=1B[D=1B[Dqui=1B[K=1B[D=1B[D=1B[Dquit=1B[K > + > +Testing: -drive file=3Dfile:TEST_DIR/t.qcow2,snapshot=3Don > +QEMU X.Y.Z monitor - type 'help' for more information > +(qemu) q=1B[K=1B[Dqe=1B[K=1B[D=1B[Dqem=1B[K=1B[D=1B[D=1B[Dqemu=1B[K=1B= [D=1B[D=1B[D=1B[Dqemu-=1B[K=1B[D=1B[D=1B[D=1B[D=1B[Dqemu-i=1B[K=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[Dqemu-io=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dqemu-i= o =1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dqemu-io i=1B[K=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dqemu-io id=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[Dqemu-io ide=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D= =1B[D=1B[D=1B[D=1B[Dqemu-io ide0=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[Dqemu-io ide0-=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dqemu-io ide0-h=1B[K=1B[D=1B[D=1B[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=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[= D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dqemu-io ide0-hd0 "write -P 0x22= 0 4k=1B[K=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B= [D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[D=1B[Dqemu-io ide0-hd0 "write -P 0x22= 0 4k"=1B[K > +wrote 4096/4096 bytes at offset 0 > +4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > +(qemu) q=1B[K=1B[Dqu=1B[K=1B[D=1B[Dqui=1B[K=1B[D=1B[D=1B[Dquit=1B[K > + > read 4096/4096 bytes at offset 0 > 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > Testing: -drive file=3DTEST_DIR/t.qcow2,snapshot=3Doff I don't find not checking the return values too bad, as both functions=20 are pretty unlikely to fail; normally, I'd probably give a reviewed-by,=20 but after just having reviewed the block fix series=85 Max