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_system_reset();
+
+    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
null.

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.

Regards,

Anthony Liguori

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


Reply via email to