From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH qemu v2 1/2] memory/hmp: Print owners/parents in "info mtree"
Date: Wed, 30 May 2018 14:57:29 +1000 [thread overview]
Message-ID: <c3558bb9-3e13-3fcf-61f2-2925ce16c14e@ozlabs.ru> (raw)
In-Reply-To: <d15375ef-2a6a-9a72-d0ef-0394c8e6832c@ozlabs.ru>
On 3/5/18 3:40 pm, Alexey Kardashevskiy wrote:
> On 30/4/18 7:53 pm, Paolo Bonzini wrote:
>> On 30/04/2018 08:25, Alexey Kardashevskiy wrote:
>>> + DeviceState *dev = (DeviceState *) object_dynamic_cast(obj, TYPE_DEVICE);
>>> + const char *id = object_property_print(obj, "id", true, NULL);
>>
>> The only objects that have an "id" property are memdevs. If you want to
>> special case their printing too, it's probably a good idea (that is,
>> print one of "dev id=ID"/"memdev id=ID"/"obj path=PATH").
>>
>> Otherwise, I can also queue this patch as is, but I'd remove the "id"
>> property handling because I'm going to submit a small series to remove
>> the "id" property altogether.
>>
>> Let me know what you prefer!
>
>
> I choose to wait and repost, thanks :)
I waited, checked https://git.qemu.org/?p=qemu.git;a=commitdiff;h=29de4e
that "id" is no more and then grepped:
hw/intc/apic_common.c|489| object_property_add(obj, "id", "uint32",
hw/ppc/spapr_drc.c|557| object_property_add_uint32_ptr(obj, "id", &drc->id,
NULL);
This does not look like "remove the "id" property altogether" :) Does this
mean we still rather want to print QOM's "id"? spapr_drc does not own MRs
and APIC seems not to either.
>
>
>>
>> Thanks,
>>
>> Paolo
>>
>>> + mon_printf(f, " %s:{%s", label, dev ? "dev" : "obj");
>>> + if (dev ? dev->id : id) {
>>> + mon_printf(f, " id=%s", dev ? dev->id : id);
>>> + } else {
>>> + gchar *canonical_path = object_get_canonical_path(obj);
>>> + mon_printf(f, " path=%s", canonical_path);
>>> + g_free(canonical_path);
>>> + }
>>> + mon_printf(f, "}");
>>
>
>
--
Alexey
next prev parent reply other threads:[~2018-05-30 4:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-30 6:25 [Qemu-devel] [PATCH qemu v2 0/2] memory/hmp: Print owners/parents in "info mtree" Alexey Kardashevskiy
2018-04-30 6:25 ` [Qemu-devel] [PATCH qemu v2 1/2] " Alexey Kardashevskiy
2018-04-30 9:53 ` Paolo Bonzini
2018-05-03 5:40 ` Alexey Kardashevskiy
2018-05-30 4:57 ` Alexey Kardashevskiy [this message]
2018-05-30 10:30 ` Paolo Bonzini
2018-04-30 6:25 ` [Qemu-devel] [PATCH qemu v2 2/2] object: Handle objects with no parents Alexey Kardashevskiy
2018-04-30 9:51 ` Paolo Bonzini
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=c3558bb9-3e13-3fcf-61f2-2925ce16c14e@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=imammedo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).