@samitouri / QOSamiQemu / commits / 43cdf3d2bb

hw/i3c: keep _bytes aliases for renamed queue-capacity properties

The command-response/tx-rx/ibi queue-capacity properties were renamed from "-bytes" to "-words". The "-bytes" names are user-visible and shipped in v11.0.0 (reachable via e.g. -global driver=dw.i3c,property=tx-rx-queue-capacity-bytes,...), so register them as aliases of the new names to keep existing command lines working. object_property_add_alias() forwards both reads and writes to the target property, so the old names behave exactly as before; introspection and qom-get/qom-set continue to work under either name. Signed-off-by: Jithu Joseph <jithu.joseph@oss.qualcomm.com> Reviewed-by: Jamin Lin <jamin_lin@aspeedtech.com> Link: https://lore.kernel.org/qemu-devel/20260604142207.2118098-4-jithu.joseph@oss.qualcomm.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Jithu Joseph committed Jun 4, 2026 at 07:22 UTC 43cdf3d2bbe24021ac4753fbb8cfaeb90e6d86f1
1 file changed +22
hw/i3c/dw-i3c.c
+22
@@ -1830,6 +1830,27 @@ static void dw_i3c_realize(DeviceState *dev, Error **errp)
1830 bc->ibi_finish = dw_i3c_ibi_finish;
1831 }
1832
1833 +/*
1834 + * The *-queue-capacity-bytes properties shipped in v11.0.0 under names that
1835 + * implied a byte count, but the values are 32-bit word counts (they are passed
1836 + * straight to fifo32_create()). They were renamed to *-queue-capacity-words;
1837 + * keep the old names working as aliases so existing command lines using e.g.
1838 + * -global driver=dw.i3c,property=tx-rx-queue-capacity-bytes,... don't break.
1839 + */
1840 +static void dw_i3c_init(Object *obj)
1841 +{
1842 + static const char *const alias[][2] = {
1843 + { "command-response-queue-capacity-bytes",
1844 + "command-response-queue-capacity-words" },
1845 + { "tx-rx-queue-capacity-bytes", "tx-rx-queue-capacity-words" },
1846 + { "ibi-queue-capacity-bytes", "ibi-queue-capacity-words" },
1847 + };
1848 +
1849 + for (int i = 0; i < ARRAY_SIZE(alias); i++) {
1850 + object_property_add_alias(obj, alias[i][0], obj, alias[i][1]);
1851 + }
1852 +}
1853 +
1854 static const Property dw_i3c_properties[] = {
1855 DEFINE_PROP_UINT8("device-id", DWI3C, cfg.id, 0),
1856 DEFINE_PROP_UINT8("command-response-queue-capacity-words", DWI3C,
@@ -1868,6 +1889,7 @@ static const TypeInfo dw_i3c_types[] = {
1889 .name = TYPE_DW_I3C,
1890 .parent = TYPE_SYS_BUS_DEVICE,
1891 .instance_size = sizeof(DWI3C),
1892 + .instance_init = dw_i3c_init,
1893 .class_init = dw_i3c_class_init,
1894 },
1895 };