mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-18 15:42:09 -06:00
Block layer patches
-----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJaw6JlAAoJEH8JsnLIjy/W8JcP/06bxQ+8056Vz/+oRAm3VEZN iFJ1w+A1cFVpaqeE1fl+nfluyT+bU4J8YIyeHQlgckFyzQz13v0cSSSpBJYfJAO9 XSO/g96kILwN+h16NNdKX2K7uewVPZgyDbNf+FzM2UHuSSXdSp0ZbeW1yXvB6cpx hk2exA0Vfxm2dq2Xzz00EzGCWdZAnWWesj9pimASQ1W0426t7PJRCrRaUVawaJfT J+IB4zsF4BJ49CvqmeFqyPfDV9q1GF3c9EkXzFgw7qYY2C4F4bAKv82AxWiKEiRI cm1bHEdVyDFuBxzMuGOhZS3g2YkJDnEbkfJ0zj5cKmmYO2Pc0q8DeAMZTvy3aobL R5UawZTgPv2O71hOlRFl/YZwMjhb80BXDq9mx7TrrhQ5/wCAUOs4e1XYHn+kzL3W ohp5r74Qj1s84pGi8sPaXWm8myxalkTicT1cKFHztb+3+DwVPQIOXhMkMqrJyAK8 3GwZsGmtzI5DCIyF3whLbElN/OHRM9zr/T+uwhRQw8bs/XYPU27f367Y+JJGAaZq xTD7vlF49XSOoSDTYcvJfODlloJODyL+CxFS/vpJKfMYgDWYQZiwvYeIEywmwIYE 2bEdgcN/9BOdYK4NRuJzDY+Vra7iVnDvXhsZ8UClp/SPLspJ54zwCny9f5rSIDJF NSiBcahA5femreYqAfWz =quyk -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging Block layer patches # gpg: Signature made Tue 03 Apr 2018 16:48:53 BST # gpg: using RSA key 7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: iotests: Test abnormally large size in compressed cluster descriptor qemu-iotests: Use ppc64 qemu_arch on ppc64le host iotests: Test preallocated truncate of 2G image block/file-posix: Fix fully preallocated truncate iotests: fix 208 for luks format iotests: Update 186 after commitac64273c66
iotests: Update 051 and 186 after commit1454509726
block: handle invalid lseek returns gracefully gluster: Fix blockdev-add with server.N.type=unix Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
fd69ad866b
12 changed files with 167 additions and 88 deletions
|
@ -1701,6 +1701,7 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc,
|
||||||
case PREALLOC_MODE_FULL:
|
case PREALLOC_MODE_FULL:
|
||||||
{
|
{
|
||||||
int64_t num = 0, left = offset - current_length;
|
int64_t num = 0, left = offset - current_length;
|
||||||
|
off_t seek_result;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Knowing the final size from the beginning could allow the file
|
* Knowing the final size from the beginning could allow the file
|
||||||
|
@ -1715,8 +1716,8 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc,
|
||||||
|
|
||||||
buf = g_malloc0(65536);
|
buf = g_malloc0(65536);
|
||||||
|
|
||||||
result = lseek(fd, current_length, SEEK_SET);
|
seek_result = lseek(fd, current_length, SEEK_SET);
|
||||||
if (result < 0) {
|
if (seek_result < 0) {
|
||||||
result = -errno;
|
result = -errno;
|
||||||
error_setg_errno(errp, -result,
|
error_setg_errno(errp, -result,
|
||||||
"Failed to seek to the old end of file");
|
"Failed to seek to the old end of file");
|
||||||
|
@ -2114,7 +2115,12 @@ static int find_allocation(BlockDriverState *bs, off_t start,
|
||||||
if (offs < 0) {
|
if (offs < 0) {
|
||||||
return -errno; /* D3 or D4 */
|
return -errno; /* D3 or D4 */
|
||||||
}
|
}
|
||||||
assert(offs >= start);
|
|
||||||
|
if (offs < start) {
|
||||||
|
/* This is not a valid return by lseek(). We are safe to just return
|
||||||
|
* -EIO in this case, and we'll treat it like D4. */
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
if (offs > start) {
|
if (offs > start) {
|
||||||
/* D2: in hole, next data at offs */
|
/* D2: in hole, next data at offs */
|
||||||
|
@ -2146,7 +2152,12 @@ static int find_allocation(BlockDriverState *bs, off_t start,
|
||||||
if (offs < 0) {
|
if (offs < 0) {
|
||||||
return -errno; /* D1 and (H3 or H4) */
|
return -errno; /* D1 and (H3 or H4) */
|
||||||
}
|
}
|
||||||
assert(offs >= start);
|
|
||||||
|
if (offs < start) {
|
||||||
|
/* This is not a valid return by lseek(). We are safe to just return
|
||||||
|
* -EIO in this case, and we'll treat it like H4. */
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
if (offs > start) {
|
if (offs > start) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -117,20 +117,10 @@ Testing: -drive if=ide,media=cdrom
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
Testing: -drive if=scsi,media=cdrom
|
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
|
||||||
(qemu) QEMU_PROG: -drive if=scsi,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type
|
|
||||||
quit
|
|
||||||
|
|
||||||
Testing: -drive if=ide
|
Testing: -drive if=ide
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) QEMU_PROG: Initialization of device ide-hd failed: Device needs media, but drive is empty
|
(qemu) QEMU_PROG: Initialization of device ide-hd failed: Device needs media, but drive is empty
|
||||||
|
|
||||||
Testing: -drive if=scsi
|
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
|
||||||
(qemu) QEMU_PROG: -drive if=scsi: warning: bus=0,unit=0 is deprecated with this machine type
|
|
||||||
QEMU_PROG: -drive if=scsi: Device needs media, but drive is empty
|
|
||||||
|
|
||||||
Testing: -drive if=virtio
|
Testing: -drive if=virtio
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
|
(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
|
||||||
|
@ -170,20 +160,10 @@ Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on
|
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
|
||||||
(qemu) QEMU_PROG: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on: warning: bus=0,unit=0 is deprecated with this machine type
|
|
||||||
quit
|
|
||||||
|
|
||||||
Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
|
Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) QEMU_PROG: Initialization of device ide-hd failed: Block node is read-only
|
(qemu) QEMU_PROG: Initialization of device ide-hd failed: Block node is read-only
|
||||||
|
|
||||||
Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on
|
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
|
||||||
(qemu) QEMU_PROG: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on: warning: bus=0,unit=0 is deprecated with this machine type
|
|
||||||
quit
|
|
||||||
|
|
||||||
Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
|
Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
|
@ -86,6 +86,30 @@ for growth_mode in falloc full off; do
|
||||||
$QEMU_IMG resize -f "$IMGFMT" --shrink --preallocation=$growth_mode "$TEST_IMG" -${GROWTH_SIZE}K
|
$QEMU_IMG resize -f "$IMGFMT" --shrink --preallocation=$growth_mode "$TEST_IMG" -${GROWTH_SIZE}K
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo '=== Testing image growth on 2G empty image ==='
|
||||||
|
|
||||||
|
for growth_mode in falloc full; do
|
||||||
|
echo
|
||||||
|
echo "--- growth_mode=$growth_mode ---"
|
||||||
|
|
||||||
|
# Maybe we want to do an lseek() to the end of the file before the
|
||||||
|
# preallocation; if the file has a length of 2 GB, that would
|
||||||
|
# return an integer that overflows to negative when put into a
|
||||||
|
# plain int. We should use the correct type for the result, and
|
||||||
|
# this tests we do.
|
||||||
|
|
||||||
|
_make_test_img 2G
|
||||||
|
$QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" +${GROWTH_SIZE}K
|
||||||
|
|
||||||
|
actual_size=$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'disk size')
|
||||||
|
actual_size=$(echo "$actual_size" | sed -e 's/^[^0-9]*\([0-9]\+\).*$/\1/')
|
||||||
|
|
||||||
|
if [ $actual_size -lt $GROWTH_SIZE ]; then
|
||||||
|
echo "ERROR: Image should have at least ${GROWTH_SIZE}K, but has ${actual_size}K"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# success, all done
|
# success, all done
|
||||||
echo '*** done'
|
echo '*** done'
|
||||||
rm -f $seq.full
|
rm -f $seq.full
|
||||||
|
|
|
@ -47,4 +47,14 @@ qemu-img: Preallocation can only be used for growing images
|
||||||
|
|
||||||
--- growth_mode=off ---
|
--- growth_mode=off ---
|
||||||
Image resized.
|
Image resized.
|
||||||
|
|
||||||
|
=== Testing image growth on 2G empty image ===
|
||||||
|
|
||||||
|
--- growth_mode=falloc ---
|
||||||
|
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648
|
||||||
|
Image resized.
|
||||||
|
|
||||||
|
--- growth_mode=full ---
|
||||||
|
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648
|
||||||
|
Image resized.
|
||||||
*** done
|
*** done
|
||||||
|
|
|
@ -129,6 +129,53 @@ $QEMU_IO -c "read -P 0x44 1023k 1k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fil
|
||||||
$QEMU_IO -c "read -P 0 1024k 1022k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
$QEMU_IO -c "read -P 0 1024k 1022k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
||||||
|
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "=== Corrupted size field in compressed cluster descriptor ==="
|
||||||
|
echo
|
||||||
|
# Create an empty image and fill half of it with compressed data.
|
||||||
|
# The L2 entries of the two compressed clusters are located at
|
||||||
|
# 0x800000 and 0x800008, their original values are 0x4008000000a00000
|
||||||
|
# and 0x4008000000a00802 (5 sectors for compressed data each).
|
||||||
|
_make_test_img 8M -o cluster_size=2M
|
||||||
|
$QEMU_IO -c "write -c -P 0x11 0 2M" -c "write -c -P 0x11 2M 2M" "$TEST_IMG" \
|
||||||
|
2>&1 | _filter_qemu_io | _filter_testdir
|
||||||
|
|
||||||
|
# Reduce size of compressed data to 4 sectors: this corrupts the image.
|
||||||
|
poke_file "$TEST_IMG" $((0x800000)) "\x40\x06"
|
||||||
|
$QEMU_IO -c "read -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
||||||
|
|
||||||
|
# 'qemu-img check' however doesn't see anything wrong because it
|
||||||
|
# doesn't try to decompress the data and the refcounts are consistent.
|
||||||
|
# TODO: update qemu-img so this can be detected.
|
||||||
|
_check_test_img
|
||||||
|
|
||||||
|
# Increase size of compressed data to the maximum (8192 sectors).
|
||||||
|
# This makes QEMU read more data (8192 sectors instead of 5, host
|
||||||
|
# addresses [0xa00000, 0xdfffff]), but the decompression algorithm
|
||||||
|
# stops once we have enough to restore the uncompressed cluster, so
|
||||||
|
# the rest of the data is ignored.
|
||||||
|
poke_file "$TEST_IMG" $((0x800000)) "\x7f\xfe"
|
||||||
|
# Do it also for the second compressed cluster (L2 entry at 0x800008).
|
||||||
|
# In this case the compressed data would span 3 host clusters
|
||||||
|
# (host addresses: [0xa00802, 0xe00801])
|
||||||
|
poke_file "$TEST_IMG" $((0x800008)) "\x7f\xfe"
|
||||||
|
|
||||||
|
# Here the image is too small so we're asking QEMU to read beyond the
|
||||||
|
# end of the image.
|
||||||
|
$QEMU_IO -c "read -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
||||||
|
# But if we grow the image we won't be reading beyond its end anymore.
|
||||||
|
$QEMU_IO -c "write -P 0x22 4M 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
||||||
|
$QEMU_IO -c "read -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
||||||
|
|
||||||
|
# The refcount data is however wrong because due to the increased size
|
||||||
|
# of the compressed data it now reaches the following host clusters.
|
||||||
|
# This can be repaired by qemu-img check by increasing the refcount of
|
||||||
|
# those clusters.
|
||||||
|
# TODO: update qemu-img to correct the compressed cluster size instead.
|
||||||
|
_check_test_img -r all
|
||||||
|
$QEMU_IO -c "read -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
||||||
|
$QEMU_IO -c "read -P 0x22 4M 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "=== Full allocation with -S 0 ==="
|
echo "=== Full allocation with -S 0 ==="
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -99,6 +99,39 @@ read 1024/1024 bytes at offset 1047552
|
||||||
read 1046528/1046528 bytes at offset 1048576
|
read 1046528/1046528 bytes at offset 1048576
|
||||||
1022 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
1022 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||||
|
|
||||||
|
=== Corrupted size field in compressed cluster descriptor ===
|
||||||
|
|
||||||
|
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=8388608
|
||||||
|
wrote 2097152/2097152 bytes at offset 0
|
||||||
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||||
|
wrote 2097152/2097152 bytes at offset 2097152
|
||||||
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||||
|
read failed: Input/output error
|
||||||
|
No errors were found on the image.
|
||||||
|
read 4194304/4194304 bytes at offset 0
|
||||||
|
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||||
|
wrote 4194304/4194304 bytes at offset 4194304
|
||||||
|
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||||
|
read 4194304/4194304 bytes at offset 0
|
||||||
|
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||||
|
ERROR cluster 6 refcount=1 reference=3
|
||||||
|
ERROR cluster 7 refcount=1 reference=2
|
||||||
|
Repairing cluster 6 refcount=1 reference=3
|
||||||
|
Repairing cluster 7 refcount=1 reference=2
|
||||||
|
Repairing OFLAG_COPIED data cluster: l2_entry=8000000000c00000 refcount=3
|
||||||
|
Repairing OFLAG_COPIED data cluster: l2_entry=8000000000e00000 refcount=2
|
||||||
|
The following inconsistencies were found and repaired:
|
||||||
|
|
||||||
|
0 leaked clusters
|
||||||
|
4 corruptions
|
||||||
|
|
||||||
|
Double checking the fixed image now...
|
||||||
|
No errors were found on the image.
|
||||||
|
read 4194304/4194304 bytes at offset 0
|
||||||
|
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||||
|
read 4194304/4194304 bytes at offset 4194304
|
||||||
|
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||||
|
|
||||||
=== Full allocation with -S 0 ===
|
=== Full allocation with -S 0 ===
|
||||||
|
|
||||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
|
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
|
||||||
|
|
|
@ -64,7 +64,7 @@ function check_info_block()
|
||||||
{
|
{
|
||||||
echo "info block" |
|
echo "info block" |
|
||||||
do_run_qemu "$@" | _filter_win32 | _filter_hmp | _filter_qemu |
|
do_run_qemu "$@" | _filter_win32 | _filter_hmp | _filter_qemu |
|
||||||
_filter_generated_node_ids
|
_filter_generated_node_ids | _filter_qom_path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,10 +133,6 @@ check_info_block -drive if=ide,driver=null-co
|
||||||
check_info_block -drive if=ide,media=cdrom
|
check_info_block -drive if=ide,media=cdrom
|
||||||
check_info_block -drive if=ide,driver=null-co,media=cdrom
|
check_info_block -drive if=ide,driver=null-co,media=cdrom
|
||||||
|
|
||||||
check_info_block -drive if=scsi,driver=null-co
|
|
||||||
check_info_block -drive if=scsi,media=cdrom
|
|
||||||
check_info_block -drive if=scsi,driver=null-co,media=cdrom
|
|
||||||
|
|
||||||
check_info_block -drive if=virtio,driver=null-co
|
check_info_block -drive if=virtio,driver=null-co
|
||||||
|
|
||||||
check_info_block -drive if=pflash,driver=null-co,size=1M
|
check_info_block -drive if=pflash,driver=null-co,size=1M
|
||||||
|
|
|
@ -7,7 +7,7 @@ Testing: -device floppy
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
/machine/peripheral-anon/device[1]: [not inserted]
|
/machine/peripheral-anon/device[1]: [not inserted]
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ Testing: -device ide-cd
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
/machine/peripheral-anon/device[1]: [not inserted]
|
/machine/peripheral-anon/device[1]: [not inserted]
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ Testing: -device scsi-cd
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
/machine/peripheral-anon/device[1]: [not inserted]
|
/machine/peripheral-anon/device[1]: [not inserted]
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ Testing: -blockdev driver=null-co,node-name=null -device ide-hd,drive=null
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
null: null-co:// (null-co)
|
null: null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ Testing: -blockdev driver=null-co,node-name=null -device scsi-hd,drive=null
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
null: null-co:// (null-co)
|
null: null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ Testing: -blockdev driver=null-co,node-name=null -device virtio-blk-pci,drive=nu
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
null: null-co:// (null-co)
|
null: null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]/virtio-backend
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ Testing: -blockdev driver=null-co,node-name=null -device virtio-blk-pci,drive=nu
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
null: null-co:// (null-co)
|
null: null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral/qdev_id/virtio-backend
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ Testing: -blockdev driver=null-co,node-name=null -device floppy,drive=null
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
null: null-co:// (null-co)
|
null: null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
@ -124,7 +124,7 @@ Testing: -blockdev driver=null-co,node-name=null -device ide-cd,drive=null
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
null: null-co:// (null-co)
|
null: null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
@ -142,7 +142,7 @@ Testing: -blockdev driver=null-co,node-name=null -device scsi-cd,drive=null
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
null: null-co:// (null-co)
|
null: null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
@ -191,7 +191,7 @@ none0 (null): null-co:// (null-co)
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
|
|
||||||
null: null-co:// (null-co)
|
null: null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral/qdev_id/virtio-backend
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device ide-hd,drive=none0
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0 (null): null-co:// (null-co)
|
none0 (null): null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device scsi-hd,drive=none
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0 (null): null-co:// (null-co)
|
none0 (null): null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device virtio-blk-pci,dri
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0 (null): null-co:// (null-co)
|
none0 (null): null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]/virtio-backend
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device virtio-blk-pci,dri
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0 (null): null-co:// (null-co)
|
none0 (null): null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral/qdev_id/virtio-backend
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device floppy,drive=none0
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0 (null): null-co:// (null-co)
|
none0 (null): null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
@ -307,7 +307,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device ide-cd,drive=none0
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0 (null): null-co:// (null-co)
|
none0 (null): null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
@ -325,7 +325,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device scsi-cd,drive=none
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0 (null): null-co:// (null-co)
|
none0 (null): null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
@ -353,7 +353,7 @@ Testing: -drive if=none -device floppy,drive=none0
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0: [not inserted]
|
none0: [not inserted]
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ Testing: -drive if=none -device ide-cd,drive=none0
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0: [not inserted]
|
none0: [not inserted]
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ Testing: -drive if=none -device scsi-cd,drive=none0
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
none0: [not inserted]
|
none0: [not inserted]
|
||||||
Attached to: /machine/peripheral-anon/device[1]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ Testing: -drive if=floppy
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
floppy0: [not inserted]
|
floppy0: [not inserted]
|
||||||
Attached to: /machine/unattached/device[17]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ Testing: -drive if=floppy,driver=null-co
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
floppy0 (NODE_NAME): null-co:// (null-co)
|
floppy0 (NODE_NAME): null-co:// (null-co)
|
||||||
Attached to: /machine/unattached/device[17]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
@ -421,7 +421,7 @@ Testing: -drive if=ide,driver=null-co
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
ide0-hd0 (NODE_NAME): null-co:// (null-co)
|
ide0-hd0 (NODE_NAME): null-co:// (null-co)
|
||||||
Attached to: /machine/unattached/device[18]
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ Testing: -drive if=ide,media=cdrom
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
ide0-cd0: [not inserted]
|
ide0-cd0: [not inserted]
|
||||||
Attached to: /machine/unattached/device[18]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -437,35 +437,7 @@ Testing: -drive if=ide,driver=null-co,media=cdrom
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
ide0-cd0 (NODE_NAME): null-co:// (null-co, read-only)
|
ide0-cd0 (NODE_NAME): null-co:// (null-co, read-only)
|
||||||
Attached to: /machine/unattached/device[18]
|
Attached to: PATH
|
||||||
Removable device: not locked, tray closed
|
|
||||||
Cache mode: writeback
|
|
||||||
(qemu) quit
|
|
||||||
|
|
||||||
Testing: -drive if=scsi,driver=null-co
|
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
|
||||||
(qemu) QEMU_PROG: -drive if=scsi,driver=null-co: warning: bus=0,unit=0 is deprecated with this machine type
|
|
||||||
info block
|
|
||||||
scsi0-hd0 (NODE_NAME): null-co:// (null-co)
|
|
||||||
Attached to: /machine/unattached/device[27]/scsi.0/legacy[0]
|
|
||||||
Cache mode: writeback
|
|
||||||
(qemu) quit
|
|
||||||
|
|
||||||
Testing: -drive if=scsi,media=cdrom
|
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
|
||||||
(qemu) QEMU_PROG: -drive if=scsi,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type
|
|
||||||
info block
|
|
||||||
scsi0-cd0: [not inserted]
|
|
||||||
Attached to: /machine/unattached/device[27]/scsi.0/legacy[0]
|
|
||||||
Removable device: not locked, tray closed
|
|
||||||
(qemu) quit
|
|
||||||
|
|
||||||
Testing: -drive if=scsi,driver=null-co,media=cdrom
|
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
|
||||||
(qemu) QEMU_PROG: -drive if=scsi,driver=null-co,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type
|
|
||||||
info block
|
|
||||||
scsi0-cd0 (NODE_NAME): null-co:// (null-co, read-only)
|
|
||||||
Attached to: /machine/unattached/device[27]/scsi.0/legacy[0]
|
|
||||||
Removable device: not locked, tray closed
|
Removable device: not locked, tray closed
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
@ -474,7 +446,7 @@ Testing: -drive if=virtio,driver=null-co
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
virtio0 (NODE_NAME): null-co:// (null-co)
|
virtio0 (NODE_NAME): null-co:// (null-co)
|
||||||
Attached to: /machine/peripheral-anon/device[1]/virtio-backend
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
@ -482,7 +454,7 @@ Testing: -drive if=pflash,driver=null-co,size=1M
|
||||||
QEMU X.Y.Z monitor - type 'help' for more information
|
QEMU X.Y.Z monitor - type 'help' for more information
|
||||||
(qemu) info block
|
(qemu) info block
|
||||||
pflash0 (NODE_NAME): json:{"driver": "null-co", "size": "1M"} (null-co)
|
pflash0 (NODE_NAME): json:{"driver": "null-co", "size": "1M"} (null-co)
|
||||||
Attached to: /machine/unattached/device[2]
|
Attached to: PATH
|
||||||
Cache mode: writeback
|
Cache mode: writeback
|
||||||
(qemu) quit
|
(qemu) quit
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ with iotests.FilePath('disk.img') as disk_img_path, \
|
||||||
iotests.VM() as vm:
|
iotests.VM() as vm:
|
||||||
|
|
||||||
img_size = '10M'
|
img_size = '10M'
|
||||||
iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk_img_path, img_size)
|
iotests.qemu_img_create('-f', iotests.imgfmt, disk_img_path, img_size)
|
||||||
|
|
||||||
iotests.log('Launching VM...')
|
iotests.log('Launching VM...')
|
||||||
(vm.add_drive(disk_img_path, 'node-name=drive0-node', interface='none')
|
(vm.add_drive(disk_img_path, 'node-name=drive0-node', interface='none')
|
||||||
|
|
|
@ -538,8 +538,8 @@ if [ -z "$QEMU_PROG" ]
|
||||||
then
|
then
|
||||||
if [ -x "$build_iotests/qemu" ]; then
|
if [ -x "$build_iotests/qemu" ]; then
|
||||||
export QEMU_PROG="$build_iotests/qemu"
|
export QEMU_PROG="$build_iotests/qemu"
|
||||||
elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then
|
elif [ -x "$build_root/${qemu_arch}-softmmu/qemu-system-${qemu_arch}" ]; then
|
||||||
export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch"
|
export QEMU_PROG="$build_root/${qemu_arch}-softmmu/qemu-system-${qemu_arch}"
|
||||||
else
|
else
|
||||||
pushd "$build_root" > /dev/null
|
pushd "$build_root" > /dev/null
|
||||||
for binary in *-softmmu/qemu-system-*
|
for binary in *-softmmu/qemu-system-*
|
||||||
|
|
|
@ -23,6 +23,7 @@ PATH=".:$PATH"
|
||||||
|
|
||||||
HOSTOS=`uname -s`
|
HOSTOS=`uname -s`
|
||||||
arch=`uname -m`
|
arch=`uname -m`
|
||||||
|
[[ "$arch" =~ "ppc64" ]] && qemu_arch=ppc64 || qemu_arch="$arch"
|
||||||
|
|
||||||
export PWD=`pwd`
|
export PWD=`pwd`
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,11 @@ _filter_generated_node_ids()
|
||||||
sed -re 's/\#block[0-9]{3,}/NODE_NAME/'
|
sed -re 's/\#block[0-9]{3,}/NODE_NAME/'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_filter_qom_path()
|
||||||
|
{
|
||||||
|
sed -e 's#\(Attached to: *\) /.*#\1 PATH#'
|
||||||
|
}
|
||||||
|
|
||||||
# replace occurrences of the actual TEST_DIR value with TEST_DIR
|
# replace occurrences of the actual TEST_DIR value with TEST_DIR
|
||||||
_filter_testdir()
|
_filter_testdir()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue