All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] QOM instance_size cleanups and fixes
@ 2020-08-26 17:10 Eduardo Habkost
  2020-08-26 17:10 ` [PATCH 1/4] tosa-ssp: No need to override instance_size Eduardo Habkost
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Eduardo Habkost @ 2020-08-26 17:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrange

Additional batch of fixes to code setting instance_size on QOM
types.

Eduardo Habkost (4):
  tosa-ssp: No need to override instance_size
  hda-audio: Set instance_size at base class
  slavio_misc: Correct instance_size
  tls-cipher-suites: Correct instance_size

 crypto/tls-cipher-suites.c | 2 +-
 hw/arm/tosa.c              | 1 -
 hw/audio/hda-codec.c       | 4 +---
 hw/misc/slavio_misc.c      | 2 +-
 4 files changed, 3 insertions(+), 6 deletions(-)

-- 
2.26.2




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

* [PATCH 1/4] tosa-ssp: No need to override instance_size
  2020-08-26 17:10 [PATCH 0/4] QOM instance_size cleanups and fixes Eduardo Habkost
@ 2020-08-26 17:10 ` Eduardo Habkost
  2020-08-26 17:10 ` [PATCH 2/4] hda-audio: Set instance_size at base class Eduardo Habkost
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Eduardo Habkost @ 2020-08-26 17:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Paolo Bonzini, qemu-arm, Daniel P. Berrange

TYPE_SSI_SLAVE already sets instance_size=sizeof(SSISlave),
there's no need to override it.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Cc: qemu-devel@nongnu.org
---
 hw/arm/tosa.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index e29566f7b3..2c5a8a50a1 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -311,7 +311,6 @@ static void tosa_ssp_class_init(ObjectClass *klass, void *data)
 static const TypeInfo tosa_ssp_info = {
     .name          = "tosa-ssp",
     .parent        = TYPE_SSI_SLAVE,
-    .instance_size = sizeof(SSISlave),
     .class_init    = tosa_ssp_class_init,
 };
 
-- 
2.26.2



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

* [PATCH 2/4] hda-audio: Set instance_size at base class
  2020-08-26 17:10 [PATCH 0/4] QOM instance_size cleanups and fixes Eduardo Habkost
  2020-08-26 17:10 ` [PATCH 1/4] tosa-ssp: No need to override instance_size Eduardo Habkost
@ 2020-08-26 17:10 ` Eduardo Habkost
  2020-08-28 12:13   ` Gerd Hoffmann
  2020-08-31 19:44   ` Philippe Mathieu-Daudé
  2020-08-26 17:10 ` [PATCH 3/4] slavio_misc: Correct instance_size Eduardo Habkost
  2020-08-26 17:10 ` [PATCH 4/4] tls-cipher-suites: " Eduardo Habkost
  3 siblings, 2 replies; 8+ messages in thread
From: Eduardo Habkost @ 2020-08-26 17:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrange, Gerd Hoffmann

Setting instance_size correctly at the base class will help us
avoid mistakes when declaring new subclasses.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
---
 hw/audio/hda-codec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index cbd92b72f2..2d16448181 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -898,6 +898,7 @@ static void hda_audio_base_class_init(ObjectClass *klass, void *data)
 static const TypeInfo hda_audio_info = {
     .name          = TYPE_HDA_AUDIO,
     .parent        = TYPE_HDA_CODEC_DEVICE,
+    .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_base_class_init,
     .abstract      = true,
 };
@@ -914,7 +915,6 @@ static void hda_audio_output_class_init(ObjectClass *klass, void *data)
 static const TypeInfo hda_audio_output_info = {
     .name          = "hda-output",
     .parent        = TYPE_HDA_AUDIO,
-    .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_output_class_init,
 };
 
@@ -930,7 +930,6 @@ static void hda_audio_duplex_class_init(ObjectClass *klass, void *data)
 static const TypeInfo hda_audio_duplex_info = {
     .name          = "hda-duplex",
     .parent        = TYPE_HDA_AUDIO,
-    .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_duplex_class_init,
 };
 
@@ -946,7 +945,6 @@ static void hda_audio_micro_class_init(ObjectClass *klass, void *data)
 static const TypeInfo hda_audio_micro_info = {
     .name          = "hda-micro",
     .parent        = TYPE_HDA_AUDIO,
-    .instance_size = sizeof(HDAAudioState),
     .class_init    = hda_audio_micro_class_init,
 };
 
-- 
2.26.2



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

* [PATCH 3/4] slavio_misc: Correct instance_size
  2020-08-26 17:10 [PATCH 0/4] QOM instance_size cleanups and fixes Eduardo Habkost
  2020-08-26 17:10 ` [PATCH 1/4] tosa-ssp: No need to override instance_size Eduardo Habkost
  2020-08-26 17:10 ` [PATCH 2/4] hda-audio: Set instance_size at base class Eduardo Habkost
@ 2020-08-26 17:10 ` Eduardo Habkost
  2020-08-26 17:10 ` [PATCH 4/4] tls-cipher-suites: " Eduardo Habkost
  3 siblings, 0 replies; 8+ messages in thread
From: Eduardo Habkost @ 2020-08-26 17:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Mark Cave-Ayland, Daniel P. Berrange

TYPE_APC was using the wrong struct for instance_size.  Luckily
this never caused any problems because MiscState is larger than
APCState.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: qemu-devel@nongnu.org
---
 hw/misc/slavio_misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c
index 279b38dfc7..6d10cd078f 100644
--- a/hw/misc/slavio_misc.c
+++ b/hw/misc/slavio_misc.c
@@ -499,7 +499,7 @@ static const TypeInfo slavio_misc_info = {
 static const TypeInfo apc_info = {
     .name          = TYPE_APC,
     .parent        = TYPE_SYS_BUS_DEVICE,
-    .instance_size = sizeof(MiscState),
+    .instance_size = sizeof(APCState),
     .instance_init = apc_init,
 };
 
-- 
2.26.2



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

* [PATCH 4/4] tls-cipher-suites: Correct instance_size
  2020-08-26 17:10 [PATCH 0/4] QOM instance_size cleanups and fixes Eduardo Habkost
                   ` (2 preceding siblings ...)
  2020-08-26 17:10 ` [PATCH 3/4] slavio_misc: Correct instance_size Eduardo Habkost
@ 2020-08-26 17:10 ` Eduardo Habkost
  2020-08-26 17:18   ` Daniel P. Berrangé
  3 siblings, 1 reply; 8+ messages in thread
From: Eduardo Habkost @ 2020-08-26 17:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniel P. Berrange

We do have a QCryptoTLSCipherSuites struct.  It must be used when
setting instance_size of the QOM type.  Luckily this never caused
problems because the QCryptoTLSCipherSuites struct has only a
parent_obj field and nothing else.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org
---
 crypto/tls-cipher-suites.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c
index 0d305b684b..55fb5f7c19 100644
--- a/crypto/tls-cipher-suites.c
+++ b/crypto/tls-cipher-suites.c
@@ -108,7 +108,7 @@ static void qcrypto_tls_cipher_suites_class_init(ObjectClass *oc, void *data)
 static const TypeInfo qcrypto_tls_cipher_suites_info = {
     .parent = TYPE_QCRYPTO_TLS_CREDS,
     .name = TYPE_QCRYPTO_TLS_CIPHER_SUITES,
-    .instance_size = sizeof(QCryptoTLSCreds),
+    .instance_size = sizeof(QCryptoTLSCipherSuites),
     .class_size = sizeof(QCryptoTLSCredsClass),
     .class_init = qcrypto_tls_cipher_suites_class_init,
     .interfaces = (InterfaceInfo[]) {
-- 
2.26.2



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

* Re: [PATCH 4/4] tls-cipher-suites: Correct instance_size
  2020-08-26 17:10 ` [PATCH 4/4] tls-cipher-suites: " Eduardo Habkost
@ 2020-08-26 17:18   ` Daniel P. Berrangé
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel P. Berrangé @ 2020-08-26 17:18 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: Paolo Bonzini, qemu-devel

On Wed, Aug 26, 2020 at 01:10:05PM -0400, Eduardo Habkost wrote:
> We do have a QCryptoTLSCipherSuites struct.  It must be used when
> setting instance_size of the QOM type.  Luckily this never caused
> problems because the QCryptoTLSCipherSuites struct has only a
> parent_obj field and nothing else.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  crypto/tls-cipher-suites.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PATCH 2/4] hda-audio: Set instance_size at base class
  2020-08-26 17:10 ` [PATCH 2/4] hda-audio: Set instance_size at base class Eduardo Habkost
@ 2020-08-28 12:13   ` Gerd Hoffmann
  2020-08-31 19:44   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2020-08-28 12:13 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: Paolo Bonzini, Daniel P. Berrange, qemu-devel

On Wed, Aug 26, 2020 at 01:10:03PM -0400, Eduardo Habkost wrote:
> Setting instance_size correctly at the base class will help us
> avoid mistakes when declaring new subclasses.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>



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

* Re: [PATCH 2/4] hda-audio: Set instance_size at base class
  2020-08-26 17:10 ` [PATCH 2/4] hda-audio: Set instance_size at base class Eduardo Habkost
  2020-08-28 12:13   ` Gerd Hoffmann
@ 2020-08-31 19:44   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-31 19:44 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Paolo Bonzini, Daniel P. Berrange,
	qemu-devel@nongnu.org Developers, Gerd Hoffmann

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

Le mer. 26 août 2020 19:12, Eduardo Habkost <ehabkost@redhat.com> a écrit :

> Setting instance_size correctly at the base class will help us
> avoid mistakes when declaring new subclasses.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
>

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

---
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  hw/audio/hda-codec.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
> index cbd92b72f2..2d16448181 100644
> --- a/hw/audio/hda-codec.c
> +++ b/hw/audio/hda-codec.c
> @@ -898,6 +898,7 @@ static void hda_audio_base_class_init(ObjectClass
> *klass, void *data)
>  static const TypeInfo hda_audio_info = {
>      .name          = TYPE_HDA_AUDIO,
>      .parent        = TYPE_HDA_CODEC_DEVICE,
> +    .instance_size = sizeof(HDAAudioState),
>      .class_init    = hda_audio_base_class_init,
>      .abstract      = true,
>  };
> @@ -914,7 +915,6 @@ static void hda_audio_output_class_init(ObjectClass
> *klass, void *data)
>  static const TypeInfo hda_audio_output_info = {
>      .name          = "hda-output",
>      .parent        = TYPE_HDA_AUDIO,
> -    .instance_size = sizeof(HDAAudioState),
>      .class_init    = hda_audio_output_class_init,
>  };
>
> @@ -930,7 +930,6 @@ static void hda_audio_duplex_class_init(ObjectClass
> *klass, void *data)
>  static const TypeInfo hda_audio_duplex_info = {
>      .name          = "hda-duplex",
>      .parent        = TYPE_HDA_AUDIO,
> -    .instance_size = sizeof(HDAAudioState),
>      .class_init    = hda_audio_duplex_class_init,
>  };
>
> @@ -946,7 +945,6 @@ static void hda_audio_micro_class_init(ObjectClass
> *klass, void *data)
>  static const TypeInfo hda_audio_micro_info = {
>      .name          = "hda-micro",
>      .parent        = TYPE_HDA_AUDIO,
> -    .instance_size = sizeof(HDAAudioState),
>      .class_init    = hda_audio_micro_class_init,
>  };
>
> --
> 2.26.2
>
>
>

[-- Attachment #2: Type: text/html, Size: 3362 bytes --]

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

end of thread, other threads:[~2020-08-31 21:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 17:10 [PATCH 0/4] QOM instance_size cleanups and fixes Eduardo Habkost
2020-08-26 17:10 ` [PATCH 1/4] tosa-ssp: No need to override instance_size Eduardo Habkost
2020-08-26 17:10 ` [PATCH 2/4] hda-audio: Set instance_size at base class Eduardo Habkost
2020-08-28 12:13   ` Gerd Hoffmann
2020-08-31 19:44   ` Philippe Mathieu-Daudé
2020-08-26 17:10 ` [PATCH 3/4] slavio_misc: Correct instance_size Eduardo Habkost
2020-08-26 17:10 ` [PATCH 4/4] tls-cipher-suites: " Eduardo Habkost
2020-08-26 17:18   ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.