Re: [Qemu-block] [PATCH 2/3] iotests: use -ccw on s390x for 051

2017-09-08 Thread Kevin Wolf
Am 08.09.2017 um 13:24 hat Cornelia Huck geschrieben:
> On Fri, 8 Sep 2017 13:04:25 +0200
> Kevin Wolf  wrote:
> 
> > Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
> > > The default cpu model on s390x does not provide zPCI, which is
> > > not yet wired up on tcg. Moreover, virtio-ccw is the standard
> > > on s390x, so use the -ccw instead of the -pci versions of virtio
> > > devices on s390x.
> > > 
> > > Provide an output file for s390x.
> > > 
> > > Signed-off-by: Cornelia Huck 
> > > ---
> > >  tests/qemu-iotests/051 |   9 +-
> > >  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 
> > > +
> > >  2 files changed, 442 insertions(+), 1 deletion(-)
> > >  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out  
> > 
> > It's already a pain to have two separate output files for 051, let's try
> > to avoid adding a third one. Even more so since I think that the split
> > between 051.out and 051.pc.out was already made for s390, so I'm not
> > sure if anyone would actually still make use of the plain 051.out
> > output if s390 got it's own one.
> 
> Are there no non-pc and non-s390 machines for which this is run?

Who knows? But I'm not aware of anyone who is interested in something
else and has contributed to the test cases until now.

> > > diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
> > > index c8cfc764bc..f6ad0f4f0b 100755
> > > --- a/tests/qemu-iotests/051
> > > +++ b/tests/qemu-iotests/051
> > > @@ -103,7 +103,14 @@ echo
> > >  echo === Device without drive ===
> > >  echo
> > >  
> > > -run_qemu -device virtio-scsi-pci -device scsi-hd
> > > +case "$QEMU_DEFAULT_MACHINE" in
> > > +  s390-ccw-virtio)
> > > +  run_qemu -device virtio-scsi-ccw -device scsi-hd
> > > +  ;;
> > > +  *)
> > > +  run_qemu -device virtio-scsi-pci -device scsi-hd
> > > +  ;;
> > > +esac  
> > 
> > The only real difference between 051.out and 051.s390-ccw-virtio.out is
> > in this one command line. So if we don't want to just skip this part of
> > the test for non-pc like we already skip ther parts, 
> 
> I don't think there's a reason to skip this: The only difference is
> that we (currently) don't have a by-default usable virtio-pci
> implementation on s390 - but any virtio transport should do.

Well, any SCSI controller should do, really. Or in fact, any block
device that doesn't have removable media.

I agree that there's no real reason to skip the test for s390. On the
other hand, testing it on s390 doesn't really contribute anything to the
test coverage as long as the suite is run for PC, too (because there is
nothing machine dependent in the tested code path), so not running it
would be tolerable.

> Another approach would be to drop the -pci postfix, but I don't want to
> introduce more usage of aliases.

Maybe that would indeed be the easiest way. As long as we don't intend
to remove the alias from qemu, there's no reason not to use it in tests.

> > we generally solve
> > this kind of thing by just filtering out strings that differ between
> > setups.
> > 
> > For example:
> > 
> > case "$QEMU_DEFAULT_MACHINE" in
> >   s390-ccw-virtio)
> >   virtio_scsi=virtio-scsi-ccw
> >   ;;
> >   *)
> >   virtio_scsi=virtio-scsi-pci
> >   ;;
> > esac
> > 
> > run_qemu -device $virtio_scsi -device scsi-hd |
> > sed -e "s/$virtio_scsi/VIRTIO-SCSI/"
> 
> Yes, I can try this.

Kevin



Re: [Qemu-block] [PATCH 2/3] iotests: use -ccw on s390x for 051

2017-09-08 Thread Cornelia Huck
On Fri, 8 Sep 2017 13:04:25 +0200
Kevin Wolf  wrote:

> Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
> > The default cpu model on s390x does not provide zPCI, which is
> > not yet wired up on tcg. Moreover, virtio-ccw is the standard
> > on s390x, so use the -ccw instead of the -pci versions of virtio
> > devices on s390x.
> > 
> > Provide an output file for s390x.
> > 
> > Signed-off-by: Cornelia Huck 
> > ---
> >  tests/qemu-iotests/051 |   9 +-
> >  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 
> > +
> >  2 files changed, 442 insertions(+), 1 deletion(-)
> >  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out  
> 
> It's already a pain to have two separate output files for 051, let's try
> to avoid adding a third one. Even more so since I think that the split
> between 051.out and 051.pc.out was already made for s390, so I'm not
> sure if anyone would actually still make use of the plain 051.out
> output if s390 got it's own one.

Are there no non-pc and non-s390 machines for which this is run?

> 
> > diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
> > index c8cfc764bc..f6ad0f4f0b 100755
> > --- a/tests/qemu-iotests/051
> > +++ b/tests/qemu-iotests/051
> > @@ -103,7 +103,14 @@ echo
> >  echo === Device without drive ===
> >  echo
> >  
> > -run_qemu -device virtio-scsi-pci -device scsi-hd
> > +case "$QEMU_DEFAULT_MACHINE" in
> > +  s390-ccw-virtio)
> > +  run_qemu -device virtio-scsi-ccw -device scsi-hd
> > +  ;;
> > +  *)
> > +  run_qemu -device virtio-scsi-pci -device scsi-hd
> > +  ;;
> > +esac  
> 
> The only real difference between 051.out and 051.s390-ccw-virtio.out is
> in this one command line. So if we don't want to just skip this part of
> the test for non-pc like we already skip ther parts, 

I don't think there's a reason to skip this: The only difference is
that we (currently) don't have a by-default usable virtio-pci
implementation on s390 - but any virtio transport should do.

Another approach would be to drop the -pci postfix, but I don't want to
introduce more usage of aliases.

> we generally solve
> this kind of thing by just filtering out strings that differ between
> setups.
> 
> For example:
> 
> case "$QEMU_DEFAULT_MACHINE" in
>   s390-ccw-virtio)
>   virtio_scsi=virtio-scsi-ccw
>   ;;
>   *)
>   virtio_scsi=virtio-scsi-pci
>   ;;
> esac
> 
> run_qemu -device $virtio_scsi -device scsi-hd |
> sed -e "s/$virtio_scsi/VIRTIO-SCSI/"

Yes, I can try this.



Re: [Qemu-block] [PATCH 2/3] iotests: use -ccw on s390x for 051

2017-09-08 Thread Kevin Wolf
Am 05.09.2017 um 17:16 hat Cornelia Huck geschrieben:
> The default cpu model on s390x does not provide zPCI, which is
> not yet wired up on tcg. Moreover, virtio-ccw is the standard
> on s390x, so use the -ccw instead of the -pci versions of virtio
> devices on s390x.
> 
> Provide an output file for s390x.
> 
> Signed-off-by: Cornelia Huck 
> ---
>  tests/qemu-iotests/051 |   9 +-
>  tests/qemu-iotests/051.s390-ccw-virtio.out | 434 
> +
>  2 files changed, 442 insertions(+), 1 deletion(-)
>  create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out

It's already a pain to have two separate output files for 051, let's try
to avoid adding a third one. Even more so since I think that the split
between 051.out and 051.pc.out was already made for s390, so I'm not
sure if anyone would actually still make use of the plain 051.out
output if s390 got it's own one.

> diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
> index c8cfc764bc..f6ad0f4f0b 100755
> --- a/tests/qemu-iotests/051
> +++ b/tests/qemu-iotests/051
> @@ -103,7 +103,14 @@ echo
>  echo === Device without drive ===
>  echo
>  
> -run_qemu -device virtio-scsi-pci -device scsi-hd
> +case "$QEMU_DEFAULT_MACHINE" in
> +  s390-ccw-virtio)
> +  run_qemu -device virtio-scsi-ccw -device scsi-hd
> +  ;;
> +  *)
> +  run_qemu -device virtio-scsi-pci -device scsi-hd
> +  ;;
> +esac

The only real difference between 051.out and 051.s390-ccw-virtio.out is
in this one command line. So if we don't want to just skip this part of
the test for non-pc like we already skip ther parts, we generally solve
this kind of thing by just filtering out strings that differ between
setups.

For example:

case "$QEMU_DEFAULT_MACHINE" in
  s390-ccw-virtio)
  virtio_scsi=virtio-scsi-ccw
  ;;
  *)
  virtio_scsi=virtio-scsi-pci
  ;;
esac

run_qemu -device $virtio_scsi -device scsi-hd |
sed -e "s/$virtio_scsi/VIRTIO-SCSI/"

Kevin



[Qemu-block] [PATCH 2/3] iotests: use -ccw on s390x for 051

2017-09-05 Thread Cornelia Huck
The default cpu model on s390x does not provide zPCI, which is
not yet wired up on tcg. Moreover, virtio-ccw is the standard
on s390x, so use the -ccw instead of the -pci versions of virtio
devices on s390x.

Provide an output file for s390x.

Signed-off-by: Cornelia Huck 
---
 tests/qemu-iotests/051 |   9 +-
 tests/qemu-iotests/051.s390-ccw-virtio.out | 434 +
 2 files changed, 442 insertions(+), 1 deletion(-)
 create mode 100644 tests/qemu-iotests/051.s390-ccw-virtio.out

diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index c8cfc764bc..f6ad0f4f0b 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -103,7 +103,14 @@ echo
 echo === Device without drive ===
 echo
 
-run_qemu -device virtio-scsi-pci -device scsi-hd
+case "$QEMU_DEFAULT_MACHINE" in
+  s390-ccw-virtio)
+  run_qemu -device virtio-scsi-ccw -device scsi-hd
+  ;;
+  *)
+  run_qemu -device virtio-scsi-pci -device scsi-hd
+  ;;
+esac
 
 echo
 echo === Overriding backing file ===
diff --git a/tests/qemu-iotests/051.s390-ccw-virtio.out 
b/tests/qemu-iotests/051.s390-ccw-virtio.out
new file mode 100644
index 00..7555f0b73e
--- /dev/null
+++ b/tests/qemu-iotests/051.s390-ccw-virtio.out
@@ -0,0 +1,434 @@
+QA output created by 051
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 
backing_file=TEST_DIR/t.IMGFMT.base
+
+=== Unknown option ===
+
+Testing: -drive 
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=,if=none,id=drive0
+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'
+
+Testing: -drive 
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on,if=none,id=drive0
+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'
+
+Testing: -drive 
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234,if=none,id=drive0
+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'
+
+Testing: -drive 
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo,if=none,id=drive0
+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'
+
+
+=== Unknown protocol option ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=: Block 
protocol 'file' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on: 
Block protocol 'file' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234: 
Block protocol 'file' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo: 
Block protocol 'file' doesn't support the option 'unknown_opt'
+
+
+=== Invalid format ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=foo: Unknown driver 'foo'
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: Unknown driver 'foo'
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2: Cannot 
specify both 'driver' and 'format'
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot 
specify both 'driver' and 'format'
+
+
+=== Device without drive ===
+
+Testing: -device virtio-scsi-ccw -device scsi-hd
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-hd: drive property not set
+
+
+=== Overriding backing file ===
+
+Testing: -drive 
file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig,if=none,id=drive0
 -nodefaults
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) info block
+drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
+Removable device: not locked, tray closed
+Cache mode:   writeback
+Backing file: TEST_DIR/t.qcow2.orig (chain depth: 1)
+(qemu) quit
+
+Testing: -drive 
file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive 
file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig: 
Driver doesn't support backing files
+
+Testing: -drive 
file=TEST_DIR/t.qcow2,file.backing.driver=file,file.backing.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive 
file=TEST_DIR/t.qcow2