aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/172.out
AgeCommit message (Collapse)AuthorFilesLines
2022-09-30block: add missed block_acct_setup with new block device init procedureDenis V. Lunev1-0/+76
Commit 5f76a7aac156ca75680dad5df4a385fd0b58f6b1 is looking harmless from the first glance, but it has changed things a lot. 'libvirt' uses it to detect that it should follow new initialization way and this changes things considerably. With this procedure followed, blockdev_init() is not called anymore and thus block_acct_setup() helper is not called. This means in particular that defaults for block accounting statistics are changed and account_invalid/account_failed are actually initialized as false instead of true originally. This commit changes things to match original world. There are the following constraints: * new default value in block_acct_init() is set to true * block_acct_setup() inside blockdev_init() is called before blkconf_apply_backend_options() * thus newly created option in block device properties has precedence if specified Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> CC: Peter Krempa <pkrempa@redhat.com> CC: Markus Armbruster <armbru@redhat.com> CC: John Snow <jsnow@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220824095044.166009-3-den@openvz.org> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2022-03-08hw/isa/isa-bus: Remove isabus_dev_print()Bernhard Beschow1-26/+0
All isabus_dev_print() did was to print up to two IRQ numbers per device. This is redundant if the IRQ numbers are present as QOM properties (see e.g. the modified tests/qemu-iotests/172.out). Now that the last devices relying on isabus_dev_print() had their IRQ numbers QOM'ified, the contribution of this function ultimately became redundant. Remove it. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220301220037.76555-5-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220307134353.1950-12-philippe.mathieu.daude@gmail.com> Reviewed-by: Bernhard Beschow <shentey@gmail.com>
2021-07-06block: Add backend_defaults propertyAkihiko Odaki1-0/+38
backend_defaults property allow users to control if default block properties should be decided with backend information. If it is off, any backend information will be discarded, which is suitable if you plan to perform live migration to a different disk backend. If it is on, a block device may utilize backend information more aggressively. By default, it is auto, which uses backend information for block sizes and ignores the others, which is consistent with the older versions. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-id: 20210705130458.97642-2-akihiko.odaki@gmail.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2021-03-19fdc: Drop deprecated floppy configurationMarkus Armbruster1-561/+1
Drop the crap deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20210309161214.1402527-3-armbru@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
2021-02-20hw/block/fdc: Remove the check_media_rate propertyThomas Huth1-35/+0
This was only required for the pc-1.0 and earlier machine types. Now that these have been removed, we can also drop the corresponding code from the FDC device. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Acked-by: John Snow <jsnow@redhat.com> Message-Id: <20210203171832.483176-3-thuth@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-12-18iotests:172: use _filter_qom_pathVladimir Sementsov-Ogievskiy1-76/+76
device[NUMBER] thing in QOM path is not stable and tracking it during code modifications is not fun. Let's filter it like it's already done in iotest 186. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20201216095205.526235-3-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2020-06-23qdev: Reject drive property overrideMarkus Armbruster1-85/+3
qdev_prop_set_drive() screws up when the property already has a non-null value: it neglects to release the old value. Both the old and the new backend become attached to the same device. Example (taken from iotest 172): -fda ... -drive if=none,... -global floppy.drive=none0. Special case: attempting to use the same backend both times fails. Example (also from iotest 172): -fda ... -global floppy.drive=floppy0. Yet another example: -device with multiple drive=... (but not device_add, which silently drops all but the last duplicate property). Perhaps drive property override could be made to work. Perhaps it should. I can't afford the time to figure this out now. What I can do is reject usage that leaves backends in unhealthy states. For what it's worth, we've long done the same for netdev properties. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200622094227.1271650-12-armbru@redhat.com>
2020-06-23fdc: Deprecate configuring floppies with -global isa-fdcMarkus Armbruster1-0/+30
Deprecate -global isa-fdc.driveA=... -global isa-fdc.driveB=... in favour of -device floppy,unit=0,drive=... -device floppy,unit=1,drive=... Same for the other floppy controller devices. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: John Snow <jsnow@redhat.com> Message-Id: <20200622094227.1271650-7-armbru@redhat.com>
2020-06-23fdc: Reject clash between -drive if=floppy and -global isa-fdcMarkus Armbruster1-115/+33
The floppy controller devices desugar their drive properties into floppy devices (since commit a92bd191a4 "fdc: Move qdev properties to FloppyDrive", v2.8.0). This involves some bad magic in fdctrl_connect_drives(), and exists for backward compatibility. The functions for boards to create floppy controller devices fdctrl_init_isa(), fdctrl_init_sysbus(), and sun4m_fdctrl_init() desugar -drive if=floppy to these floppy controller drive properties. If you use both -drive if=floppy (or its -fda / -fdb sugar) and -global isa-fdc for the same floppy device, -global silently loses the conflict, and both backends involved end up with the floppy device frontend attached, as demonstrated by iotest 172 (see commit before previous). This is wrong. Desugar -drive if=floppy straight to floppy devices instead, with helper fdctrl_init_drives(). The conflict now gets rejected cleanly: first, fdctrl_connect_drives() creates the floppy for the controller's property, then fdctrl_init_drives() attempts to create the floppy for -drive if=floppy, but fails because the unit is already in use. Output of iotest 172 changes in three ways: 1. The clash gets rejected. 2. In one test case, "info qtree" has the floppy devices swapped, and "info block" has their QOM paths swapped. This is because the floppy device for -fda now gets created after the one for -global isa-fdc.driveB. 3. The error message for -global floppy.drive=floppy0 changes. Before the patch, we set isa-fdc.driveA to -fda's block backend, then create the floppy device for it, then move the backend from isa-fdc.driveA to floppy.drive. Floppy creation fails when applying -global floppy.drive=floppy0, because floppy0 is still attached to isa-fdc. After the patch, we create the floppy for -fda, then set its drive property to floppy0. Now floppy creation succeeds, but setting the drive property fails, because -global already set it. Yes, this is exasperatingly complicated. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200622094227.1271650-5-armbru@redhat.com>
2020-06-23iotests/172: Cover -global floppy.drive=...Markus Armbruster1-0/+134
Use of -global to set a default backend for non-singleton devices is a bad idea. But as long as we permit it, we better test it. Test output demonstrates we screw up when -global floppy clashes with -fda or with -device floppy: according to "info qtree", only the latter backend is attached, but according to "info block", both are. Here's the clash with -device: Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global floppy.drive=none0 -device floppy,drive=none1,unit=0 dev: isa-fdc, id "" [...] driveA = "" driveB = "" [...] bus: floppy-bus.0 type floppy-bus dev: floppy, id "" unit = 0 (0x0) ---> drive = "none1" [...] none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) ---> Attached to: /machine/peripheral-anon/device[0] Cache mode: writeback none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) ---> Attached to: /machine/peripheral-anon/device[0] Removable device: not locked, tray closed Cache mode: writeback /machine/peripheral-anon/device[0] is the floppy created with -device. Test output further demonstrates the "Drive 'FOO' is already in use because it has been automatically connected to another device" error message can be misleading. With '-fda "" -global floppy.drive=floppy0', it's in use because -global reuses -fda's backend. There is no other device involved. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200622094227.1271650-4-armbru@redhat.com>
2020-06-23iotests/172: Cover empty filename and multiple use of drivesMarkus Armbruster1-0/+50
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200622094227.1271650-3-armbru@redhat.com>
2020-06-23iotests/172: Include "info block" in test outputMarkus Armbruster1-0/+486
The additional output demonstrates we screw up when -global isa-fdc clashes with -drive if=floppy or its sugared forms: according to "info qtree", only the latter backend is attached, but according to "info block", both are. For instance: Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -global isa-fdc.driveA=none0 dev: isa-fdc, id "" [...] driveA = "" driveB = "" [...] bus: floppy-bus.0 type floppy-bus dev: floppy, id "" unit = 0 (0x0) ---> drive = "floppy0" [...] floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) ---> Attached to: /machine/unattached/device[15] Removable device: not locked, tray closed Cache mode: writeback none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) ---> Attached to: /machine/unattached/device[14] Cache mode: writeback /machine/unattached/device[15] is floppy, and /machine/unattached/device[14] is isa-fdc. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200622094227.1271650-2-armbru@redhat.com>
2020-06-17qdev-properties: add getter for size32 and blocksizeRoman Kagan1-265/+265
Add getter for size32, and use it for blocksize, too. In its human-readable branch, it reports approximate size in human-readable units next to the exact byte value, like the getter for 64bit size does. Adjust the expected test output accordingly. Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200528225516.1676602-8-rvkagan@yandex-team.ru> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2020-06-17block: consolidate blocksize properties consistency checksRoman Kagan1-1/+1
Several block device properties related to blocksize configuration must be in certain relationship WRT each other: physical block must be no smaller than logical block; min_io_size, opt_io_size, and discard_granularity must be a multiple of a logical block. To ensure these requirements are met, add corresponding consistency checks to blkconf_blocksizes, adjusting its signature to communicate possible error to the caller. Also remove the now redundant consistency checks from the specific devices. Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paul Durrant <paul@xen.org> Message-Id: <20200528225516.1676602-3-rvkagan@yandex-team.ru> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-09-18hw/block/fdc: Convert to realizeMao Zhongyi1-8/+0
Convert floppy_drive_init() to realize and rename it to floppy_drive_realize(). Cc: John Snow <jsnow@redhat.com> Cc: Kevin Wolf <kwolf@redhat.com> Cc: Max Reitz <mreitz@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 87119b34f32e2acf7166165fb5d8e6fca787b3bc.1505737465.git.maozy.fnst@cn.fujitsu.com Signed-off-by: John Snow <jsnow@redhat.com>
2017-05-11iotests: 172: Use separate images for multiple devicesFam Zheng1-24/+26
To avoid image lock failures. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-02-28hw/block: Introduce share-rw qdev propertyKevin Wolf1-0/+53
By default, don't allow another writer for block devices that are attached to a guest device. For the cases where this setup is intended (e.g. using a cluster filesystem on the disk), the new option can be used to allow it. This change affects only devices using DEFINE_BLOCK_PROPERTIES(). Devices directly using DEFINE_PROP_DRIVE() still accept writers unconditionally. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Fam Zheng <famz@redhat.com>
2016-10-27qemu-iotests: Test creating floppy drivesKevin Wolf1-0/+1170
This tests the different supported methods to create floppy drives and how they interact. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-id: 1477386868-21826-5-git-send-email-kwolf@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>