2013-04-09 17:56:13 +04:00
QA output created by 051
2014-12-09 10:38:03 +03:00
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
iotests: Specify explicit backing format where sensible
There are many existing qcow2 images that specify a backing file but
no format. This has been the source of CVEs in the past, but has
become more prominent of a problem now that libvirt has switched to
-blockdev. With older -drive, at least the probing was always done by
qemu (so the only risk of a changed format between successive boots of
a guest was if qemu was upgraded and probed differently). But with
newer -blockdev, libvirt must specify a format; if libvirt guesses raw
where the image was formatted, this results in data corruption visible
to the guest; conversely, if libvirt guesses qcow2 where qemu was
using raw, this can result in potential security holes, so modern
libvirt instead refuses to use images without explicit backing format.
The change in libvirt to reject images without explicit backing format
has pointed out that a number of tools have been far too reliant on
probing in the past. It's time to set a better example in our own
iotests of properly setting this parameter.
iotest calls to create, rebase, and convert are all impacted to some
degree. It's a bit annoying that we are inconsistent on command line
- while all of those accept -o backing_file=...,backing_fmt=..., the
shortcuts are different: create and rebase have -b and -F, while
convert has -B but no -F. (amend has no shortcuts, but the previous
patch just deprecated the use of amend to change backing chains).
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200706203954.341758-9-eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2020-07-06 23:39:52 +03:00
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
2013-04-09 17:56:13 +04:00
=== Unknown option ===
2016-01-04 08:29:20 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=,if=none,id=drive0
2016-03-16 21:54:34 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=,if=none,id=drive0: Block format 'qcow2' does not support the option 'unknown_opt'
2013-04-09 17:56:13 +04:00
2016-01-04 08:29:20 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on,if=none,id=drive0
2016-03-16 21:54:34 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on,if=none,id=drive0: Block format 'qcow2' does not support the option 'unknown_opt'
2013-04-09 17:56:13 +04:00
2016-01-04 08:29:20 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234,if=none,id=drive0
2016-03-16 21:54:34 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234,if=none,id=drive0: Block format 'qcow2' does not support the option 'unknown_opt'
2013-04-09 17:56:13 +04:00
2016-01-04 08:29:20 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo,if=none,id=drive0
2016-03-16 21:54:34 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo,if=none,id=drive0: Block format 'qcow2' does not support the option 'unknown_opt'
2013-04-09 17:56:13 +04:00
2014-03-06 19:34:46 +04:00
=== Unknown protocol option ===
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=: Block protocol 'file' doesn't support the option 'unknown_opt'
2014-03-06 19:34:46 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on: Block protocol 'file' doesn't support the option 'unknown_opt'
2014-03-06 19:34:46 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234: Block protocol 'file' doesn't support the option 'unknown_opt'
2014-03-06 19:34:46 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo: Block protocol 'file' doesn't support the option 'unknown_opt'
2014-03-06 19:34:46 +04:00
2013-08-08 19:44:52 +04:00
=== Invalid format ===
Testing: -drive file=TEST_DIR/t.qcow2,format=foo
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=foo: Unknown driver 'foo'
2013-08-08 19:44:52 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: Unknown driver 'foo'
2014-05-27 12:50:29 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2: Cannot specify both 'driver' and 'format'
2013-08-08 19:44:52 +04:00
2015-02-05 21:58:13 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specify both 'driver' and 'format'
2015-02-05 21:58:13 +03:00
2013-08-08 19:44:52 +04:00
2018-07-04 14:28:29 +03:00
=== Node names ===
Testing: -drive file=TEST_DIR/t.qcow2,node-name=x123456789012345678901234567890
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) quit
Testing: -drive file=TEST_DIR/t.qcow2,node-name=x1234567890123456789012345678901
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=x1234567890123456789012345678901: Node name too long
Testing: -drive file=TEST_DIR/t.qcow2,node-name=All-Types.of_all0wed_chars
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) quit
Testing: -drive file=TEST_DIR/t.qcow2,node-name=123foo
2021-03-18 23:09:49 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=123foo: Invalid node-name: '123foo'
2018-07-04 14:28:29 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,node-name=_foo
2021-03-18 23:09:49 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=_foo: Invalid node-name: '_foo'
2018-07-04 14:28:29 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,node-name=foo#12
2021-03-18 23:09:49 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,node-name=foo#12: Invalid node-name: 'foo#12'
2018-07-04 14:28:29 +03:00
2015-03-03 17:59:26 +03:00
=== Device without drive ===
2021-03-23 19:53:05 +03:00
Testing: -device virtio-scsi -device scsi-hd
2015-03-03 17:59:26 +03:00
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) QEMU_PROG: -device scsi-hd: drive property not set
2013-09-22 16:05:07 +04:00
=== Overriding backing file ===
2016-01-04 08:29:20 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig,if=none,id=drive0 -nodefaults
2014-04-03 14:48:38 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) info block
block: Respect backing bs in bdrv_refresh_filename
Basically, bdrv_refresh_filename() should respect all children of a
BlockDriverState. However, generally those children are driver-specific,
so this function cannot handle the general case. On the other hand,
there are only few drivers which use other children than @file and
@backing (that being vmdk, quorum, and blkverify).
Most block drivers only use @file and/or @backing (if they use any
children at all). Both can be implemented directly in
bdrv_refresh_filename.
The user overriding the file's filename is already handled, however, the
user overriding the backing file is not. If this is done, opening the
BDS with the plain filename of its file will not be correct, so we may
not set bs->exact_filename in that case.
iotest 051 contains test cases for overriding the backing file, and so
its output changes with this patch applied.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20190201192935.18394-6-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2019-02-01 22:29:09 +03:00
drive0 (NODE_NAME): json:{"backing": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/t.qcow2.orig"}}, "driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/t.qcow2"}} (qcow2)
2016-01-04 08:29:20 +03:00
Removable device: not locked, tray closed
2014-05-22 15:28:45 +04:00
Cache mode: writeback
2014-04-03 14:48:38 +04:00
Backing file: TEST_DIR/t.qcow2.orig (chain depth: 1)
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-09-22 16:05:07 +04:00
2014-06-04 17:09:35 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files
2014-06-04 17:09:35 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,file.backing.driver=file,file.backing.filename=TEST_DIR/t.qcow2.orig
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.backing.driver=file,file.backing.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files
2014-06-04 17:09:35 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,file.backing.driver=qcow2,file.backing.file.filename=TEST_DIR/t.qcow2.orig
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.backing.driver=qcow2,file.backing.file.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files
2014-06-04 17:09:35 +04:00
2013-09-22 16:05:07 +04:00
2013-04-09 17:56:13 +04:00
=== Enable and disable lazy refcounting on the command line, plus some invalid values ===
2017-11-23 05:08:26 +03:00
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
2013-07-17 16:45:34 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 17:56:13 +04:00
2013-07-17 16:45:34 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 17:56:13 +04:00
2013-07-17 16:45:34 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=: Parameter 'lazy-refcounts' expects 'on' or 'off'
2013-04-09 17:56:13 +04:00
2013-07-17 16:45:34 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42: Parameter 'lazy-refcounts' expects 'on' or 'off'
2013-04-09 17:56:13 +04:00
2013-07-17 16:45:34 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo: Parameter 'lazy-refcounts' expects 'on' or 'off'
2013-04-09 17:56:13 +04:00
=== With version 2 images enabling lazy refcounts must fail ===
2014-12-09 10:38:03 +03:00
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
2013-07-17 16:45:34 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on: Lazy refcounts require a qcow2 image with at least qemu 1.1 compatibility level
2013-04-09 17:56:13 +04:00
2013-07-17 16:45:34 +04:00
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 17:56:13 +04:00
=== No medium ===
Testing: -drive if=virtio
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2013-07-10 19:30:26 +04:00
(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
2013-04-09 17:56:13 +04:00
2019-05-23 17:09:19 +03:00
=== Attach to node in non-default iothread ===
2013-04-09 17:56:13 +04:00
=== Read-only ===
Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 17:56:13 +04:00
=== Cache modes ===
2019-07-25 15:00:50 +03:00
Testing: -drive driver=null-co,read-zeroes=on,cache=none
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 17:56:13 +04:00
2019-07-25 15:00:50 +03:00
Testing: -drive driver=null-co,read-zeroes=on,cache=directsync
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 17:56:13 +04:00
2019-07-25 15:00:50 +03:00
Testing: -drive driver=null-co,read-zeroes=on,cache=writeback
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 17:56:13 +04:00
2019-07-25 15:00:50 +03:00
Testing: -drive driver=null-co,read-zeroes=on,cache=writethrough
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 17:56:13 +04:00
2019-07-25 15:00:50 +03:00
Testing: -drive driver=null-co,read-zeroes=on,cache=unsafe
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 17:56:13 +04:00
2015-05-07 15:41:30 +03:00
Testing: -drive driver=null-co,cache=invalid_value
QEMU_PROG: -drive driver=null-co,cache=invalid_value: invalid cache option
2013-04-09 17:56:13 +04:00
2016-04-05 12:21:44 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,cache=writeback,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
2015-05-08 19:03:15 +03:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) info block
block: Respect backing bs in bdrv_refresh_filename
Basically, bdrv_refresh_filename() should respect all children of a
BlockDriverState. However, generally those children are driver-specific,
so this function cannot handle the general case. On the other hand,
there are only few drivers which use other children than @file and
@backing (that being vmdk, quorum, and blkverify).
Most block drivers only use @file and/or @backing (if they use any
children at all). Both can be implemented directly in
bdrv_refresh_filename.
The user overriding the file's filename is already handled, however, the
user overriding the backing file is not. If this is done, opening the
BDS with the plain filename of its file will not be correct, so we may
not set bs->exact_filename in that case.
iotest 051 contains test cases for overriding the backing file, and so
its output changes with this patch applied.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20190201192935.18394-6-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2019-02-01 22:29:09 +03:00
drive0 (NODE_NAME): json:{"backing": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/t.qcow2.base"}}, "driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/t.qcow2"}} (qcow2)
2016-01-04 08:29:20 +03:00
Removable device: not locked, tray closed
2015-05-08 19:03:15 +03:00
Cache mode: writeback
Backing file: TEST_DIR/t.qcow2.base (chain depth: 1)
2017-04-13 20:19:51 +03:00
(qemu) info block file
2015-05-08 19:03:15 +03:00
file: TEST_DIR/t.qcow2 (file)
Cache mode: writeback
2017-04-13 20:19:51 +03:00
(qemu) info block backing
2015-05-08 19:03:15 +03:00
backing: TEST_DIR/t.qcow2.base (qcow2, read-only)
Cache mode: writeback, ignore flushes
2017-04-13 20:19:51 +03:00
(qemu) info block backing-file
2015-05-08 19:03:15 +03:00
backing-file: TEST_DIR/t.qcow2.base (file, read-only)
Cache mode: writeback, ignore flushes
2017-04-13 20:19:51 +03:00
(qemu) quit
2015-05-08 19:03:15 +03:00
2016-04-05 12:21:44 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,cache=writethrough,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
2015-05-08 19:03:15 +03:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) info block
block: Respect backing bs in bdrv_refresh_filename
Basically, bdrv_refresh_filename() should respect all children of a
BlockDriverState. However, generally those children are driver-specific,
so this function cannot handle the general case. On the other hand,
there are only few drivers which use other children than @file and
@backing (that being vmdk, quorum, and blkverify).
Most block drivers only use @file and/or @backing (if they use any
children at all). Both can be implemented directly in
bdrv_refresh_filename.
The user overriding the file's filename is already handled, however, the
user overriding the backing file is not. If this is done, opening the
BDS with the plain filename of its file will not be correct, so we may
not set bs->exact_filename in that case.
iotest 051 contains test cases for overriding the backing file, and so
its output changes with this patch applied.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20190201192935.18394-6-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2019-02-01 22:29:09 +03:00
drive0 (NODE_NAME): json:{"backing": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/t.qcow2.base"}}, "driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/t.qcow2"}} (qcow2)
2016-01-04 08:29:20 +03:00
Removable device: not locked, tray closed
2015-05-08 19:03:15 +03:00
Cache mode: writethrough
Backing file: TEST_DIR/t.qcow2.base (chain depth: 1)
2017-04-13 20:19:51 +03:00
(qemu) info block file
2015-05-08 19:03:15 +03:00
file: TEST_DIR/t.qcow2 (file)
Cache mode: writeback
2017-04-13 20:19:51 +03:00
(qemu) info block backing
2015-05-08 19:03:15 +03:00
backing: TEST_DIR/t.qcow2.base (qcow2, read-only)
Cache mode: writeback, ignore flushes
2017-04-13 20:19:51 +03:00
(qemu) info block backing-file
2015-05-08 19:03:15 +03:00
backing-file: TEST_DIR/t.qcow2.base (file, read-only)
Cache mode: writeback, ignore flushes
2017-04-13 20:19:51 +03:00
(qemu) quit
2015-05-08 19:03:15 +03:00
2016-04-05 12:21:44 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,cache=unsafe,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
2015-05-08 19:03:15 +03:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) info block
block: Respect backing bs in bdrv_refresh_filename
Basically, bdrv_refresh_filename() should respect all children of a
BlockDriverState. However, generally those children are driver-specific,
so this function cannot handle the general case. On the other hand,
there are only few drivers which use other children than @file and
@backing (that being vmdk, quorum, and blkverify).
Most block drivers only use @file and/or @backing (if they use any
children at all). Both can be implemented directly in
bdrv_refresh_filename.
The user overriding the file's filename is already handled, however, the
user overriding the backing file is not. If this is done, opening the
BDS with the plain filename of its file will not be correct, so we may
not set bs->exact_filename in that case.
iotest 051 contains test cases for overriding the backing file, and so
its output changes with this patch applied.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20190201192935.18394-6-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2019-02-01 22:29:09 +03:00
drive0 (NODE_NAME): json:{"backing": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/t.qcow2.base"}}, "driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/t.qcow2"}} (qcow2)
2016-01-04 08:29:20 +03:00
Removable device: not locked, tray closed
2015-05-08 19:03:15 +03:00
Cache mode: writeback, ignore flushes
Backing file: TEST_DIR/t.qcow2.base (chain depth: 1)
2017-04-13 20:19:51 +03:00
(qemu) info block file
2015-05-08 19:03:15 +03:00
file: TEST_DIR/t.qcow2 (file)
Cache mode: writeback, ignore flushes
2017-04-13 20:19:51 +03:00
(qemu) info block backing
2015-05-08 19:03:15 +03:00
backing: TEST_DIR/t.qcow2.base (qcow2, read-only)
Cache mode: writeback, ignore flushes
2017-04-13 20:19:51 +03:00
(qemu) info block backing-file
2015-05-08 19:03:15 +03:00
backing-file: TEST_DIR/t.qcow2.base (file, read-only)
Cache mode: writeback, ignore flushes
2017-04-13 20:19:51 +03:00
(qemu) quit
2015-05-08 19:03:15 +03:00
2016-04-05 12:21:44 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,cache=invalid_value,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,cache=invalid_value,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0: invalid cache option
2015-05-08 19:03:15 +03:00
2013-04-09 15:19:18 +04:00
=== Specifying the protocol layer ===
Testing: -drive file=TEST_DIR/t.qcow2,file.driver=file
2013-11-14 18:24:58 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-04-09 15:19:18 +04:00
2013-07-10 17:47:39 +04:00
2014-02-03 17:49:42 +04:00
=== Leaving out required options ===
Testing: -drive driver=file
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive driver=file: The 'file' block driver requires a file name
2014-02-03 17:49:42 +04:00
2017-04-13 19:06:25 +03:00
Testing: -drive driver=file,filename=
QEMU_PROG: -drive driver=file,filename=: The 'file' block driver requires a file name
2014-02-03 17:49:42 +04:00
Testing: -drive driver=nbd
2016-10-25 16:11:34 +03:00
QEMU_PROG: -drive driver=nbd: NBD server address missing
2014-02-03 17:49:42 +04:00
Testing: -drive driver=raw
2016-12-16 20:52:37 +03:00
QEMU_PROG: -drive driver=raw: A block device must be specified for "file"
2014-02-03 17:49:42 +04:00
Testing: -drive file.driver=file
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file.driver=file: The 'file' block driver requires a file name
2014-02-03 17:49:42 +04:00
Testing: -drive file.driver=nbd
2016-10-25 16:11:34 +03:00
QEMU_PROG: -drive file.driver=nbd: NBD server address missing
2014-02-03 17:49:42 +04:00
Testing: -drive file.driver=raw
2016-12-16 20:52:37 +03:00
QEMU_PROG: -drive file.driver=raw: A block device must be specified for "file"
2014-02-03 17:49:42 +04:00
Testing: -drive foo=bar
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive foo=bar: Must specify either driver or file
2014-02-03 17:49:42 +04:00
2014-09-18 13:48:34 +04:00
=== Specifying both an option and its legacy alias ===
Testing: -drive file=TEST_DIR/t.qcow2,iops=1234,throttling.iops-total=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops=1234,throttling.iops-total=5678: 'throttling.iops-total' and its alias 'iops' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,iops_rd=1234,throttling.iops-read=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_rd=1234,throttling.iops-read=5678: 'throttling.iops-read' and its alias 'iops_rd' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,iops_wr=1234,throttling.iops-write=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_wr=1234,throttling.iops-write=5678: 'throttling.iops-write' and its alias 'iops_wr' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,bps=1234,throttling.bps-total=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps=1234,throttling.bps-total=5678: 'throttling.bps-total' and its alias 'bps' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,bps_rd=1234,throttling.bps-read=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd=1234,throttling.bps-read=5678: 'throttling.bps-read' and its alias 'bps_rd' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,bps_wr=1234,throttling.bps-write=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_wr=1234,throttling.bps-write=5678: 'throttling.bps-write' and its alias 'bps_wr' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,iops_max=1234,throttling.iops-total-max=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_max=1234,throttling.iops-total-max=5678: 'throttling.iops-total-max' and its alias 'iops_max' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,iops_rd_max=1234,throttling.iops-read-max=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_rd_max=1234,throttling.iops-read-max=5678: 'throttling.iops-read-max' and its alias 'iops_rd_max' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,iops_wr_max=1234,throttling.iops-write-max=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_wr_max=1234,throttling.iops-write-max=5678: 'throttling.iops-write-max' and its alias 'iops_wr_max' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,bps_max=1234,throttling.bps-total-max=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_max=1234,throttling.bps-total-max=5678: 'throttling.bps-total-max' and its alias 'bps_max' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,bps_rd_max=1234,throttling.bps-read-max=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd_max=1234,throttling.bps-read-max=5678: 'throttling.bps-read-max' and its alias 'bps_rd_max' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,bps_wr_max=1234,throttling.bps-write-max=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_wr_max=1234,throttling.bps-write-max=5678: 'throttling.bps-write-max' and its alias 'bps_wr_max' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,iops_size=1234,throttling.iops-size=5678
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_size=1234,throttling.iops-size=5678: 'throttling.iops-size' and its alias 'iops_size' can't be used at the same time
Testing: -drive file=TEST_DIR/t.qcow2,readonly=on,read-only=off
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,readonly=on,read-only=off: 'read-only' and its alias 'readonly' can't be used at the same time
2016-01-20 07:21:21 +03:00
=== Catching negative/large throttling values ===
Testing: -drive file=TEST_DIR/t.qcow2,iops=-1
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops=-1: bps/iops/max values must be within [0, 1000000000000000]
Testing: -drive file=TEST_DIR/t.qcow2,bps=-2
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps=-2: bps/iops/max values must be within [0, 1000000000000000]
Testing: -drive file=TEST_DIR/t.qcow2,bps_rd=-3
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd=-3: bps/iops/max values must be within [0, 1000000000000000]
Testing: -drive file=TEST_DIR/t.qcow2,bps_rd_max=-3
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd_max=-3: bps/iops/max values must be within [0, 1000000000000000]
Testing: -drive file=TEST_DIR/t.qcow2,throttling.iops-total=-4
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,throttling.iops-total=-4: bps/iops/max values must be within [0, 1000000000000000]
Testing: -drive file=TEST_DIR/t.qcow2,throttling.bps-total=-5
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,throttling.bps-total=-5: bps/iops/max values must be within [0, 1000000000000000]
Testing: -drive file=TEST_DIR/t.qcow2,bps=0
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2016-01-20 07:21:21 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,bps=1
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2016-01-20 07:21:21 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,bps=1000000000000000
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2016-01-20 07:21:21 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,bps=1000000000000001
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps=1000000000000001: bps/iops/max values must be within [0, 1000000000000000]
Testing: -drive file=TEST_DIR/t.qcow2,bps=9999999999999999
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps=9999999999999999: bps/iops/max values must be within [0, 1000000000000000]
2013-07-10 17:47:39 +04:00
=== Parsing protocol from file name ===
Testing: -hda foo:bar
2015-02-05 21:58:14 +03:00
QEMU_PROG: -hda foo:bar: Unknown protocol 'foo'
2013-07-10 17:47:39 +04:00
Testing: -drive file=foo:bar
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file=foo:bar: Unknown protocol 'foo'
2013-07-10 17:47:39 +04:00
Testing: -drive file.filename=foo:bar
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file.filename=foo:bar: Could not open 'foo:bar': No such file or directory
2013-07-10 17:47:39 +04:00
2014-04-03 14:45:51 +04:00
Testing: -hda file:TEST_DIR/t.qcow2
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2014-04-03 14:45:51 +04:00
Testing: -drive file=file:TEST_DIR/t.qcow2
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) quit
2014-04-03 14:45:51 +04:00
Testing: -drive file.filename=file:TEST_DIR/t.qcow2
2015-02-05 21:58:14 +03:00
QEMU_PROG: -drive file.filename=file:TEST_DIR/t.qcow2: Could not open 'file:TEST_DIR/t.qcow2': No such file or directory
2014-04-03 14:45:51 +04:00
2013-11-15 20:00:41 +04:00
=== Snapshot mode ===
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2015-12-03 13:01:30 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=drive0 -snapshot
2013-11-15 20:00:41 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x22 0 4k"
2013-11-15 20:00:41 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-11-15 20:00:41 +04:00
2015-12-03 13:01:30 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on,if=none,id=drive0
2013-11-15 20:00:41 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x22 0 4k"
2013-11-15 20:00:41 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-11-15 20:00:41 +04:00
2015-12-03 13:01:30 +03:00
Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2,snapshot=on,if=none,id=drive0
2013-11-15 20:00:41 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x22 0 4k"
2013-11-15 20:00:41 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-11-15 20:00:41 +04:00
2015-12-03 13:01:30 +03:00
Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2,if=none,id=drive0 -snapshot
2013-11-15 20:00:41 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x22 0 4k"
2014-04-03 14:09:34 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) quit
2014-04-03 14:09:34 +04:00
2015-12-03 13:01:30 +03:00
Testing: -drive file=file:TEST_DIR/t.qcow2,if=none,id=drive0 -snapshot
2014-04-03 14:09:34 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x22 0 4k"
2014-04-03 14:09:34 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) quit
2014-04-03 14:09:34 +04:00
2015-12-03 13:01:30 +03:00
Testing: -drive file=file:TEST_DIR/t.qcow2,snapshot=on,if=none,id=drive0
2014-04-03 14:09:34 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x22 0 4k"
2014-04-03 14:09:34 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) quit
2014-04-03 14:09:34 +04:00
2015-12-03 13:01:30 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=drive0 -snapshot
2014-04-03 14:09:34 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x22 0 4k"
2014-04-03 14:09:34 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) quit
2014-04-03 14:09:34 +04:00
2015-12-03 13:01:30 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on,if=none,id=drive0
2014-04-03 14:09:34 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x22 0 4k"
2013-11-15 20:00:41 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-11-15 20:00:41 +04:00
read 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2015-12-03 13:01:30 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=off,if=none,id=drive0
2013-11-15 20:00:41 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x22 0 4k"
2013-11-15 20:00:41 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) quit
2013-11-15 20:00:41 +04:00
2014-05-06 14:11:42 +04:00
read 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2015-12-03 13:01:30 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on,if=none,id=drive0
2014-05-06 14:11:42 +04:00
QEMU X.Y.Z monitor - type 'help' for more information
2017-04-13 20:19:51 +03:00
(qemu) qemu-io drive0 "write -P 0x33 0 4k"
2014-05-06 14:11:42 +04:00
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2017-04-13 20:19:51 +03:00
(qemu) commit drive0
(qemu) quit
2014-05-06 14:11:42 +04:00
2013-11-15 20:00:41 +04:00
read 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
2018-09-10 12:29:23 +03:00
Testing: -drive driver=null-co,snapshot=on
QEMU_PROG: -drive driver=null-co,snapshot=on: Could not get temporary filename: No such file or directory
2019-03-11 18:13:16 +03:00
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on,read-only=on,if=none,id=drive0
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) info block
drive0 (NODE_NAME): json:{"backing": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/t.qcow2"}}, "driver": "qcow2", "file": {"driver": "file", "filename": SNAPSHOT_PATH}} (qcow2, read-only)
Removable device: not locked, tray closed
Cache mode: writeback, ignore flushes
Backing file: TEST_DIR/t.qcow2 (chain depth: 1)
(qemu) quit
2013-04-09 17:56:13 +04:00
*** done