[PATCH v2 4/6] hw/i386/pc: Remove unneeded class attribute "kvmclock_enabled"

Bernhard Beschow posted 6 patches 9 months ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Jason Wang <jasowang@redhat.com>, David Woodhouse <dwmw2@infradead.org>, Paul Durrant <paul@xen.org>, Sergio Lopez <slp@redhat.com>
There is a newer version of this series
[PATCH v2 4/6] hw/i386/pc: Remove unneeded class attribute "kvmclock_enabled"
Posted by Bernhard Beschow 9 months ago
PCMachineClass introduces the attribute into the class hierarchy and sets it to
true. There is no sub class overriding the attribute. Commit 30d2a17b46e9
"hw/i386: Remove the deprecated machines 0.12 up to 0.15" removed the last
overrides of this attribute. The attribute is now unneeded and can be removed.

Fixes: 30d2a17b46e9 "hw/i386: Remove the deprecated machines 0.12 up to 0.15"
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 include/hw/i386/pc.h | 1 -
 hw/i386/pc.c         | 1 -
 hw/i386/pc_piix.c    | 2 +-
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 27834043c3..4bb1899602 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -92,7 +92,6 @@ struct PCMachineClass {
 
     /* Device configuration: */
     bool pci_enabled;
-    bool kvmclock_enabled;
     const char *default_south_bridge;
 
     /* Compat options: */
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 353edeb2ea..a80f809b83 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1799,7 +1799,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
     pcmc->smbios_uuid_encoded = true;
     pcmc->gigabyte_align = true;
     pcmc->has_reserved_memory = true;
-    pcmc->kvmclock_enabled = true;
     pcmc->enforce_aligned_dimm = true;
     pcmc->enforce_amd_1tb_hole = true;
     /* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K reported
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 814d24326d..49d5d48db9 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -184,7 +184,7 @@ static void pc_init1(MachineState *machine,
     pc_machine_init_sgx_epc(pcms);
     x86_cpus_init(x86ms, pcmc->default_cpu_version);
 
-    if (kvm_enabled() && pcmc->kvmclock_enabled) {
+    if (kvm_enabled()) {
         kvmclock_create(pcmc->kvmclock_create_always);
     }
 
-- 
2.44.0
Re: [PATCH v2 4/6] hw/i386/pc: Remove unneeded class attribute "kvmclock_enabled"
Posted by Zhao Liu 9 months ago
On Sat, Feb 24, 2024 at 02:58:49PM +0100, Bernhard Beschow wrote:
> Date: Sat, 24 Feb 2024 14:58:49 +0100
> From: Bernhard Beschow <shentey@gmail.com>
> Subject: [PATCH v2 4/6] hw/i386/pc: Remove unneeded class attribute
>  "kvmclock_enabled"
> X-Mailer: git-send-email 2.44.0
> 
> PCMachineClass introduces the attribute into the class hierarchy and sets it to
> true. There is no sub class overriding the attribute. Commit 30d2a17b46e9
> "hw/i386: Remove the deprecated machines 0.12 up to 0.15" removed the last
> overrides of this attribute. The attribute is now unneeded and can be removed.
> 
> Fixes: 30d2a17b46e9 "hw/i386: Remove the deprecated machines 0.12 up to 0.15"
> Cc: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>  include/hw/i386/pc.h | 1 -
>  hw/i386/pc.c         | 1 -
>  hw/i386/pc_piix.c    | 2 +-
>  3 files changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>

> 
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 27834043c3..4bb1899602 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -92,7 +92,6 @@ struct PCMachineClass {
>  
>      /* Device configuration: */
>      bool pci_enabled;
> -    bool kvmclock_enabled;
>      const char *default_south_bridge;
>  
>      /* Compat options: */
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 353edeb2ea..a80f809b83 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1799,7 +1799,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
>      pcmc->smbios_uuid_encoded = true;
>      pcmc->gigabyte_align = true;
>      pcmc->has_reserved_memory = true;
> -    pcmc->kvmclock_enabled = true;
>      pcmc->enforce_aligned_dimm = true;
>      pcmc->enforce_amd_1tb_hole = true;
>      /* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K reported
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 814d24326d..49d5d48db9 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -184,7 +184,7 @@ static void pc_init1(MachineState *machine,
>      pc_machine_init_sgx_epc(pcms);
>      x86_cpus_init(x86ms, pcmc->default_cpu_version);
>  
> -    if (kvm_enabled() && pcmc->kvmclock_enabled) {
> +    if (kvm_enabled()) {
>          kvmclock_create(pcmc->kvmclock_create_always);
>      }
>  
> -- 
> 2.44.0
> 
>
Re: [PATCH v2 4/6] hw/i386/pc: Remove unneeded class attribute "kvmclock_enabled"
Posted by Thomas Huth 9 months ago
On 24/02/2024 14.58, Bernhard Beschow wrote:
> PCMachineClass introduces the attribute into the class hierarchy and sets it to
> true. There is no sub class overriding the attribute. Commit 30d2a17b46e9
> "hw/i386: Remove the deprecated machines 0.12 up to 0.15" removed the last
> overrides of this attribute. The attribute is now unneeded and can be removed.
> 
> Fixes: 30d2a17b46e9 "hw/i386: Remove the deprecated machines 0.12 up to 0.15"
> Cc: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   include/hw/i386/pc.h | 1 -
>   hw/i386/pc.c         | 1 -
>   hw/i386/pc_piix.c    | 2 +-
>   3 files changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>
Re: [PATCH v2 4/6] hw/i386/pc: Remove unneeded class attribute "kvmclock_enabled"
Posted by Philippe Mathieu-Daudé 9 months ago
On 24/2/24 14:58, Bernhard Beschow wrote:
> PCMachineClass introduces the attribute into the class hierarchy and sets it to
> true. There is no sub class overriding the attribute. Commit 30d2a17b46e9
> "hw/i386: Remove the deprecated machines 0.12 up to 0.15" removed the last
> overrides of this attribute. The attribute is now unneeded and can be removed.
> 
> Fixes: 30d2a17b46e9 "hw/i386: Remove the deprecated machines 0.12 up to 0.15"
> Cc: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   include/hw/i386/pc.h | 1 -
>   hw/i386/pc.c         | 1 -
>   hw/i386/pc_piix.c    | 2 +-
>   3 files changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>