[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/41] hw/scsi/megasas: Use device_class_set_props_n
From: |
Paolo Bonzini |
Subject: |
[PULL 15/41] hw/scsi/megasas: Use device_class_set_props_n |
Date: |
Thu, 19 Dec 2024 09:32:02 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
We must remove DEFINE_PROP_END_OF_LIST so the count is correct.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Link:
20241216035109.3486070-16-richard.henderson@linaro.org">https://lore.kernel.org/r/20241216035109.3486070-16-richard.henderson@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/scsi/megasas.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 8323cd18e3a..7f012c218b4 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -2459,7 +2459,6 @@ static const Property megasas_properties_gen1[] = {
DEFINE_PROP_ON_OFF_AUTO("msix", MegasasState, msix, ON_OFF_AUTO_AUTO),
DEFINE_PROP_BIT("use_jbod", MegasasState, flags,
MEGASAS_FLAG_USE_JBOD, false),
- DEFINE_PROP_END_OF_LIST(),
};
static const Property megasas_properties_gen2[] = {
@@ -2473,7 +2472,6 @@ static const Property megasas_properties_gen2[] = {
DEFINE_PROP_ON_OFF_AUTO("msix", MegasasState, msix, ON_OFF_AUTO_AUTO),
DEFINE_PROP_BIT("use_jbod", MegasasState, flags,
MEGASAS_FLAG_USE_JBOD, false),
- DEFINE_PROP_END_OF_LIST(),
};
typedef struct MegasasInfo {
@@ -2488,6 +2486,7 @@ typedef struct MegasasInfo {
int osts;
const VMStateDescription *vmsd;
const Property *props;
+ size_t props_count;
InterfaceInfo *interfaces;
} MegasasInfo;
@@ -2504,6 +2503,7 @@ static struct MegasasInfo megasas_devices[] = {
.osts = MFI_1078_RM | 1,
.vmsd = &vmstate_megasas_gen1,
.props = megasas_properties_gen1,
+ .props_count = ARRAY_SIZE(megasas_properties_gen1),
.interfaces = (InterfaceInfo[]) {
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ },
@@ -2520,6 +2520,7 @@ static struct MegasasInfo megasas_devices[] = {
.osts = MFI_GEN2_RM,
.vmsd = &vmstate_megasas_gen2,
.props = megasas_properties_gen2,
+ .props_count = ARRAY_SIZE(megasas_properties_gen2),
.interfaces = (InterfaceInfo[]) {
{ INTERFACE_PCIE_DEVICE },
{ }
@@ -2546,7 +2547,7 @@ static void megasas_class_init(ObjectClass *oc, void
*data)
e->osts = info->osts;
e->product_name = info->product_name;
e->product_version = info->product_version;
- device_class_set_props(dc, info->props);
+ device_class_set_props_n(dc, info->props, info->props_count);
device_class_set_legacy_reset(dc, megasas_scsi_reset);
dc->vmsd = info->vmsd;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
--
2.47.1
- [PULL 04/41] target/s390x: Use s390x_cpu_properties for system mode only, (continued)
- [PULL 04/41] target/s390x: Use s390x_cpu_properties for system mode only, Paolo Bonzini, 2024/12/19
- [PULL 06/41] hw/ppc: Only register spapr_nvdimm_properties if CONFIG_LIBPMEM, Paolo Bonzini, 2024/12/19
- [PULL 05/41] hw/pci-host/astro: Remove empty Property list, Paolo Bonzini, 2024/12/19
- [PULL 08/41] hw/s390x: Remove empty Property lists, Paolo Bonzini, 2024/12/19
- [PULL 09/41] hw/xen: Remove empty Property lists, Paolo Bonzini, 2024/12/19
- [PULL 10/41] hw/sparc: Remove empty Property lists, Paolo Bonzini, 2024/12/19
- [PULL 11/41] hw/virtio: Remove empty Property lists, Paolo Bonzini, 2024/12/19
- [PULL 12/41] include/hw/qdev-core: Detect most empty Property lists at compile time, Paolo Bonzini, 2024/12/19
- [PULL 07/41] hw/tricore: Remove empty Property lists, Paolo Bonzini, 2024/12/19
- [PULL 13/41] hw/core: Introduce device_class_set_props_n, Paolo Bonzini, 2024/12/19
- [PULL 15/41] hw/scsi/megasas: Use device_class_set_props_n,
Paolo Bonzini <=
- [PULL 14/41] migration: Use device_class_set_props_n, Paolo Bonzini, 2024/12/19
- [PULL 16/41] hw/arm/armsse: Use device_class_set_props_n, Paolo Bonzini, 2024/12/19
- [PULL 17/41] rust/qemu-api: Use device_class_set_props_n, Paolo Bonzini, 2024/12/19
- [PULL 18/41] hw/core: Replace device_class_set_props with a macro, Paolo Bonzini, 2024/12/19
- [PULL 19/41] target/riscv: Do not abuse DEFINE_PROP_END_OF_LIST, Paolo Bonzini, 2024/12/19
- [PULL 22/41] hw/core/qdev-properties: Constify Property argument to object_field_prop_ptr, Paolo Bonzini, 2024/12/19
- [PULL 21/41] include/hw/qdev-properties: Shrink struct Property, Paolo Bonzini, 2024/12/19
- [PULL 23/41] hw/core/qdev-properties: Constify Property argument to PropertyInfo.print, Paolo Bonzini, 2024/12/19
- [PULL 24/41] Constify all opaque Property pointers, Paolo Bonzini, 2024/12/19
- [PULL 20/41] include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST, Paolo Bonzini, 2024/12/19