Re: [libvirt] [PATCH REBASE 1/2] tests: Add some tests for PCI controller options

2018-02-12 Thread John Ferlan


On 02/12/2018 04:32 AM, Andrea Bolognani wrote:
> On Sun, 2018-02-11 at 08:12 -0500, John Ferlan wrote:
>> On 02/05/2018 11:08 AM, Andrea Bolognani wrote:
>>> The input configurations set all existing options for all PCI
>>> controllers, to see what ends up showing up in the output.
>>
>> Not quite sure I understand the need. The only capability not currently
>> used in some way is QEMU_CAPS_I440FX_PCI_HOLE64_SIZE.
> 
> The idea is that existing tests only cover valid PCI controller
> options being handled correctly, not what happens when you specify
> an option which is not relevant to the PCI controller at hand.
> 

Well I understood you're going for a put the stake in the ground in
order to supply that valid list of options for the pci controllers on
the related machines.

>> I guess there's nothing wrong with adding them other than test bloat.
>> Still there's nothing to "force" someone that adds some new thing to
>> update one of the three if some new option/capability is added.
> 
> That's correct. Can you think of a way to make sure that happens?
> 

and of course that got me to wondering if it was possible in any way to
have some way that the "i440fx" xml2{xml|argv} to know that it's
"covering" all it's known and supported relative options.  Secondarily
to know when someone adds something to a machine that won't support it
before they get to the point of actually running and things falling over
dead because of the wrong configuration provided.

Nothing sprang quickly to mind to try other than adding comments which
we all know are ignored anyway ;-0...

I'm not against this patch going in, but if someone has agita over a
small about of test bloat to list everything "currently" possible for a
machine type then they should speak up!

>> Ironically adding (for example) QEMU_CAPS_Q35_PCI_HOLE64_SIZE to
>> i440fx-* doesn't cause any failure. I didn't try other ones.
> 
> Of course it wouldn't: capabilities are a property of the QEMU
> binary, and the same QEMU binary is used to run both i440fx and
> q35 guests. Even for something entirely outlandish like adding a
> q35-specific capability to a pSeries test you shouldn't see any
> failure unless you actually attempt to use the QEMU feature the
> capability is tied to.
> 
>> I'm not opposed to this being added, but do you think we should add
>> something does the opposite check?   That the wrong PCI adapter on the
>> wrong machine?  The wrong option on the wrong adapter is a question for
>> the next patch though...
> 
> We should already have at least *some* coverage for that, eg.
> pseries-serial-invalid-machine and similar. I'm certainly not
> volunteering to go over all controller and device and machine
> types and write tests for all combinations :)
> 

We have something - good...

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH REBASE 1/2] tests: Add some tests for PCI controller options

2018-02-12 Thread Andrea Bolognani
On Sun, 2018-02-11 at 08:12 -0500, John Ferlan wrote:
> On 02/05/2018 11:08 AM, Andrea Bolognani wrote:
> > The input configurations set all existing options for all PCI
> > controllers, to see what ends up showing up in the output.
> 
> Not quite sure I understand the need. The only capability not currently
> used in some way is QEMU_CAPS_I440FX_PCI_HOLE64_SIZE.

The idea is that existing tests only cover valid PCI controller
options being handled correctly, not what happens when you specify
an option which is not relevant to the PCI controller at hand.

> I guess there's nothing wrong with adding them other than test bloat.
> Still there's nothing to "force" someone that adds some new thing to
> update one of the three if some new option/capability is added.

That's correct. Can you think of a way to make sure that happens?

> Ironically adding (for example) QEMU_CAPS_Q35_PCI_HOLE64_SIZE to
> i440fx-* doesn't cause any failure. I didn't try other ones.

Of course it wouldn't: capabilities are a property of the QEMU
binary, and the same QEMU binary is used to run both i440fx and
q35 guests. Even for something entirely outlandish like adding a
q35-specific capability to a pSeries test you shouldn't see any
failure unless you actually attempt to use the QEMU feature the
capability is tied to.

> I'm not opposed to this being added, but do you think we should add
> something does the opposite check?   That the wrong PCI adapter on the
> wrong machine?  The wrong option on the wrong adapter is a question for
> the next patch though...

We should already have at least *some* coverage for that, eg.
pseries-serial-invalid-machine and similar. I'm certainly not
volunteering to go over all controller and device and machine
types and write tests for all combinations :)

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH REBASE 1/2] tests: Add some tests for PCI controller options

2018-02-11 Thread John Ferlan


On 02/05/2018 11:08 AM, Andrea Bolognani wrote:
> The input configurations set all existing options for all PCI
> controllers, to see what ends up showing up in the output.
> 
> Signed-off-by: Andrea Bolognani 
> ---
>  .../i440fx-controllers-pciopts.args| 24 +++
>  .../i440fx-controllers-pciopts.xml | 36 ++
>  .../pseries-controllers-pciopts.args   | 22 +++
>  .../pseries-controllers-pciopts.xml| 35 ++
>  .../qemuxml2argvdata/q35-controllers-pciopts.args  | 28 
>  tests/qemuxml2argvdata/q35-controllers-pciopts.xml | 60 +
>  tests/qemuxml2argvtest.c   | 17 +
>  .../i440fx-controllers-pciopts.xml | 45 +
>  .../pseries-controllers-pciopts.xml| 43 
>  .../qemuxml2xmloutdata/q35-controllers-pciopts.xml | 76 
> ++
>  tests/qemuxml2xmltest.c| 17 +
>  11 files changed, 403 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/i440fx-controllers-pciopts.args
>  create mode 100644 tests/qemuxml2argvdata/i440fx-controllers-pciopts.xml
>  create mode 100644 tests/qemuxml2argvdata/pseries-controllers-pciopts.args
>  create mode 100644 tests/qemuxml2argvdata/pseries-controllers-pciopts.xml
>  create mode 100644 tests/qemuxml2argvdata/q35-controllers-pciopts.args
>  create mode 100644 tests/qemuxml2argvdata/q35-controllers-pciopts.xml
>  create mode 100644 tests/qemuxml2xmloutdata/i440fx-controllers-pciopts.xml
>  create mode 100644 tests/qemuxml2xmloutdata/pseries-controllers-pciopts.xml
>  create mode 100644 tests/qemuxml2xmloutdata/q35-controllers-pciopts.xml
> 

Not quite sure I understand the need. The only capability not currently
used in some way is QEMU_CAPS_I440FX_PCI_HOLE64_SIZE.

I guess there's nothing wrong with adding them other than test bloat.
Still there's nothing to "force" someone that adds some new thing to
update one of the three if some new option/capability is added.

Ironically adding (for example) QEMU_CAPS_Q35_PCI_HOLE64_SIZE to
i440fx-* doesn't cause any failure. I didn't try other ones.

BTW: This is what led me to determine that the qemuxml2argv isn't being
built any more and a response to Dan's series.

I'm not opposed to this being added, but do you think we should add
something does the opposite check?   That the wrong PCI adapter on the
wrong machine?  The wrong option on the wrong adapter is a question for
the next patch though...

John



> diff --git a/tests/qemuxml2argvdata/i440fx-controllers-pciopts.args 
> b/tests/qemuxml2argvdata/i440fx-controllers-pciopts.args
> new file mode 100644
> index 0..d85fae5c9
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/i440fx-controllers-pciopts.args
> @@ -0,0 +1,24 @@
> +LC_ALL=C \
> +PATH=/bin \
> +HOME=/home/test \
> +USER=test \
> +LOGNAME=test \
> +QEMU_AUDIO_DRV=none \
> +/usr/bin/qemu-system-x86_64 \
> +-name guest \
> +-S \
> +-M pc \
> +-m 1024 \
> +-smp 1,sockets=1,cores=1,threads=1 \
> +-numa node,nodeid=0,cpus=0,mem=1024 \
> +-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
> +-nographic \
> +-nodefaults \
> +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
> +server,nowait \
> +-mon chardev=charmonitor,id=monitor,mode=readline \
> +-no-acpi \
> +-boot c \
> +-global i440FX-pcihost.pci-hole64-size=1024K \
> +-device pci-bridge,chassis_nr=2,id=pci.1,bus=pci.0,addr=0x3 \
> +-device pxb,bus_nr=3,id=pci.2,numa_node=0,bus=pci.0,addr=0x4
> diff --git a/tests/qemuxml2argvdata/i440fx-controllers-pciopts.xml 
> b/tests/qemuxml2argvdata/i440fx-controllers-pciopts.xml
> new file mode 100644
> index 0..861a66589
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/i440fx-controllers-pciopts.xml
> @@ -0,0 +1,36 @@
> +
> +  guest
> +  496d7ea8-9739-544b-4ebd-ef08be936e8b
> +  1048576
> +  1
> +  
> +hvm
> +  
> +  
> +
> +  
> +
> +  
> +  
> +/usr/bin/qemu-system-x86_64
> +
> +  
> +  
> +  1024
> +
> +
> +  
> +  
> +0
> +  
> +
> +
> +  
> +  
> +0
> +  
> +
> +
> +
> +  
> +
> diff --git a/tests/qemuxml2argvdata/pseries-controllers-pciopts.args 
> b/tests/qemuxml2argvdata/pseries-controllers-pciopts.args
> new file mode 100644
> index 0..5f1edfc83
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/pseries-controllers-pciopts.args
> @@ -0,0 +1,22 @@
> +LC_ALL=C \
> +PATH=/bin \
> +HOME=/home/test \
> +USER=test \
> +LOGNAME=test \
> +QEMU_AUDIO_DRV=none \
> +/usr/bin/qemu-system-ppc64 \
> +-name guest \
> +-S \
> +-M pseries \
> +-m 1024 \
> +-smp 1,sockets=1,cores=1,threads=1 \
> +-numa node,nodeid=0,cpus=0,mem=1024 \
> +-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
> +-nographic \
> +-nodefaults \
> +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
> +server,nowait \
> +-mon 

[libvirt] [PATCH REBASE 1/2] tests: Add some tests for PCI controller options

2018-02-05 Thread Andrea Bolognani
The input configurations set all existing options for all PCI
controllers, to see what ends up showing up in the output.

Signed-off-by: Andrea Bolognani 
---
 .../i440fx-controllers-pciopts.args| 24 +++
 .../i440fx-controllers-pciopts.xml | 36 ++
 .../pseries-controllers-pciopts.args   | 22 +++
 .../pseries-controllers-pciopts.xml| 35 ++
 .../qemuxml2argvdata/q35-controllers-pciopts.args  | 28 
 tests/qemuxml2argvdata/q35-controllers-pciopts.xml | 60 +
 tests/qemuxml2argvtest.c   | 17 +
 .../i440fx-controllers-pciopts.xml | 45 +
 .../pseries-controllers-pciopts.xml| 43 
 .../qemuxml2xmloutdata/q35-controllers-pciopts.xml | 76 ++
 tests/qemuxml2xmltest.c| 17 +
 11 files changed, 403 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/i440fx-controllers-pciopts.args
 create mode 100644 tests/qemuxml2argvdata/i440fx-controllers-pciopts.xml
 create mode 100644 tests/qemuxml2argvdata/pseries-controllers-pciopts.args
 create mode 100644 tests/qemuxml2argvdata/pseries-controllers-pciopts.xml
 create mode 100644 tests/qemuxml2argvdata/q35-controllers-pciopts.args
 create mode 100644 tests/qemuxml2argvdata/q35-controllers-pciopts.xml
 create mode 100644 tests/qemuxml2xmloutdata/i440fx-controllers-pciopts.xml
 create mode 100644 tests/qemuxml2xmloutdata/pseries-controllers-pciopts.xml
 create mode 100644 tests/qemuxml2xmloutdata/q35-controllers-pciopts.xml

diff --git a/tests/qemuxml2argvdata/i440fx-controllers-pciopts.args 
b/tests/qemuxml2argvdata/i440fx-controllers-pciopts.args
new file mode 100644
index 0..d85fae5c9
--- /dev/null
+++ b/tests/qemuxml2argvdata/i440fx-controllers-pciopts.args
@@ -0,0 +1,24 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name guest \
+-S \
+-M pc \
+-m 1024 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-numa node,nodeid=0,cpus=0,mem=1024 \
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
+-nographic \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c \
+-global i440FX-pcihost.pci-hole64-size=1024K \
+-device pci-bridge,chassis_nr=2,id=pci.1,bus=pci.0,addr=0x3 \
+-device pxb,bus_nr=3,id=pci.2,numa_node=0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/i440fx-controllers-pciopts.xml 
b/tests/qemuxml2argvdata/i440fx-controllers-pciopts.xml
new file mode 100644
index 0..861a66589
--- /dev/null
+++ b/tests/qemuxml2argvdata/i440fx-controllers-pciopts.xml
@@ -0,0 +1,36 @@
+
+  guest
+  496d7ea8-9739-544b-4ebd-ef08be936e8b
+  1048576
+  1
+  
+hvm
+  
+  
+
+  
+
+  
+  
+/usr/bin/qemu-system-x86_64
+
+  
+  
+  1024
+
+
+  
+  
+0
+  
+
+
+  
+  
+0
+  
+
+
+
+  
+
diff --git a/tests/qemuxml2argvdata/pseries-controllers-pciopts.args 
b/tests/qemuxml2argvdata/pseries-controllers-pciopts.args
new file mode 100644
index 0..5f1edfc83
--- /dev/null
+++ b/tests/qemuxml2argvdata/pseries-controllers-pciopts.args
@@ -0,0 +1,22 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-ppc64 \
+-name guest \
+-S \
+-M pseries \
+-m 1024 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-numa node,nodeid=0,cpus=0,mem=1024 \
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
+-nographic \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-boot c \
+-device spapr-pci-host-bridge,index=1,id=pci.1,numa_node=0 \
+-device pci-bridge,chassis_nr=3,id=pci.2,bus=pci.0,addr=0x1
diff --git a/tests/qemuxml2argvdata/pseries-controllers-pciopts.xml 
b/tests/qemuxml2argvdata/pseries-controllers-pciopts.xml
new file mode 100644
index 0..43353cba6
--- /dev/null
+++ b/tests/qemuxml2argvdata/pseries-controllers-pciopts.xml
@@ -0,0 +1,35 @@
+
+  guest
+  496d7ea8-9739-544b-4ebd-ef08be936e8b
+  1048576
+  1
+  
+hvm
+  
+  
+
+  
+
+  
+  
+/usr/bin/qemu-system-ppc64
+
+  
+  
+
+
+  
+  
+0
+  
+
+
+  
+  
+0
+  
+
+
+
+  
+
diff --git a/tests/qemuxml2argvdata/q35-controllers-pciopts.args 
b/tests/qemuxml2argvdata/q35-controllers-pciopts.args
new file mode 100644
index 0..44259f502
--- /dev/null
+++ b/tests/qemuxml2argvdata/q35-controllers-pciopts.args
@@ -0,0 +1,28 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name guest \
+-S \
+-M q35 \
+-m 1024 \
+-smp