[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC V2 0/9] qemu-machine as a QOM object
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH RFC V2 0/9] qemu-machine as a QOM object |
Date: |
Mon, 03 Mar 2014 15:10:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Am 03.03.2014 14:17, schrieb Marcel Apfelbaum:
> On Mon, 2014-03-03 at 13:56 +0100, Paolo Bonzini wrote:
>> Il 03/03/2014 13:07, Marcel Apfelbaum ha scritto:
>>> I see no reason why not, the main problem I see is the use of those wrappers
>>> or setters/getters, I suspect that the usage will be:
>>> 1. global QOM query to get the machine
>>> 2. Use this wrappers(getters/setters) to do query/alter the machine.
>>
>> I think setters should appear only in vl.c.
> Conclusion:
> 1. It is OK to add getters for QemuMachineState fields in the corresponding
> header file. They can be used when the caller "knows" the object type.
> 2. In order to populate the fields, static setters that access the internal
> fields
> are also OK - as long as their scope is very small(e.g: vl.c) and not code
> wide.
+1
QOM does not prohibit writing methods that are in fact getters or
setters. The question we have used as guideline is whether the
information of that field is relevant for QMP-based management tools
(e.g., ACPI) or duplicating QOM getters/setters needed for internal
infrastructure (s390x).
Cheers,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- Re: [Qemu-devel] [PATCH RFC V2 2/9] vl: use qemu machine QOM class instead of global machines list, (continued)
Re: [Qemu-devel] [PATCH RFC V2 2/9] vl: use qemu machine QOM class instead of global machines list, Andreas Färber, 2014/03/03
[Qemu-devel] [PATCH RFC V2 5/9] qapi: output visitor crashes qemu if it encounters a NULL value, Marcel Apfelbaum, 2014/03/02
Re: [Qemu-devel] [PATCH RFC V2 0/9] qemu-machine as a QOM object, Paolo Bonzini, 2014/03/03