qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Alistair Francis" <alistair.francis@xilinx.com>,
	"Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
	"Cleber Rosa" <crosa@redhat.com>, "Kevin Wolf" <kwolf@redhat.com>,
	"Max Reitz" <mreitz@redhat.com>, "John Snow" <jsnow@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Lukáš Doktor" <ldoktor@redhat.com>,
	"Daniel P . Berrange" <berrange@redhat.com>,
	"Eric Blake" <eblake@redhat.com>, "Fam Zheng" <famz@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/6] QTests: use Python to run complex tests
Date: Thu, 14 Dec 2017 12:35:46 +0100	[thread overview]
Message-ID: <d4d649fc-4bb2-9b61-7e48-46a6a51e7b01@redhat.com> (raw)
In-Reply-To: <20171214093907.GA14433@stefanha-x1.localdomain>

[-- Attachment #1: Type: text/plain, Size: 2140 bytes --]

On 14/12/2017 10:39, Stefan Hajnoczi wrote:
>>             # verify Card ID
>>             data = self.bus.do_cmd(ALL_SEND_CID)
>>             oid, pnm, psn = struct.unpack(">x2s5sxLxxx", data)
>>             self.assertEqual(oid, "XY") # QEMU default
>>             self.assertEqual(pnm, "QEMU!") # QEMU default
>>             self.assertEqual(psn, 0xdeadbeef) # QEMU default
> Device qtests are better done in C than Python.  Python is not good at
> binary I/O and porting this to Python 3 will be extra work later (Python
> 2 is set for End-of-Life in 2020, see https://pythonclock.org/).
> 
> More importantly, we already have libqos in C with a guest memory
> allocator, PCI, and virtio support.  Fragmenting the small amount effort
> that goes into device testing will delay libqos reaching critical mass.
> Critical mass is where libqos provides all the infrastructure you need
> to set up a device and focus on your actual test instead of machine,
> bus, or device initialization.  Starting a Python device testing effort
> will just lead to duplication and 2 underdeveloped device testing
> frameworks.

I agree that fragmentation is bad.  However, libqos is small (about 4k
lines of code, maybe 3k in Python).

I also agree that any qtest written in Python should be written in
Python 3 from the beginning (in fact we should consider dropping Python
2.x support in 2.12).  Doing so should not make binary I/O much
different than C.

From my point of view, the main advantage of Python is the reflection
mechanisms.  Those would make it possible to automatically discover the
set of runnable tests; for example, based on:

- two machine descriptions (including malloc) for ARM -M virt and x86 -M q35

- a driver for the generic PCIe host bridge

- a driver for virtio-pci

- a driver for virtio-scsi

- a set of SCSI tests

... it should be possible to run the same tests as either ARM or x86
qtests.  This would be a very different framework compared to the C libqos.

Thanks,

Paolo

> Is there a specific reason why adding SD Card support to libqos is not
> possible in C?



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2017-12-14 11:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 21:35 [Qemu-devel] [PATCH 0/6] QTests: use Python to run complex tests Philippe Mathieu-Daudé
2017-12-13 21:35 ` [Qemu-devel] [PATCH 1/6] iotests.py: split BlockQMPTestCase class of QMPTestCase Philippe Mathieu-Daudé
2017-12-13 21:35 ` [Qemu-devel] [PATCH 2/6] iotests.py: move the generic QMPTestCase to qtest.py Philippe Mathieu-Daudé
2017-12-13 21:35 ` [Qemu-devel] [PATCH 3/6] qtest.py: use TMPDIR/TEMP if the TEST_DIR env var is missing Philippe Mathieu-Daudé
2017-12-13 21:35 ` [Qemu-devel] [PATCH 4/6] qtest.py: add verify_machine(supported_machines) Philippe Mathieu-Daudé
2017-12-13 21:35 ` [Qemu-devel] [PATCH 5/6] qtest.py: add a simple main() which calls unittest.main() Philippe Mathieu-Daudé
2017-12-13 21:35 ` [Qemu-devel] [PATCH 6/6] tests: add a Makefile rule to run Python qtests Philippe Mathieu-Daudé
2017-12-14  9:39 ` [Qemu-devel] [PATCH 0/6] QTests: use Python to run complex tests Stefan Hajnoczi
2017-12-14 11:35   ` Paolo Bonzini [this message]
2017-12-14 15:39     ` [Qemu-devel] [Qemu-block] " Nir Soffer
2017-12-14 16:01       ` Philippe Mathieu-Daudé
2017-12-14 16:05       ` Markus Armbruster
2017-12-14 17:33         ` Paolo Bonzini
2017-12-14 19:08           ` Peter Maydell
2017-12-14 19:38             ` Paolo Bonzini
2017-12-14 14:33   ` [Qemu-devel] " Philippe Mathieu-Daudé
2017-12-14 17:18     ` Stefan Hajnoczi
2017-12-14 18:46       ` Philippe Mathieu-Daudé
2017-12-14 15:35   ` [Qemu-devel] [Qemu-block] " Nir Soffer
2017-12-18 13:59     ` Stefan Hajnoczi
2017-12-18 16:09       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4d649fc-4bb2-9b61-7e48-46a6a51e7b01@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alistair.francis@xilinx.com \
    --cc=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=eblake@redhat.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=ldoktor@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).