QOM instance_size cleanups and fixes
cover QOM instance_size cleanups and fixes
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(-)
Signature · 1 line
2.26.2
PATCH 1/4 tosa-ssp: No need to override instance_size
TYPE_SSI_SLAVE already sets instance_size=sizeof(SSISlave), there's no need to override it.
---
Cc: Andrzej Zaborowski <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- hw/arm/tosa.c | 1 - 1 file changed, 1 deletion(-)
hw/arm/tosa.c +0 -1
@@ -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, };
Signature · 1 line
2.26.2
PATCH 2/4 hda-audio: Set instance_size at base class
In reply to Eduardo HabkostSetting instance_size correctly at the base class will help us avoid mistakes when declaring new subclasses.
---
Cc: Gerd Hoffmann <[email protected]>
Cc: [email protected]
--- hw/audio/hda-codec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
hw/audio/hda-codec.c +1 -3
@@ -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, };
Signature · 1 line
2.26.2
Re: [PATCH 2/4] hda-audio: Set instance_size at base class
Quoted 4 lines · Eduardo Habkost
Setting
instance_sizecorrectly at the base class will help us avoid mistakes when declaring new subclasses.Signed-off-by Eduardo Habkost <[email protected]>
Re: [PATCH 2/4] hda-audio: Set instance_size at base class
In reply to Eduardo HabkostQuoted 5 lines · Eduardo Habkost
Setting
instance_sizecorrectly at the base class will help us avoid mistakes when declaring new subclasses.Signed-off-by Eduardo Habkost <[email protected]>
---
Quoted 51 lines
Cc Gerd Hoffmann <[email protected]>--- hw/audio/hda-codec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)hw/audio/hda-codec.c +1
-0@@ -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,};
hw/audio/hda-codec.c +0
-4@@ -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
PATCH 3/4 slavio_misc: Correct instance_size
In reply to Eduardo HabkostTYPE_APC was using the wrong struct for instance_size. Luckily this never caused any problems because MiscState is larger than APCState.
---
Cc: Mark Cave-Ayland <[email protected]>
Cc: [email protected]
--- hw/misc/slavio_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/slavio_misc.c +1 -1
@@ -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, };
Signature · 1 line
2.26.2
PATCH 4/4 tls-cipher-suites: Correct instance_size
In reply to Eduardo HabkostWe 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.
---
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: [email protected]
--- crypto/tls-cipher-suites.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/tls-cipher-suites.c +1 -1
@@ -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 []) {
Signature · 1 line
2.26.2
Re: [PATCH 4/4] tls-cipher-suites: Correct instance_size
Quoted 5 lines · Eduardo Habkost
We do have a QCryptoTLSCipherSuites struct. It must be used when setting
instance_sizeof the QOM type. Luckily this never caused problems because the QCryptoTLSCipherSuites struct has only aparent_objfield and nothing else.
Quoted 7 lines
Signed-off-by Eduardo Habkost <[email protected]>---
Cc: "Daniel P. Berrangé" <[email protected]>
Cc: [email protected]--- crypto/tls-cipher-suites.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Regards,
Daniel
Signature · 3 lines
|: 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 :|