On 2025/07/16 0:43, Paolo Abeni wrote:
On 7/15/25 9:59 AM, Akihiko Odaki wrote:
On 2025/07/11 22:02, Paolo Abeni wrote:
@@ -785,11 +821,12 @@ VirtioStatus *qmp_x_query_virtio_status(const char *path, 
Error **errp)
           status->vhost_dev->nvqs = hdev->nvqs;
           status->vhost_dev->vq_index = hdev->vq_index;
           status->vhost_dev->features =
-            qmp_decode_features(vdev->device_id, hdev->features);
+            qmp_decode_features(vdev->device_id, hdev->features_array);
           status->vhost_dev->acked_features =
-            qmp_decode_features(vdev->device_id, hdev->acked_features);
+            qmp_decode_features(vdev->device_id, hdev->acked_features_array);
           status->vhost_dev->backend_features =
-            qmp_decode_features(vdev->device_id, hdev->backend_features);
+            qmp_decode_features(vdev->device_id, hdev->backend_features_array);
+
           status->vhost_dev->protocol_features =
               qmp_decode_protocols(hdev->protocol_features);
           status->vhost_dev->max_queues = hdev->max_queues;
diff --git a/hw/virtio/virtio-qmp.h b/hw/virtio/virtio-qmp.h
index 245a446a56..e0a1e49035 100644
--- a/hw/virtio/virtio-qmp.h
+++ b/hw/virtio/virtio-qmp.h
@@ -18,6 +18,7 @@
   VirtIODevice *qmp_find_virtio_device(const char *path);
   VirtioDeviceStatus *qmp_decode_status(uint8_t bitmap);
   VhostDeviceProtocols *qmp_decode_protocols(uint64_t bitmap);
-VirtioDeviceFeatures *qmp_decode_features(uint16_t device_id, uint64_t bitmap);
+VirtioDeviceFeatures *qmp_decode_features(uint16_t device_id,
+                                          const uint64_t *bitmap);
#endif
diff --git a/qapi/virtio.json b/qapi/virtio.json
index 73df718a26..f0442e144b 100644
--- a/qapi/virtio.json
+++ b/qapi/virtio.json
@@ -488,14 +488,18 @@
   #     unique features)
   #
   # @unknown-dev-features: Virtio device features bitmap that have not
-#     been decoded
+#     been decoded (lower 64 bit)
+#
+# @unknown-dev-features-dword2: Virtio device features bitmap that have not
+#     been decoded (bits 65-128)
   #
   # Since: 7.2
   ##
   { 'struct': 'VirtioDeviceFeatures',
     'data': { 'transports': [ 'str' ],
               '*dev-features': [ 'str' ],
-            '*unknown-dev-features': 'uint64' } }
+            '*unknown-dev-features': 'uint64',
+            '*unknown-dev-features-dword2': 'uint64' } }

Let's omit "dword" for consistency with unknown-dev-features, which is
also uint64 but don't have the keyword.

Ok. Can I infer that is actually legit to update a qapi struct
definition? It's not clear to me it such change violates any qemu
assumptions.

Adding a property is fine but renaming one is not as it can break application that use QAPI such as libvirt. For some guidance, please see: docs/devel/qapi-code-gen.rst

Reply via email to