On 17/12/24 12:09, Ani Sinha wrote:


On 17 Dec 2024, at 4:11 PM, Philippe Mathieu-Daudé <phi...@linaro.org> wrote:

On 17/12/24 11:06, Ani Sinha wrote:
On 16 Dec 2024, at 8:35 PM, Philippe Mathieu-Daudé <phi...@linaro.org> wrote:

Hi Ani,


+static void vmfwupdate_device_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    /* we are not interested in migration - so no need to populate dc->vmsd */
+    dc->desc = "VM firmware blob update device";
+    dc->realize = vmfwupdate_realize;
+    dc->hotpluggable = false;
+    device_class_set_props(dc, vmfwupdate_properties);
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);

How is this device instantiated?
Something like this:
$ ./qemu-system-x86_64 -device vmfwupdate
VNC server running on ::1:5900

But this device is not marked as allowed to be created on the
command line with:

    dc->user_creatable = true;

Am I missing something?

Isnt’ it true by default? See device_class_init(). Only when it’s a private 
device we need to set it explicitly to false.

Let me know if its me who is missing something :-)

Indeed, you are correct! I forgot about that default.

Reply via email to