qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ioapic: use TYPE_FOO MACRO than constant string
@ 2019-01-05  2:38 Li Qiang
  2019-01-09 10:31 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
  2019-01-09 10:34 ` Laurent Vivier
  0 siblings, 2 replies; 3+ messages in thread
From: Li Qiang @ 2019-01-05  2:38 UTC (permalink / raw)
  To: mst, marcel.apfelbaum, pbonzini, rth, ehabkost
  Cc: qemu-devel, qemu-trivial, lvivier, Li Qiang

Make them more QOMConventional.
Cc:qemu-trivial@nongnu.org

Signed-off-by: Li Qiang <liq3ea@163.com>
---
 hw/i386/kvm/ioapic.c     | 2 +-
 hw/i386/pc.c             | 4 ++--
 hw/intc/ioapic.c         | 2 +-
 include/hw/i386/ioapic.h | 3 +++
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
index 5b40d75439..e453692199 100644
--- a/hw/i386/kvm/ioapic.c
+++ b/hw/i386/kvm/ioapic.c
@@ -163,7 +163,7 @@ static void kvm_ioapic_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo kvm_ioapic_info = {
-    .name  = "kvm-ioapic",
+    .name  = TYPE_KVM_IOAPIC,
     .parent = TYPE_IOAPIC_COMMON,
     .instance_size = sizeof(KVMIOAPICState),
     .class_init = kvm_ioapic_class_init,
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f248662e97..af68a61615 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1665,9 +1665,9 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name)
     unsigned int i;
 
     if (kvm_ioapic_in_kernel()) {
-        dev = qdev_create(NULL, "kvm-ioapic");
+        dev = qdev_create(NULL, TYPE_KVM_IOAPIC);
     } else {
-        dev = qdev_create(NULL, "ioapic");
+        dev = qdev_create(NULL, TYPE_IOAPIC);
     }
     if (parent_name) {
         object_property_add_child(object_resolve_path(parent_name, NULL),
diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index 4e529729b4..9d75f84d3b 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -429,7 +429,7 @@ static void ioapic_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo ioapic_info = {
-    .name          = "ioapic",
+    .name          = TYPE_IOAPIC,
     .parent        = TYPE_IOAPIC_COMMON,
     .instance_size = sizeof(IOAPICCommonState),
     .class_init    = ioapic_class_init,
diff --git a/include/hw/i386/ioapic.h b/include/hw/i386/ioapic.h
index 9c8816f11f..59fcb158a7 100644
--- a/include/hw/i386/ioapic.h
+++ b/include/hw/i386/ioapic.h
@@ -23,6 +23,9 @@
 #define IOAPIC_NUM_PINS 24
 #define IO_APIC_DEFAULT_ADDRESS 0xfec00000
 
+#define TYPE_KVM_IOAPIC "kvm-ioapic"
+#define TYPE_IOAPIC "ioapic"
+
 void ioapic_eoi_broadcast(int vector);
 
 #endif /* HW_IOAPIC_H */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] ioapic: use TYPE_FOO MACRO than constant string
  2019-01-05  2:38 [Qemu-devel] [PATCH] ioapic: use TYPE_FOO MACRO than constant string Li Qiang
@ 2019-01-09 10:31 ` Laurent Vivier
  2019-01-09 10:34 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2019-01-09 10:31 UTC (permalink / raw)
  To: Li Qiang, mst, marcel.apfelbaum, pbonzini, rth, ehabkost
  Cc: qemu-trivial, lvivier, qemu-devel

On 05/01/2019 03:38, Li Qiang wrote:
> Make them more QOMConventional.
> Cc:qemu-trivial@nongnu.org
> 
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  hw/i386/kvm/ioapic.c     | 2 +-
>  hw/i386/pc.c             | 4 ++--
>  hw/intc/ioapic.c         | 2 +-
>  include/hw/i386/ioapic.h | 3 +++
>  4 files changed, 7 insertions(+), 4 deletions(-)

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] ioapic: use TYPE_FOO MACRO than constant string
  2019-01-05  2:38 [Qemu-devel] [PATCH] ioapic: use TYPE_FOO MACRO than constant string Li Qiang
  2019-01-09 10:31 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
@ 2019-01-09 10:34 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2019-01-09 10:34 UTC (permalink / raw)
  To: Li Qiang, mst, marcel.apfelbaum, pbonzini, rth, ehabkost
  Cc: qemu-trivial, lvivier, qemu-devel

On 05/01/2019 03:38, Li Qiang wrote:
> Make them more QOMConventional.
> Cc:qemu-trivial@nongnu.org
> 
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  hw/i386/kvm/ioapic.c     | 2 +-
>  hw/i386/pc.c             | 4 ++--
>  hw/intc/ioapic.c         | 2 +-
>  include/hw/i386/ioapic.h | 3 +++
>  4 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
> index 5b40d75439..e453692199 100644
> --- a/hw/i386/kvm/ioapic.c
> +++ b/hw/i386/kvm/ioapic.c
> @@ -163,7 +163,7 @@ static void kvm_ioapic_class_init(ObjectClass *klass, void *data)
>  }
>  
>  static const TypeInfo kvm_ioapic_info = {
> -    .name  = "kvm-ioapic",
> +    .name  = TYPE_KVM_IOAPIC,
>      .parent = TYPE_IOAPIC_COMMON,
>      .instance_size = sizeof(KVMIOAPICState),
>      .class_init = kvm_ioapic_class_init,
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index f248662e97..af68a61615 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1665,9 +1665,9 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name)
>      unsigned int i;
>  
>      if (kvm_ioapic_in_kernel()) {
> -        dev = qdev_create(NULL, "kvm-ioapic");
> +        dev = qdev_create(NULL, TYPE_KVM_IOAPIC);
>      } else {
> -        dev = qdev_create(NULL, "ioapic");
> +        dev = qdev_create(NULL, TYPE_IOAPIC);
>      }
>      if (parent_name) {
>          object_property_add_child(object_resolve_path(parent_name, NULL),
> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
> index 4e529729b4..9d75f84d3b 100644
> --- a/hw/intc/ioapic.c
> +++ b/hw/intc/ioapic.c
> @@ -429,7 +429,7 @@ static void ioapic_class_init(ObjectClass *klass, void *data)
>  }
>  
>  static const TypeInfo ioapic_info = {
> -    .name          = "ioapic",
> +    .name          = TYPE_IOAPIC,
>      .parent        = TYPE_IOAPIC_COMMON,
>      .instance_size = sizeof(IOAPICCommonState),
>      .class_init    = ioapic_class_init,
> diff --git a/include/hw/i386/ioapic.h b/include/hw/i386/ioapic.h
> index 9c8816f11f..59fcb158a7 100644
> --- a/include/hw/i386/ioapic.h
> +++ b/include/hw/i386/ioapic.h
> @@ -23,6 +23,9 @@
>  #define IOAPIC_NUM_PINS 24
>  #define IO_APIC_DEFAULT_ADDRESS 0xfec00000
>  
> +#define TYPE_KVM_IOAPIC "kvm-ioapic"
> +#define TYPE_IOAPIC "ioapic"
> +
>  void ioapic_eoi_broadcast(int vector);
>  
>  #endif /* HW_IOAPIC_H */
> 

Applied to my trivial-patches branch.

Thanks,
Laurent

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-09 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-05  2:38 [Qemu-devel] [PATCH] ioapic: use TYPE_FOO MACRO than constant string Li Qiang
2019-01-09 10:31 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
2019-01-09 10:34 ` Laurent Vivier

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).