Re: [libvirt-glib][PATCH v2] Use new GObject define macros with private

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2018-08-16 at 10:06 +0200, Michal Privoznik wrote:
[...]
> -GLIB2_REQUIRED=2.36.0
> +GLIB2_REQUIRED=2.38.0
>  AC_SUBST([GLIB2_REQUIRED]) dnl used in the .spec file
>  GLIB2_TEST_REQUIRED=2.38.0

We can now get rid of GLIB2_TEST_REQUIRED. Would you mind sending
a follow-up patch that does that?

[...]
>  static void gvir_config_capabilities_cpu_class_init(GVirConfigCapabilitiesCpuClass *klass)
>  {
> -    g_type_class_add_private(klass, sizeof(GVirConfigCapabilitiesCpuPrivate));
>  

Drop the empty line here.

[...]
> @@ -47,7 +47,6 @@ static void gvir_config_domain_cpu_class_init(GVirConfigDomainCpuClass *klass)
>      capabilities_class = GVIR_CONFIG_CAPABILITIES_CPU_CLASS(klass);
>      capabilities_class->get_features = _gvir_config_domain_cpu_get_features;
>  

Drop the empty line here.

[...]
>  static void gvir_config_domain_power_management_class_init
> -        (GVirConfigDomainPowerManagementClass *klass)
> +        (GVirConfigDomainPowerManagementClass *klass G_GNUC_UNUSED)

Weird formatting here, maybe fix it while you're at it?

[...]
> @@ -128,7 +128,6 @@ static void gvir_config_domain_class_init(GVirConfigDomainClass *klass)
>  {
>      GObjectClass *object_class = G_OBJECT_CLASS(klass);
>  
> -    g_type_class_add_private(klass, sizeof(GVirConfigDomainPrivate));
>  

Drop one of the two empty lines here.

[...]
> @@ -90,7 +90,6 @@ static void gvir_config_xml_doc_class_init(GVirConfigXmlDocClass *klass)
>  {
>      GObjectClass *object_class = G_OBJECT_CLASS(klass);
>  
> -    g_type_class_add_private(klass, sizeof(GVirConfigXmlDocPrivate));
>  

Drop one of the two empty lines here.

[...]
> @@ -231,7 +231,6 @@ static void gvir_connection_class_init(GVirConnectionClass *klass)
>                   1,
>                   GVIR_TYPE_DOMAIN);
>  
> -    g_type_class_add_private(klass, sizeof(GVirConnectionPrivate));

Drop the empty line here.

[...]
> @@ -135,7 +135,6 @@ static void gvir_domain_device_class_init(GVirDomainDeviceClass *klass)
>                                                          G_PARAM_CONSTRUCT_ONLY |
>                                                          G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirDomainDevicePrivate));

Drop the empty line here.

[...]
> @@ -126,7 +126,6 @@ static void gvir_domain_snapshot_class_init(GVirDomainSnapshotClass *klass)
>                                                         G_PARAM_CONSTRUCT_ONLY |
>                                                         G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirDomainSnapshotPrivate));

Drop the empty line here.

[...]
> @@ -247,7 +247,6 @@ static void gvir_domain_class_init(GVirDomainClass *klass)
>                                          G_TYPE_NONE,
>                                          0);
>  
> -    g_type_class_add_private(klass, sizeof(GVirDomainPrivate));

Drop the empty line here.

[...]
> @@ -196,7 +196,6 @@ static void gvir_input_stream_class_init(GVirInputStreamClass *klass)
>      GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
>      GInputStreamClass *ginputstream_class = G_INPUT_STREAM_CLASS(klass);
>  
> -    g_type_class_add_private(klass, sizeof(GVirInputStreamPrivate));
>  

Drop one of the two empty lines here.

[...]
> @@ -126,7 +126,6 @@ static void gvir_interface_class_init(GVirInterfaceClass *klass)
>                                                         G_PARAM_CONSTRUCT_ONLY |
>                                                         G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirInterfacePrivate));

Drop the empty line here.

[...]
> @@ -102,7 +102,6 @@ static void gvir_manager_class_init(GVirManagerClass *klass)
>                   1,
>                   GVIR_TYPE_CONNECTION);
>  
> -    g_type_class_add_private(klass, sizeof(GVirManagerPrivate));

Drop the empty line here.

[...]
> @@ -124,7 +124,6 @@ static void gvir_network_dhcp_lease_class_init(GVirNetworkDHCPLeaseClass *klass)
>                                                           G_PARAM_PRIVATE |
>                                                           G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirNetworkDHCPLeasePrivate));

Drop the empty line here.

[...]
> @@ -142,7 +142,6 @@ static void gvir_network_filter_class_init(GVirNetworkFilterClass *klass)
>                                                         G_PARAM_CONSTRUCT_ONLY |
>                                                         G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirNetworkFilterPrivate));

Drop the empty line here.

[...]
> @@ -142,7 +142,6 @@ static void gvir_network_class_init(GVirNetworkClass *klass)
>                                                         G_PARAM_CONSTRUCT_ONLY |
>                                                         G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirNetworkPrivate));

Drop the empty line here.

[...]
> @@ -126,7 +126,6 @@ static void gvir_node_device_class_init(GVirNodeDeviceClass *klass)
>                                                         G_PARAM_CONSTRUCT_ONLY |
>                                                         G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirNodeDevicePrivate));

Drop the empty line here.

[...]
> -#define gvir_output_stream_get_type _gvir_output_stream_get_type
> -G_DEFINE_TYPE(GVirOutputStream, gvir_output_stream, G_TYPE_OUTPUT_STREAM);
> -
>  enum
>  {
>      PROP_0,
> @@ -50,6 +47,9 @@ struct _GVirOutputStreamPrivate
>      gsize count;
>  };
>  
> +#define gvir_output_stream_get_type _gvir_output_stream_get_type
> +G_DEFINE_TYPE_WITH_PRIVATE(GVirOutputStream, gvir_output_stream, G_TYPE_OUTPUT_STREAM);
> +

Why did this move around? :D Update it in place please.

[...]
> @@ -196,7 +196,6 @@ static void gvir_output_stream_class_init(GVirOutputStreamClass *klass)
>      GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
>      GOutputStreamClass *goutputstream_class = G_OUTPUT_STREAM_CLASS(klass);
>  
> -    g_type_class_add_private(klass, sizeof(GVirOutputStreamPrivate));
>  

Drop one of the two empty lines here.

[...]
> @@ -141,7 +141,6 @@ static void gvir_secret_class_init(GVirSecretClass *klass)
>                                                         G_PARAM_CONSTRUCT_ONLY |
>                                                         G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirSecretPrivate));

Drop the empty line here.

[...]
> @@ -153,7 +153,6 @@ static void gvir_storage_pool_class_init(GVirStoragePoolClass *klass)
>                                                         G_PARAM_STATIC_STRINGS));
>  
>  
> -    g_type_class_add_private(klass, sizeof(GVirStoragePoolPrivate));

Drop the empty line here.

[...]
> @@ -148,7 +148,6 @@ static void gvir_storage_vol_class_init(GVirStorageVolClass *klass)
>                                                          G_PARAM_CONSTRUCT_ONLY |
>                                                          G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirStorageVolPrivate));

Drop the empty line here.

[...]
> @@ -279,7 +279,6 @@ static void gvir_stream_class_init(GVirStreamClass *klass)
>                                                         G_PARAM_CONSTRUCT_ONLY |
>                                                         G_PARAM_STATIC_STRINGS));
>  
> -    g_type_class_add_private(klass, sizeof(GVirStreamPrivate));

Drop the empty line here.


With the above addressed

  Reviewed-by: Andrea Bolognani <abologna@xxxxxxxxxx>

libvirt-sandbox also needs a similar patch, by the way... O:-)

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux