Paolo Bonzini b09995aef1 qdev: drop extra references at creation time
qdev_free and qbus_free have to do unparent+unref, because nobody else
drops the initial reference (the one included by object_initialize)
before them.

For device_init_func and do_device_add, this is trivially correct,
since the DeviceState goes out of scope.

For qdev_create, qdev_try_create and qbus_init, it is a bit more tricky.
What we are doing here is just assuming that the caller knows what it's
doing, and won't call qdev_free/qbus_free while the device is still there.
This is a pretty reasonable assumption and (behind the scenes) is also
what GObject/GTK does.  GTK actually has a "floating reference" that
goes away as soon as the caller does gtk_container_add or something
like that, but in the end qbus_init and qdev_try_create are already
adding the new object to its qdev parent!  So in the end the two solutions
are the same.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-01 15:53:11 -06:00
..
2013-02-01 00:13:41 +01:00
2013-01-14 10:23:50 -06:00
2013-02-01 15:53:09 -06:00
2013-02-01 11:03:01 -06:00
2013-01-10 15:11:53 -06:00
2013-01-25 22:02:55 +01:00
2013-01-25 22:02:55 +01:00
2013-01-10 15:11:53 -06:00
2012-10-23 08:58:25 -05:00
2013-01-10 15:11:53 -06:00
2012-06-21 16:06:11 +00:00
2013-01-10 15:11:53 -06:00
2012-12-17 13:02:26 +02:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2012-12-19 08:31:31 +01:00
2012-12-19 08:31:31 +01:00
2013-01-10 15:11:53 -06:00
2012-12-19 08:31:31 +01:00
2013-02-01 11:03:00 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2012-03-14 22:20:26 +01:00
2012-12-19 08:31:31 +01:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-25 22:02:55 +01:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 11:03:01 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 10:43:24 -06:00
2013-02-01 11:03:01 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 11:03:01 -06:00
2012-10-23 08:58:25 -05:00
2012-12-19 08:31:31 +01:00
2013-01-10 15:11:53 -06:00
2012-12-19 08:31:31 +01:00
2012-10-23 08:58:25 -05:00
2012-12-19 08:31:31 +01:00
2013-02-01 11:03:00 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2012-10-23 08:58:25 -05:00
2012-10-10 11:13:32 +10:00
2012-10-10 11:13:32 +10:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-07 12:57:24 +01:00
2013-01-07 12:57:24 +01:00
2012-12-19 08:32:39 +01:00
2013-02-01 10:43:24 -06:00
2013-02-01 10:43:24 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2012-11-26 14:25:42 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-30 01:31:09 +02:00
2013-02-01 00:13:41 +01:00
2013-01-10 15:11:53 -06:00
2012-10-23 08:58:25 -05:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 10:43:28 -06:00
2013-01-14 10:23:50 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-15 18:26:18 -06:00
2013-02-01 11:03:00 -06:00
2013-02-01 11:03:00 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 10:43:24 -06:00
2012-10-23 08:58:25 -05:00
2012-10-23 08:58:25 -05:00
2013-01-25 22:02:54 +01:00
2013-01-25 22:02:54 +01:00
2013-01-26 13:15:37 +00:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 11:03:01 -06:00
2012-10-23 08:58:25 -05:00
2012-11-12 16:42:56 +01:00
2012-03-14 22:20:26 +01:00
2012-03-14 22:20:26 +01:00
2013-02-01 11:03:00 -06:00
2012-12-19 08:31:31 +01:00
2013-01-10 15:11:53 -06:00
2013-02-01 11:03:00 -06:00
2013-02-01 11:03:00 -06:00
2013-02-01 11:03:01 -06:00
2012-12-19 08:31:31 +01:00
2012-11-10 13:49:20 +00:00
2012-10-23 08:58:25 -05:00
2012-10-23 08:58:25 -05:00
2012-10-23 08:58:25 -05:00
2013-02-01 11:03:00 -06:00
2012-07-27 21:13:01 +00:00
2013-01-10 15:11:53 -06:00
2013-01-30 01:31:09 +02:00
2013-01-10 15:11:53 -06:00
2013-01-14 08:59:39 +01:00
2013-01-17 10:24:52 -02:00
2013-01-14 10:23:50 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 11:03:01 -06:00
2013-02-01 11:03:00 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2012-12-04 13:52:43 +01:00
2012-12-04 13:52:43 +01:00
2012-10-23 08:58:25 -05:00
2013-01-18 19:06:57 +01:00
2013-01-27 23:04:26 +01:00
2012-04-12 11:14:29 +01:00
2012-10-23 08:58:25 -05:00
2012-10-23 08:58:25 -05:00
2012-10-23 08:58:25 -05:00
2013-02-01 10:43:24 -06:00
2013-01-15 04:09:13 +01:00
2012-12-19 08:31:31 +01:00
2013-02-01 11:03:01 -06:00
2013-01-22 11:01:07 +01:00
2013-02-01 00:13:41 +01:00
2013-02-01 11:03:01 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2012-12-19 08:31:31 +01:00
2013-01-10 15:11:53 -06:00
2012-12-19 08:32:39 +01:00
2013-01-10 15:11:53 -06:00
2013-01-14 10:23:50 -06:00
2013-01-24 09:45:03 -06:00
2013-01-10 15:11:53 -06:00
2012-10-23 08:58:25 -05:00
2013-01-10 15:11:53 -06:00
2012-10-23 08:58:25 -05:00
2012-10-23 08:58:25 -05:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 11:03:00 -06:00
2013-02-01 11:03:00 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2012-10-10 11:13:32 +10:00
2013-02-01 11:03:00 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-16 12:14:20 -06:00
2013-01-16 12:14:20 -06:00
2013-01-10 15:11:53 -06:00
2013-01-25 22:02:53 +01:00
2013-01-17 10:24:52 -02:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 11:03:02 -06:00
2013-02-01 11:03:02 -06:00
2013-02-01 11:03:02 -06:00
2013-02-01 11:03:02 -06:00
2013-02-01 11:03:03 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-02-01 10:43:24 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2012-12-17 13:02:26 +02:00
2013-02-01 11:03:00 -06:00
2013-01-15 04:09:13 +01:00
2013-02-01 11:03:00 -06:00
2013-02-01 11:03:00 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-10 15:11:53 -06:00
2013-01-15 18:26:18 -06:00
2013-01-10 15:11:53 -06:00