[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qemu v2 1/2] memory/hmp: Print owners/parents in
From: |
Alexey Kardashevskiy |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
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