qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [RFC 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface
       [not found]       ` <5388A754.6090806@redhat.com>
@ 2014-06-05 10:10         ` Igor Mammedov
  2014-06-05 12:42           ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Mammedov @ 2014-06-05 10:10 UTC (permalink / raw)
  To: Eric Blake; +Cc: vasilis.liaskovitis, mst, pkrempa, qemu-devel, lcapitulino

On Fri, 30 May 2014 09:44:20 -0600
Eric Blake <eblake@redhat.com> wrote:

> On 05/30/2014 09:39 AM, Igor Mammedov wrote:
> 
> >>> +# @source_event: Arg0 - An Integer containing the source event
> >>> +#
> >>> +# @status_code: Arg1 – An Integer containing the status code
> >>
> 
> >>> +{ 'type': 'ACPIOSTInfo',
> >>> +  'data'  : { 'device': 'str',
> >>> +              'source': 'int',
> >>> +              'status': 'int',
> >>> +              'slot': 'int' } }
> >>
> >> ...this type declaration.  I have no idea which one of the two is wrong.
> > What do you mean under wrong?
> 
> Sorry for not being clear enough.  I'm not sure whether you meant to
> document four fields (device, source, status, and slot) or whether the
> command should have been just two fields ( 'data': { 'source_event':
> 'int', 'status_code': 'int' } ).
> 
> Although re-reading what I just wrote, it appears your 'source' field
> matches the 'source_event' documentation, the 'status' field matches the
> 'status_code' documentation, and you omitted the 'device' and 'slot'
> documentation.
Thanks, I'll fix it.

> 
> And my question in 4/5 remains - should 'source' and/or 'status' be
> defined as an enum rather than an open-coded int?
Using enum for 'source' event, might be possible if we restrict ourselves
to a limit set of supported values and ignore the rest of
unknown/not implemented values. It might be not a good idea to lose
events because QEMU doesn't know about them.
Also from maintainability PoV it would add a bunch of mapping code
from 'int' into our enum, which would essentially prevent
new source events be exposed to users until QEMU adds support for
them.

For 'status' code it'd add a lot more mapping code to translate its
known values into enum since it's changing depending on 'source'.
Especially if it comes to expanding range of known values in
table 6-160 of ACPI5.0 spec.

I think it would be better to expose raw values the guest reported
via _OST and let management to pick-up ones it's interested in and
allow it to handle not implemented ones as it wishes rather than
hiding them at QEMU level.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [RFC 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface
  2014-06-05 10:10         ` [Qemu-devel] [RFC 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface Igor Mammedov
@ 2014-06-05 12:42           ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2014-06-05 12:42 UTC (permalink / raw)
  To: Igor Mammedov; +Cc: vasilis.liaskovitis, mst, pkrempa, qemu-devel, lcapitulino

[-- Attachment #1: Type: text/plain, Size: 1732 bytes --]

On 06/05/2014 04:10 AM, Igor Mammedov wrote:

>> And my question in 4/5 remains - should 'source' and/or 'status' be
>> defined as an enum rather than an open-coded int?
> Using enum for 'source' event, might be possible if we restrict ourselves
> to a limit set of supported values and ignore the rest of
> unknown/not implemented values. It might be not a good idea to lose
> events because QEMU doesn't know about them.
> Also from maintainability PoV it would add a bunch of mapping code
> from 'int' into our enum, which would essentially prevent
> new source events be exposed to users until QEMU adds support for
> them.
> 
> For 'status' code it'd add a lot more mapping code to translate its
> known values into enum since it's changing depending on 'source'.
> Especially if it comes to expanding range of known values in
> table 6-160 of ACPI5.0 spec.
> 
> I think it would be better to expose raw values the guest reported
> via _OST and let management to pick-up ones it's interested in and
> allow it to handle not implemented ones as it wishes rather than
> hiding them at QEMU level.

Fair enough - if qemu is just doing passthrough, and is not doing any
particular change in behavior based on particular values being passed
through, then exposing raw status codes is the only scalable approach
(new codes are equally uninteresting to qemu, and passthrough handles a
raw value better than qemu trying to interpret and name all values being
passed through).  But probably worth documenting this rationale in the
commit message, so we can remember why we chose to go this way.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-05 12:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1401289056-28171-1-git-send-email-imammedo@redhat.com>
     [not found] ` <1401289056-28171-3-git-send-email-imammedo@redhat.com>
     [not found]   ` <5388A168.7040301@redhat.com>
     [not found]     ` <20140530173942.10601b7e@thinkpad>
     [not found]       ` <5388A754.6090806@redhat.com>
2014-06-05 10:10         ` [Qemu-devel] [RFC 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface Igor Mammedov
2014-06-05 12:42           ` Eric Blake

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).