hw/scsi/megasas: Use device_class_set_props_n
We must remove DEFINE_PROP_END_OF_LIST so the count is correct. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Lei Yang <leiyang@redhat.com> Link: https://lore.kernel.org/r/20241218134251.4724-16-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
0017f5713a
commit
0e9cb0b410
@ -2459,7 +2459,6 @@ static const Property megasas_properties_gen1[] = {
|
|||||||
DEFINE_PROP_ON_OFF_AUTO("msix", MegasasState, msix, ON_OFF_AUTO_AUTO),
|
DEFINE_PROP_ON_OFF_AUTO("msix", MegasasState, msix, ON_OFF_AUTO_AUTO),
|
||||||
DEFINE_PROP_BIT("use_jbod", MegasasState, flags,
|
DEFINE_PROP_BIT("use_jbod", MegasasState, flags,
|
||||||
MEGASAS_FLAG_USE_JBOD, false),
|
MEGASAS_FLAG_USE_JBOD, false),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const Property megasas_properties_gen2[] = {
|
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_ON_OFF_AUTO("msix", MegasasState, msix, ON_OFF_AUTO_AUTO),
|
||||||
DEFINE_PROP_BIT("use_jbod", MegasasState, flags,
|
DEFINE_PROP_BIT("use_jbod", MegasasState, flags,
|
||||||
MEGASAS_FLAG_USE_JBOD, false),
|
MEGASAS_FLAG_USE_JBOD, false),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct MegasasInfo {
|
typedef struct MegasasInfo {
|
||||||
@ -2488,6 +2486,7 @@ typedef struct MegasasInfo {
|
|||||||
int osts;
|
int osts;
|
||||||
const VMStateDescription *vmsd;
|
const VMStateDescription *vmsd;
|
||||||
const Property *props;
|
const Property *props;
|
||||||
|
size_t props_count;
|
||||||
InterfaceInfo *interfaces;
|
InterfaceInfo *interfaces;
|
||||||
} MegasasInfo;
|
} MegasasInfo;
|
||||||
|
|
||||||
@ -2504,6 +2503,7 @@ static struct MegasasInfo megasas_devices[] = {
|
|||||||
.osts = MFI_1078_RM | 1,
|
.osts = MFI_1078_RM | 1,
|
||||||
.vmsd = &vmstate_megasas_gen1,
|
.vmsd = &vmstate_megasas_gen1,
|
||||||
.props = megasas_properties_gen1,
|
.props = megasas_properties_gen1,
|
||||||
|
.props_count = ARRAY_SIZE(megasas_properties_gen1),
|
||||||
.interfaces = (InterfaceInfo[]) {
|
.interfaces = (InterfaceInfo[]) {
|
||||||
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
|
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
|
||||||
{ },
|
{ },
|
||||||
@ -2520,6 +2520,7 @@ static struct MegasasInfo megasas_devices[] = {
|
|||||||
.osts = MFI_GEN2_RM,
|
.osts = MFI_GEN2_RM,
|
||||||
.vmsd = &vmstate_megasas_gen2,
|
.vmsd = &vmstate_megasas_gen2,
|
||||||
.props = megasas_properties_gen2,
|
.props = megasas_properties_gen2,
|
||||||
|
.props_count = ARRAY_SIZE(megasas_properties_gen2),
|
||||||
.interfaces = (InterfaceInfo[]) {
|
.interfaces = (InterfaceInfo[]) {
|
||||||
{ INTERFACE_PCIE_DEVICE },
|
{ INTERFACE_PCIE_DEVICE },
|
||||||
{ }
|
{ }
|
||||||
@ -2546,7 +2547,7 @@ static void megasas_class_init(ObjectClass *oc, void *data)
|
|||||||
e->osts = info->osts;
|
e->osts = info->osts;
|
||||||
e->product_name = info->product_name;
|
e->product_name = info->product_name;
|
||||||
e->product_version = info->product_version;
|
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);
|
device_class_set_legacy_reset(dc, megasas_scsi_reset);
|
||||||
dc->vmsd = info->vmsd;
|
dc->vmsd = info->vmsd;
|
||||||
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
|
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user