qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Laurent Vivier <laurent@vivier.eu>, qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	qemu-block@nongnu.org, "Cornelia Huck" <cohuck@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Max Reitz" <mreitz@redhat.com>,
	qemu-s390x@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH 1/4] m68k: add the virtio devices aliases
Date: Thu, 18 Mar 2021 23:51:11 +0100	[thread overview]
Message-ID: <cca7fd52-a97c-fa8d-3fbd-16702a43cb58@amsat.org> (raw)
In-Reply-To: <20210318223907.1344870-2-laurent@vivier.eu>

On 3/18/21 11:39 PM, Laurent Vivier wrote:
> Similarly to 5f629d943cb0 ("s390x: fix s390 virtio aliases"),
> define the virtio aliases.
> 
> This allows to start machines with virtio devices without
> knowledge of the implementation type.
> 
> For instance, we can use "-device virtio-scsi" on
> m68k, s390x or PC, and the device will be

+"respectively"

> "virtio-scsi-device", "virtio-scsi-ccw" or "virtio-scsi-pci".
> 
> This already exists for s390x and -ccw interfaces, adds them

"add"?

> for m68k and MMIO (-device) interfaces.
> 
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  softmmu/qdev-monitor.c | 46 +++++++++++++++++++++++++++---------------
>  1 file changed, 30 insertions(+), 16 deletions(-)
> 
> diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
> index 8dc656becca9..262d38b8c01e 100644
> --- a/softmmu/qdev-monitor.c
> +++ b/softmmu/qdev-monitor.c
> @@ -42,6 +42,8 @@
>  #include "hw/qdev-properties.h"
>  #include "hw/clock.h"
>  
> +#define QEMU_ARCH_NO_PCI (QEMU_ARCH_S390X | QEMU_ARCH_M68K)
> +
>  /*
>   * Aliases were a bad idea from the start.  Let's keep them
>   * from spreading further.
> @@ -60,34 +62,46 @@ static const QDevAlias qdev_alias_table[] = {
>      { "ES1370", "es1370" }, /* -soundhw name */
>      { "ich9-ahci", "ahci" },
>      { "lsi53c895a", "lsi" },
> +    { "virtio-9p-device", "virtio-9p", QEMU_ARCH_M68K },
>      { "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X },
> -    { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-9p-pci", "virtio-9p", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI },

TIL QEMU_ARCH_NO_PCI :)

> +    { "virtio-balloon-device", "virtio-balloon", QEMU_ARCH_M68K },
>      { "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_S390X },
> -    { "virtio-balloon-pci", "virtio-balloon",
> -            QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-balloon-pci", "virtio-balloon", QEMU_ARCH_ALL &
> +                                             ~QEMU_ARCH_NO_PCI },
> +    { "virtio-blk-device", "virtio-blk", QEMU_ARCH_M68K },
>      { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X },
> -    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI },
>      { "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_S390X },
> -    { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-gpu-device", "virtio-gpu", QEMU_ARCH_M68K },
> +    { "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI },
> +    { "virtio-input-host-device", "virtio-input-host", QEMU_ARCH_M68K },
>      { "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_S390X },
> -    { "virtio-input-host-pci", "virtio-input-host",
> -            QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> -    { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-input-host-pci", "virtio-input-host", QEMU_ARCH_ALL &
> +                                                   ~QEMU_ARCH_NO_PCI },
> +    { "virtio-iommu-pci", "virtio-iommu", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI },
> +    { "virtio-keyboard-device", "virtio-keyboard", QEMU_ARCH_M68K },
>      { "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_S390X },
> -    { "virtio-keyboard-pci", "virtio-keyboard",
> -            QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-keyboard-pci", "virtio-keyboard", QEMU_ARCH_ALL &
> +                                               ~QEMU_ARCH_NO_PCI },
> +    { "virtio-mouse-device", "virtio-mouse", QEMU_ARCH_M68K },
>      { "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_S390X },
> -    { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI },
> +    { "virtio-net-device", "virtio-net", QEMU_ARCH_M68K },
>      { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X },
> -    { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI },
> +    { "virtio-rng-device", "virtio-rng", QEMU_ARCH_M68K },
>      { "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_S390X },
> -    { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-rng-pci", "virtio-rng", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI },
> +    { "virtio-scsi-device", "virtio-scsi", QEMU_ARCH_M68K },
>      { "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_S390X },
> -    { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI },
> +    { "virtio-serial-device", "virtio-serial", QEMU_ARCH_M68K },
>      { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X },
> -    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI},
> +    { "virtio-tablet-device", "virtio-tablet", QEMU_ARCH_M68K },
>      { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_S390X },
> -    { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
> +    { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_ALL & ~QEMU_ARCH_NO_PCI },
>      { }
>  };

This could be easier to split this patch in 2:
1/ QEMU_ARCH_S390X -> QEMU_ARCH_NO_PCI
2/ complete QEMU_ARCH_M68K aliases

Regardless:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


  reply	other threads:[~2021-03-18 22:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 22:39 [PATCH 0/4] iotests: fix failures with non-PCI machines Laurent Vivier
2021-03-18 22:39 ` [PATCH 1/4] m68k: add the virtio devices aliases Laurent Vivier
2021-03-18 22:51   ` Philippe Mathieu-Daudé [this message]
2021-03-19  6:47   ` Thomas Huth
2021-03-19 11:36   ` Cornelia Huck
2021-03-19 12:07     ` Laurent Vivier
2021-03-18 22:39 ` [PATCH 2/4] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Laurent Vivier
2021-03-19 10:39   ` Philippe Mathieu-Daudé
2021-03-19 11:43   ` Cornelia Huck
2021-03-19 12:09     ` Laurent Vivier
2021-03-18 22:39 ` [PATCH 3/4] iotests: test m68k with the virt machine Laurent Vivier
2021-03-18 22:46   ` Philippe Mathieu-Daudé
2021-03-18 22:39 ` [PATCH 4/4] iotests: iothreads need ioeventfd Laurent Vivier
2021-03-19 11:06   ` Paolo Bonzini
2021-03-19 11:27     ` Cornelia Huck
2021-03-19 11:28       ` Laurent Vivier

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=cca7fd52-a97c-fa8d-3fbd-16702a43cb58@amsat.org \
    --to=f4bug@amsat.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --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).