Skip to contentSkip to conversation

qemu-iotests: fix 140 on s390x

PATCH Superseded Sascha Silbe 5 participants 15 messages Feb 9, 2016 – Feb 18, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover qemu-iotests: fix 140 on s390x

Yet another IDE-using test crept in (commit 16dee418). Fix it by using virtio-scsi. And to make this easier, provide cross-architecture aliases for all virtio devices.

Sascha Silbe (3):
qdev-monitor: sort alias table by typename
qdev-monitor: add missing aliases for virtio-{9p,balloon,rng,scsi}
qemu-iotests: 140: use virtio-scsi instead of IDE

 qdev-monitor.c         | 21 ++++++++++++++-------
 tests/qemu-iotests/140 |  4 ++--
 2 files changed, 16 insertions(+), 9 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/3 qdev-monitor: sort alias table by typename

Sort the alias table by typename so it's easier to see which aliases exist.

---
 qdev-monitor.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
qdev-monitor.c +7 -7
index 81e3ff3..0145deb 100644
@@ -40,18 +40,18 @@ typedef struct QDevAlias
 } QDevAlias;
 
 static const QDevAlias qdev_alias_table[] = {
-    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "e1000", "e1000-82540em" },
+    { "ich9-ahci", "ahci" },
+    { "kvm-pci-assign", "pci-assign" },
+    { "lsi53c895a", "lsi" },
     { "virtio-balloon-pci", "virtio-balloon",
             QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X },
+    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X },
+    { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X },
-    { "lsi53c895a", "lsi" },
-    { "ich9-ahci", "ahci" },
-    { "kvm-pci-assign", "pci-assign" },
-    { "e1000", "e1000-82540em" },
+    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { }
 };
 
Signature · 1 line
2.1.4
Reviewed-by on v1 1/3
#2 lore raw

Re: [Qemu-devel] [PATCH 1/3] qdev-monitor: sort alias table by typename

Quoted 28 lines · Sascha Silbe

Sort the alias table by typename so it's easier to see which aliases exist.

---
 qdev-monitor.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
qdev-monitor.c +5 -3
index 81e3ff3..0145deb 100644
@@ -40,18 +40,18 @@ typedef struct QDevAlias
 } QDevAlias;
 
 static const QDevAlias qdev_alias_table[] = {
-    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "e1000", "e1000-82540em" },
+    { "ich9-ahci", "ahci" },
+    { "kvm-pci-assign", "pci-assign" },
+    { "lsi53c895a", "lsi" },
     { "virtio-balloon-pci", "virtio-balloon",
             QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X },
+    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X },

qdev-monitor.c typedef struct QDevAlias · line 57

Quoted 10 lines
qdev-monitor.c +2 -4
+    { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X },
-    { "lsi53c895a", "lsi" },
-    { "ich9-ahci", "ahci" },
-    { "kvm-pci-assign", "pci-assign" },
-    { "e1000", "e1000-82540em" },
+    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { }
 };
 
Reviewed-by on v1 1/3
#3 lore raw

Re: [Qemu-devel] [PATCH 1/3] qdev-monitor: sort alias table by typename

In reply to Sascha Silbe
Quoted 13 lines · Sascha Silbe

Sort the alias table by typename so it's easier to see which aliases exist.

---
 qdev-monitor.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
qdev-monitor.c +0 -0
index 81e3ff3..0145deb 100644

qdev-monitor.c typedef struct QDevAlias · line 42

Quoted 3 lines
qdev-monitor.c +0 -0
@@ -40,18 +40,18 @@ typedef struct QDevAlias
 } QDevAlias;
 
 static const QDevAlias qdev_alias_table[] = {

Suggest to add

       /* Please keep this table sorted */
Quoted 11 lines
qdev-monitor.c +5 -3
-    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
-    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "e1000", "e1000-82540em" },
+    { "ich9-ahci", "ahci" },
+    { "kvm-pci-assign", "pci-assign" },
+    { "lsi53c895a", "lsi" },
     { "virtio-balloon-pci", "virtio-balloon",
             QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X },
+    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },

qdev-monitor.c typedef struct QDevAlias · line 56

Quoted 10 lines
qdev-monitor.c +2 -4
     { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X },
+    { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X },
-    { "lsi53c895a", "lsi" },
-    { "ich9-ahci", "ahci" },
-    { "kvm-pci-assign", "pci-assign" },
-    { "e1000", "e1000-82540em" },
+    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { }
 };
#4 lore raw

Re: [Qemu-devel] [PATCH 1/3] qdev-monitor: sort alias table by typename

Dear Markus,

Quoted 4 lines · Markus Armbruster
Quoted 2 lines · Sascha Silbe

Sort the alias table by typename so it's easier to see which aliases exist.

[...]
[qdev-monitor.c]

Quoted 4 lines

Suggest to add

       /* Please keep this table sorted */

Good idea. I've amended the following locally:

/* Please keep this table sorted by typename. */

Holding onto this patch for a few more days to give virtio devs a chance to decide on whether to add the full set right away.

Quoted 1 line

Thanks for the reviews!

Sascha

Signature · 3 lines
Softwareentwicklung Sascha Silbe, Niederhofenstraße 5/1, 71229 Leonberg
https://se-silbe.de/
USt-IdNr. DE281696641
#5 lore raw

PATCH 2/3 qdev-monitor: add missing aliases for virtio-{9p, balloon, rng, scsi}

In reply to Sascha Silbe

virtio-{blk,balloon,net,serial} are aliases for their actual, architecture-dependent implementations (*-ccw on s390x, *-pci on other architectures supporting virtio). This makes it a lot easier to craft qemu invocations that work on all supported architectures. Complete the set to cover all virtio devices that are implemented on all architectures supporting virtio.

For virtio-balloon, only the CCW implementation was missing.

---

This leaves out virtio-{gpu,input,input-hid,input-host,keyboard,mouse,tablet} because they're currently only implemented using PCI, so there's no immediate value in having them. It would nevertheless make sense to include them so they can get used already and will start to Just Work™ on s390x once a CCW implementation appears. I can post the corresponding patch if there's any interest.

---
 qdev-monitor.c | 7 +++++++
 1 file changed, 7 insertions(+)
qdev-monitor.c +7 -0
index 0145deb..9c4217c 100644
@@ -44,12 +44,19 @@ static const QDevAlias qdev_alias_table[] = {
     { "ich9-ahci", "ahci" },
     { "kvm-pci-assign", "pci-assign" },
     { "lsi53c895a", "lsi" },
+    { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X },
+    { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_S390X },
     { "virtio-balloon-pci", "virtio-balloon",
             QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X },
     { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X },
     { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_S390X },
+    { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_S390X },
+    { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X },
     { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { }
Signature · 1 line
2.1.4
Reviewed-by on v1 2/3
#6 lore raw

Re: [Qemu-devel] [PATCH 2/3] qdev-monitor: add missing aliases for virtio-{9p, balloon, rng, scsi}

Quoted 10 lines · Sascha Silbe

virtio-{blk,balloon,net,serial} are aliases for their actual, architecture-dependent implementations (*-ccw on s390x, *-pci on other architectures supporting virtio). This makes it a lot easier to craft qemu invocations that work on all supported architectures. Complete the set to cover all virtio devices that are implemented on all architectures supporting virtio.

For virtio-balloon, only the CCW implementation was missing.

Quoted 9 lines

---

This leaves out virtio-{gpu,input,input-hid,input-host,keyboard,mouse,tablet} because they're currently only implemented using PCI, so there's no immediate value in having them. It would nevertheless make sense to include them so they can get used already and will start to Just Work™ on s390x once a CCW implementation appears. I can post the corresponding patch if there's any interest.

I guess that's for the virtio people to decide. I'm cc'ing some.

Quoted 28 lines
---
 qdev-monitor.c | 7 +++++++
 1 file changed, 7 insertions(+)
qdev-monitor.c +7 -0
index 0145deb..9c4217c 100644
@@ -44,12 +44,19 @@ static const QDevAlias qdev_alias_table[] = {
     { "ich9-ahci", "ahci" },
     { "kvm-pci-assign", "pci-assign" },
     { "lsi53c895a", "lsi" },
+    { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X },
+    { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_S390X },
     { "virtio-balloon-pci", "virtio-balloon",
             QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X },
     { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X },
     { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_S390X },
+    { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
+    { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_S390X },
+    { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X },
     { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
     { }
#7 lore raw

Re: [Qemu-devel] [PATCH 2/3] qdev-monitor: add missing aliases for virtio-{9p, balloon, rng, scsi}

Quoted 11 lines · On Thu, 11 Feb 2016 10:01:35 +0100 Markus Armbruster <[email protected]> wrote:
Quoted 7 lines · Sascha Silbe

This leaves out virtio-{gpu,input,input-hid,input-host,keyboard,mouse,tablet} because they're currently only implemented using PCI, so there's no immediate value in having them. It would nevertheless make sense to include them so they can get used already and will start to Just Work™ on s390x once a CCW implementation appears. I can post the corresponding patch if there's any interest.

I guess that's for the virtio people to decide. I'm cc'ing some.

What would the error look like if one decided to use e.g. virtio-gpu on s390x? If the error is more specific (i.e. virtio-gpu-ccw does not exist vs. virtio-gpu does not exist), I think adding the aliases makes
sense: the user sees what is actually missing.

#8 lore raw

Re: [Qemu-devel] [PATCH 2/3] qdev-monitor: add missing aliases for virtio-{9p, balloon, rng, scsi}

Dear Conny,

Quoted 13 lines · Cornelia Huck
Quoted 10 lines · On Thu, 11 Feb 2016 10:01:35 +0100 Markus Armbruster <[email protected]> wrote:
Quoted 7 lines · Sascha Silbe

This leaves out virtio-{gpu,input,input-hid,input-host,keyboard,mouse,tablet} because they're currently only implemented using PCI, so there's no immediate value in having them. It would nevertheless make sense to include them so they can get used already and will start to Just Work™ on s390x once a CCW implementation appears. I can post the corresponding patch if there's any interest.

Quoted 6 lines
Quoted 1 line

I guess that's for the virtio people to decide. I'm cc'ing some.

What would the error look like if one decided to use e.g. virtio-gpu on s390x? If the error is more specific (i.e. virtio-gpu-ccw does not exist vs. virtio-gpu does not exist), I think adding the aliases makes
sense: the user sees what is actually missing.

Interesting point. Indeed, if we already define the matching -ccw aliases, the error message may be slightly more useful:

silbe@oc4731375738:~/recoverable/qemu$ s390x-softmmu/qemu-system-s390x -device virtio-gpu
qemu-system-s390x: -device virtio-gpu: 'virtio-gpu-ccw' is not a valid device model name

Though we should probably at least add a comment to the alias list mentioning that this is intentional. We might even want to adjust qdev_get_device_class() to print a more specific error message in this case.

Sascha

Signature · 3 lines
Softwareentwicklung Sascha Silbe, Niederhofenstraße 5/1, 71229 Leonberg
https://se-silbe.de/
USt-IdNr. DE281696641
#9 lore raw

Re: [Qemu-devel] [PATCH 2/3] qdev-monitor: add missing aliases for virtio-{9p, balloon, rng, scsi}

Quoted 7 lines · On Thu, 11 Feb 2016 17:18:32 +0100 Sascha Silbe <[email protected]>…
Quoted 5 lines · Cornelia Huck
Quoted 1 line · On Thu, 11 Feb 2016 10:01:35 +0100 Markus Armbruster <[email protected]> wrote:

Sascha Silbe <[email protected]> writes:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

This leaves out virtio-{gpu,input,input-hid,input-host,keyboard,mouse,tablet} because they're currently only implemented using PCI, so there's no immediate value in having them. It would nevertheless make sense to include them so they can get used already and will start to Just Work™ on s390x once a CCW implementation appears. I can post the corresponding patch if there's any interest.

[For laughs and giggles, I have wired up all of these devices for ccw. Excluding input-host (for which I did not have a suitable evdev), I can specify the various devices on the commandline and get some devices in the guest which do... nothing :) I won't pursue this further for now, as I currently don't have a convincing use case beyond "because we can".]

Quoted 11 lines
Quoted 7 lines
Quoted 2 lines

I guess that's for the virtio people to decide. I'm cc'ing some.

What would the error look like if one decided to use e.g. virtio-gpu on s390x? If the error is more specific (i.e. virtio-gpu-ccw does not exist vs. virtio-gpu does not exist), I think adding the aliases makes
sense: the user sees what is actually missing.

Interesting point. Indeed, if we already define the matching -ccw aliases, the error message may be slightly more useful:

Quoted 7 lines
silbe@oc4731375738:~/recoverable/qemu$ s390x-softmmu/qemu-system-s390x -device virtio-gpu
qemu-system-s390x: -device virtio-gpu: 'virtio-gpu-ccw' is not a valid device model name

Though we should probably at least add a comment to the alias list mentioning that this is intentional. We might even want to adjust qdev_get_device_class() to print a more specific error message in this case.

qemu-system-s390x: -device virtio-gpu: 'virtio-gpu' (alias 'virtio-gpu-ccw') is not a valid device model name

would make it obvious that some alias expansion had been going on. I think that would be useful.

#10 lore raw

Re: [Qemu-devel] [PATCH 2/3] qdev-monitor: add missing aliases for virtio-{9p, balloon, rng, scsi}

Dear Conny,

Cornelia Huck <[email protected]> writes:

[virtio-{gpu,input,input-hid,input-host,keyboard,mouse,tablet}]

Quoted 6 lines

[For laughs and giggles, I have wired up all of these devices for ccw. Excluding input-host (for which I did not have a suitable evdev), I can specify the various devices on the commandline and get some devices in the guest which do... nothing :) I won't pursue this further for now, as I currently don't have a convincing use case beyond "because we can".]

Care to share the patch?

Quoted 4 lines

qemu-system-s390x: -device virtio-gpu: 'virtio-gpu' (alias 'virtio-gpu-ccw') is not a valid device model name

would make it obvious that some alias expansion had been going on. I think that would be useful.

Good idea. Will include a patch for this in the next version.

Sascha

Signature · 3 lines
Softwareentwicklung Sascha Silbe, Niederhofenstraße 5/1, 71229 Leonberg
https://se-silbe.de/
USt-IdNr. DE281696641
#11 lore raw

PATCH 3/3 qemu-iotests: 140: use virtio-scsi instead of IDE

In reply to Sascha Silbe

IDE is only implemented by very few architectures (mostly PC). Use virtio-scsi instead so the test works on all architectures that support virtio. In particular, this fixes qemu-iotests on s390x.

Fixes 16dee418 ("iotests: Add test for eject under NBD server")
---
 tests/qemu-iotests/140 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/qemu-iotests/140 +2 -2
index f78c317..0c448e6 100755
@@ -49,8 +49,8 @@ _make_test_img 64k
 $QEMU_IO -c 'write -P 42 0 64k' "$TEST_IMG" | _filter_qemu_io
 
 keep_stderr=y \
-_launch_qemu -drive if=ide,media=cdrom,id=drv,file="$TEST_IMG",format=$IMGFMT \
-    2> >(_filter_nbd)
+_launch_qemu -drive if=none,media=cdrom,id=drv,file="$TEST_IMG",format=$IMGFMT \
+    -device virtio-scsi -device scsi-cd,drive=drv 2> >(_filter_nbd)
 
 _send_qemu_cmd $QEMU_HANDLE \
     "{ 'execute': 'qmp_capabilities' }" \
Signature · 1 line
2.1.4
#12 lore raw

Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: 140: use virtio-scsi instead of IDE

Quoted 15 lines · Sascha Silbe

IDE is only implemented by very few architectures (mostly PC). Use virtio-scsi instead so the test works on all architectures that support virtio. In particular, this fixes qemu-iotests on s390x.

Fixes 16dee418 ("iotests: Add test for eject under NBD server")
---
 tests/qemu-iotests/140 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/qemu-iotests/140 +0 -0
index f78c317..0c448e6 100755

tests/qemu-iotests/140 _make_test_img 64k · line 53

Quoted 7 lines
tests/qemu-iotests/140 +2 -2
@@ -49,8 +49,8 @@ _make_test_img 64k
 $QEMU_IO -c 'write -P 42 0 64k' "$TEST_IMG" | _filter_qemu_io
 
 keep_stderr=y \
-_launch_qemu -drive if=ide,media=cdrom,id=drv,file="$TEST_IMG",format=$IMGFMT \
-    2> >(_filter_nbd)
+_launch_qemu -drive if=none,media=cdrom,id=drv,file="$TEST_IMG",format=$IMGFMT \
+    -device virtio-scsi -device scsi-cd,drive=drv 2> >(_filter_nbd)

Why not just omit the device (and the media=cdrom along with it, keeping if=none)? This will change the reference output because there is no longer any tray to be moved, but this will still test what it's supposed to.

(This may sound hypocritical coming from me, because I wrote this test so I could have just done so in the first place; I guess I just didn't realize that 'eject' works on device-less drives, too.)

Max

Quoted 3 lines
tests/qemu-iotests/140 +0 -0
 _send_qemu_cmd $QEMU_HANDLE \
     "{ 'execute': 'qmp_capabilities' }" \
 
#13 lore raw

Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: 140: use virtio-scsi instead of IDE

Dear Max,

Max Reitz <[email protected]> writes:

[tests/qemu-iotests/140]

Quoted 9 lines

tests/qemu-iotests/140 _make_test_img 64k · line 53

Quoted 4 lines
tests/qemu-iotests/140 +2 -2
-_launch_qemu -drive if=ide,media=cdrom,id=drv,file="$TEST_IMG",format=$IMGFMT \
-    2> >(_filter_nbd)
+_launch_qemu -drive if=none,media=cdrom,id=drv,file="$TEST_IMG",format=$IMGFMT \
+    -device virtio-scsi -device scsi-cd,drive=drv 2> >(_filter_nbd)

Why not just omit the device (and the media=cdrom along with it, keeping if=none)? This will change the reference output because there is no longer any tray to be moved, but this will still test what it's supposed to.

Quoted 3 lines

(This may sound hypocritical coming from me, because I wrote this test so I could have just done so in the first place; I guess I just didn't realize that 'eject' works on device-less drives, too.)

Is this supposed to work? I.e. can we rely on it? If so, that would certainly be the easier route for this particular test. Test coverage should be unaffected as 139 already tests ejection (using virtio, unlike 118 which is PC-only).

The aliases patch has a value of its own, but that's a separate matter.

Sascha

Signature · 3 lines
Softwareentwicklung Sascha Silbe, Niederhofenstraße 5/1, 71229 Leonberg
https://se-silbe.de/
USt-IdNr. DE281696641
#14 lore raw

Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: 140: use virtio-scsi instead of IDE

Quoted 14 lines · Sascha Silbe

Dear Max,

Max Reitz <[email protected]> writes:

[tests/qemu-iotests/140]

Quoted 9 lines

tests/qemu-iotests/140 _make_test_img 64k · line 53

Quoted 4 lines
tests/qemu-iotests/140 +2 -2
-_launch_qemu -drive if=ide,media=cdrom,id=drv,file="$TEST_IMG",format=$IMGFMT \
-    2> >(_filter_nbd)
+_launch_qemu -drive if=none,media=cdrom,id=drv,file="$TEST_IMG",format=$IMGFMT \
+    -device virtio-scsi -device scsi-cd,drive=drv 2> >(_filter_nbd)

Why not just omit the device (and the media=cdrom along with it, keeping if=none)? This will change the reference output because there is no longer any tray to be moved, but this will still test what it's supposed to.

Quoted 5 lines
Quoted 3 lines

(This may sound hypocritical coming from me, because I wrote this test so I could have just done so in the first place; I guess I just didn't realize that 'eject' works on device-less drives, too.)

Is this supposed to work? I.e. can we rely on it?

Let's say I would rely on it. :-) (which is why I proposed it)

The test checks that ejecting a BlockDriverState tree from a BlockBackend (that is, a medium from a drive) works even if that BlockBackend is exposed via an NBD server. It doesn't really matter whether the drive has a device or not, the main thing is that the NBD server notices that the medium is ejected and automatically stops offering the drive.

So I would think that we are supposed to be able to rely on it; if we cannot, something else is probably broken.

Quoted 7 lines

If so, that would
certainly be the easier route for this particular test. Test coverage should be unaffected as 139 already tests ejection (using virtio, unlike 118 which is PC-only).

The aliases patch has a value of its own, but that's a separate matter.

Yes, certainly.

Max