qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/5] qdev: add uc_requires_machine_allowance flag


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/5] qdev: add uc_requires_machine_allowance flag
Date: Thu, 31 Mar 2022 12:21:57 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 30/3/22 18:12, Damien Hedde wrote:
This flag will be used in device_add to check if
the device needs special allowance from the machine
model.

It will replace the current check based only on the
device being a TYPE_SYB_BUS_DEVICE.

Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
---
  include/hw/qdev-core.h | 6 ++++++
  hw/core/qdev.c         | 1 +
  hw/core/sysbus.c       | 1 +
  3 files changed, 8 insertions(+)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 92c3d65208..f5a05ced39 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -123,6 +123,12 @@ struct DeviceClass {
       */
      bool user_creatable;
      bool hotpluggable;
+    /*
+     * Some devices (eg: sysbus devices) are only user-creatable if
+     * the machine allowed it. user_creatable need still to be set to
+     * true, this is an additional constraint.
+     */
+    bool uc_requires_machine_allowance;

Why not name it user_creatable_requires_machine_allowance? Also I'd put
it just after user_creatable.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]