[PATCH v3 02/16] hw/i386/vmport: Add device properties

Liran Alon posted 16 patches 5 years, 8 months ago
Maintainers: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>, Richard Henderson <rth@twiddle.net>, Eduardo Habkost <ehabkost@redhat.com>
[PATCH v3 02/16] hw/i386/vmport: Add device properties
Posted by Liran Alon 5 years, 8 months ago
No functional change.

This is done as a preparation for the following patches that will
introduce several device properties.

Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
---
 hw/i386/vmport.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
index b4c5a57bb0e9..6ed110ef71a6 100644
--- a/hw/i386/vmport.c
+++ b/hw/i386/vmport.c
@@ -32,6 +32,7 @@
 #include "hw/isa/isa.h"
 #include "hw/i386/pc.h"
 #include "hw/input/i8042.h"
+#include "hw/qdev-properties.h"
 #include "sysemu/hw_accel.h"
 #include "qemu/log.h"
 #include "trace.h"
@@ -161,6 +162,10 @@ static void vmport_realizefn(DeviceState *dev, Error **errp)
     vmport_register(VMPORT_CMD_GETRAMSIZE, vmport_cmd_ram_size, NULL);
 }
 
+static Property vmport_properties[] = {
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void vmport_class_initfn(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
@@ -168,6 +173,7 @@ static void vmport_class_initfn(ObjectClass *klass, void *data)
     dc->realize = vmport_realizefn;
     /* Reason: realize sets global port_state */
     dc->user_creatable = false;
+    device_class_set_props(dc, vmport_properties);
 }
 
 static const TypeInfo vmport_info = {
-- 
2.20.1


Re: [PATCH v3 02/16] hw/i386/vmport: Add device properties
Posted by Philippe Mathieu-Daudé 5 years, 8 months ago
On 3/12/20 5:54 PM, Liran Alon wrote:
> No functional change.
> 
> This is done as a preparation for the following patches that will
> introduce several device properties.
> 
> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
> Signed-off-by: Liran Alon <liran.alon@oracle.com>
> ---
>   hw/i386/vmport.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
> index b4c5a57bb0e9..6ed110ef71a6 100644
> --- a/hw/i386/vmport.c
> +++ b/hw/i386/vmport.c
> @@ -32,6 +32,7 @@
>   #include "hw/isa/isa.h"
>   #include "hw/i386/pc.h"
>   #include "hw/input/i8042.h"
> +#include "hw/qdev-properties.h"
>   #include "sysemu/hw_accel.h"
>   #include "qemu/log.h"
>   #include "trace.h"
> @@ -161,6 +162,10 @@ static void vmport_realizefn(DeviceState *dev, Error **errp)
>       vmport_register(VMPORT_CMD_GETRAMSIZE, vmport_cmd_ram_size, NULL);
>   }
>   
> +static Property vmport_properties[] = {
> +    DEFINE_PROP_END_OF_LIST(),
> +};
> +
>   static void vmport_class_initfn(ObjectClass *klass, void *data)
>   {
>       DeviceClass *dc = DEVICE_CLASS(klass);
> @@ -168,6 +173,7 @@ static void vmport_class_initfn(ObjectClass *klass, void *data)
>       dc->realize = vmport_realizefn;
>       /* Reason: realize sets global port_state */
>       dc->user_creatable = false;
> +    device_class_set_props(dc, vmport_properties);
>   }
>   
>   static const TypeInfo vmport_info = {
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>