All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: Cao jin <caoj.fnst@cn.fujitsu.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/5] PXB: convert to realize()
Date: Tue, 22 Dec 2015 11:35:49 +0200	[thread overview]
Message-ID: <56791975.5050608@redhat.com> (raw)
In-Reply-To: <567914E4.2020400@cn.fujitsu.com>

On 12/22/2015 11:16 AM, Cao jin wrote:
>
>
> On 12/22/2015 03:34 PM, Marcel Apfelbaum wrote:
>> On 12/22/2015 05:58 AM, Cao jin wrote:
>>>
>>>
>>> On 12/21/2015 11:49 PM, Paolo Bonzini wrote:
>>>>
>>>>
>>>> On 20/12/2015 12:38, Cao jin wrote:
>>>>>>>
>>>>>>> +    object_unref(OBJECT(ds));
>>>>>>> +    object_unref(OBJECT(bds));
>>>>>>> +    object_unref(OBJECT(bus));
>>>>>>
>>>>>> I think these should be object_unparent, not unref.
>>>>>>
>>>>>
>>>>> But, it seems these 3 objects isn`t added as a child-property via
>>>>> object_property_add_child() during creation, so OBJECT(ds)->parent(so
>>>>> does the other 2) will be NULL, and so object_unparent will do nothing?
>>>>
>>>> qdev_init_nofail adds them (qdev_init_nofail -> object_property_set_bool
>>>> -> device_set_realized -> object_property_add_child).
>>>>
>>>> If you haven't reached qdev_init_nofail, you should indeed unref ds and
>>>> bds instead.  However, the bus should be unparented because pci_bus_new
>>>> makes it a child of ds (pci_bus_new -> qbus_create -> qbus_realize ->
>>>> object_property_add_child).
>>>>
>>>
>>> Yes...that`s true.
>>>
>>> and @Marcel, I think maybe this is final decision?
>>
>>
>> I say add a debug trace line before pxb_register_bus (or use the debugger)
>> and check ds->parent, bds->parent and bus->parent.
>>
>
> uh..sorry I don`t get it, what does the debug trace line/use debugger mean?
>
>> Run the qemu with -device pxb,bus=80,... and for every one that its parent
>> is not null add unparent. :)
>
> don`t get it too, could you detail it?


Sure, just add something like:

     fprintf(stderr, "ds parent: %p, bus parent... ", ds->parent ...)

Compile and run QEMU with a pxb device:
     <qemu-bin>  -device pxb,bus=80,...

And look for which object has a parent :)

Thanks,
Marcel

>
>>
>> Thanks,
>> Marcel
>>
>>
>>
>>
>>>
>>>> Paolo
>>>>
>>>>
>>>> .
>>>>
>>>
>>
>>
>>
>>
>

  reply	other threads:[~2015-12-22  9:35 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18 11:03 [Qemu-devel] [PATCH 0/5] Convert to realize() Cao jin
2015-12-18 11:03 ` [Qemu-devel] [PATCH 1/5] SH PCI Host: convert " Cao jin
2015-12-18 17:59   ` Paolo Bonzini
2016-01-10 18:13     ` Michael Tokarev
2015-12-18 11:03 ` [Qemu-devel] [PATCH 2/5] igd-passthrough-i440FX: " Cao jin
2015-12-18 18:37   ` Eduardo Habkost
2015-12-18 21:18     ` Markus Armbruster
2015-12-20 11:59       ` Cao jin
2016-01-11 14:32         ` Markus Armbruster
2016-01-12  2:24           ` Cao jin
2015-12-20 11:56     ` Cao jin
2015-12-18 11:03 ` [Qemu-devel] [PATCH 3/5] PXB: " Cao jin
2015-12-18 18:01   ` Paolo Bonzini
2015-12-20 11:38     ` Cao jin
2015-12-21 10:39       ` Cao jin
2015-12-21 15:49       ` Paolo Bonzini
2015-12-22  3:58         ` Cao jin
2015-12-22  7:34           ` Marcel Apfelbaum
2015-12-22  9:16             ` Cao jin
2015-12-22  9:35               ` Marcel Apfelbaum [this message]
2015-12-22  9:52                 ` Cao jin
2015-12-22 11:40                 ` Cao jin
2015-12-20 10:22   ` Marcel Apfelbaum
2015-12-20 10:48     ` Cao jin
2015-12-20 11:21       ` Marcel Apfelbaum
2015-12-21  2:59         ` Cao jin
2015-12-21 10:08           ` Marcel Apfelbaum
2015-12-21 10:19             ` Cao jin
2015-12-18 11:03 ` [Qemu-devel] [PATCH 4/5] gt64120: " Cao jin
2015-12-18 17:59   ` Paolo Bonzini
2016-01-10 18:12     ` Michael Tokarev
2015-12-18 11:03 ` [Qemu-devel] [PATCH 5/5] xen-pvdevice: " Cao jin
2015-12-18 18:00   ` Paolo Bonzini
2015-12-21  5:52     ` Cao jin
2015-12-21 15:00       ` Stefano Stabellini
2015-12-21 15:15   ` Stefano Stabellini
2015-12-22  1:24     ` Cao jin
2015-12-22  2:40       ` Cao jin
2015-12-18 11:08 ` [Qemu-devel] [PATCH 0/5] Convert " Cao jin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56791975.5050608@redhat.com \
    --to=marcel@redhat.com \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.