[Top][All Lists]

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

Re: [Qemu-devel] [PATCH] qdev: Reset hotplugged devices

From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] qdev: Reset hotplugged devices
Date: Sat, 21 Aug 2010 10:19:49 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100713 Lightning/1.0b1 Thunderbird/3.0.6

On 08/21/2010 05:07 AM, Markus Armbruster wrote:
diff --git a/vl.c b/vl.c
index b3e3676..5de1688 100644
--- a/vl.c
+++ b/vl.c
@@ -2968,6 +2968,9 @@ int main(int argc, char **argv, char **envp)

+    qemu_register_reset((void *)qbus_reset_all, sysbus_get_default());
This is inconsistent with qdev_create().  qdev_create() uses null.

I agree with the N.B. in your commit message: the root of the tree
should be explicit.  Implicit is too much magic.  But you create a
second kind of magic.  I don't object to how that works, only to having
two different kinds.

I'd suggest you either make your qemu_reset_all() work like existing
qdev_create(), i.e. null means root.  Or change qdev_create() to work
like your qemu_reset_all(), i.e. use sysbus_get_default() instead of

I'm getting rid of the NULL crap too although it's lower on my qdev TODO.. sysbus_get_default() is a heck of a lot easier to grep for though than NULL so I'd prefer to use this for now.


Anthony Liguori

      if (loadvm) {
          if (load_vmstate(loadvm)<  0) {
              autostart = 0;

reply via email to

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