[PATCH for-6.2 6/8] arch_init.h: Move QEMU_ARCH_VIRTIO_* to qdev-monitor.c

Peter Maydell posted 8 patches 4 years, 6 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Aurelien Jarno <aurelien@aurel32.net>, Eduardo Habkost <ehabkost@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Hervé Poussineau" <hpoussin@reactos.org>, Kevin Wolf <kwolf@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Bin Meng <bin.meng@windriver.com>, Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>, David Hildenbrand <david@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Cornelia Huck <cohuck@redhat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Alistair Francis <Alistair.Francis@wdc.com>, Palmer Dabbelt <palmer@dabbelt.com>, Thomas Huth <thuth@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
[PATCH for-6.2 6/8] arch_init.h: Move QEMU_ARCH_VIRTIO_* to qdev-monitor.c
Posted by Peter Maydell 4 years, 6 months ago
The QEMU_ARCH_VIRTIO_* defines are used only in one file,
qdev-monitor.c. Move them to that file.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 include/sysemu/arch_init.h | 9 ---------
 softmmu/qdev-monitor.c     | 9 +++++++++
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index 60270c5ad15..e7789399508 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -30,13 +30,4 @@ enum {
 
 extern const uint32_t arch_type;
 
-/* default virtio transport per architecture */
-#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \
-                              QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \
-                              QEMU_ARCH_MIPS | QEMU_ARCH_PPC |  \
-                              QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \
-                              QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA)
-#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X)
-#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K)
-
 #endif
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index 721dec2d820..a304754ab91 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -52,6 +52,15 @@ typedef struct QDevAlias
     uint32_t arch_mask;
 } QDevAlias;
 
+/* default virtio transport per architecture */
+#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \
+                              QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \
+                              QEMU_ARCH_MIPS | QEMU_ARCH_PPC |  \
+                              QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \
+                              QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA)
+#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X)
+#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K)
+
 /* Please keep this table sorted by typename. */
 static const QDevAlias qdev_alias_table[] = {
     { "AC97", "ac97" }, /* -soundhw name */
-- 
2.20.1


Re: [PATCH for-6.2 6/8] arch_init.h: Move QEMU_ARCH_VIRTIO_* to qdev-monitor.c
Posted by Richard Henderson 4 years, 6 months ago
On 7/30/21 12:59 AM, Peter Maydell wrote:
> The QEMU_ARCH_VIRTIO_* defines are used only in one file,
> qdev-monitor.c. Move them to that file.
> 
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
>   include/sysemu/arch_init.h | 9 ---------
>   softmmu/qdev-monitor.c     | 9 +++++++++
>   2 files changed, 9 insertions(+), 9 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

Re: [PATCH for-6.2 6/8] arch_init.h: Move QEMU_ARCH_VIRTIO_* to qdev-monitor.c
Posted by Markus Armbruster 4 years, 5 months ago
Peter Maydell <peter.maydell@linaro.org> writes:

> The QEMU_ARCH_VIRTIO_* defines are used only in one file,
> qdev-monitor.c. Move them to that file.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  include/sysemu/arch_init.h | 9 ---------
>  softmmu/qdev-monitor.c     | 9 +++++++++
>  2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
> index 60270c5ad15..e7789399508 100644
> --- a/include/sysemu/arch_init.h
> +++ b/include/sysemu/arch_init.h
> @@ -30,13 +30,4 @@ enum {
>  
>  extern const uint32_t arch_type;
>  
> -/* default virtio transport per architecture */
> -#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \
> -                              QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \
> -                              QEMU_ARCH_MIPS | QEMU_ARCH_PPC |  \
> -                              QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \
> -                              QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA)
> -#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X)
> -#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K)
> -
>  #endif
> diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
> index 721dec2d820..a304754ab91 100644
> --- a/softmmu/qdev-monitor.c
> +++ b/softmmu/qdev-monitor.c
> @@ -52,6 +52,15 @@ typedef struct QDevAlias
>      uint32_t arch_mask;
>  } QDevAlias;
>  
> +/* default virtio transport per architecture */
> +#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \
> +                              QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \
> +                              QEMU_ARCH_MIPS | QEMU_ARCH_PPC |  \
> +                              QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \
> +                              QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA)
> +#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X)
> +#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K)
> +
>  /* Please keep this table sorted by typename. */
>  static const QDevAlias qdev_alias_table[] = {
>      { "AC97", "ac97" }, /* -soundhw name */

qdev-monitor.c is perhaps less than ideal.  It's better than
arch_init.h, though.

Reviewed-by: Markus Armbruster <armbru@redhat.com>