All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Don Slutz <dslutz@verizon.com>
Cc: Anthony Liguori <aliguori@amazon.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Michael Tokarev <mjt@tls.msk.ru>,
	qemu-devel@nongnu.org,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v5 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen
Date: Fri, 21 Nov 2014 13:10:24 -0200	[thread overview]
Message-ID: <20141121151024.GF3137@thinpad.lan.raisama.net> (raw)
In-Reply-To: <546F52A1.8060303@terremark.com>

On Fri, Nov 21, 2014 at 09:56:33AM -0500, Don Slutz wrote:
> On 11/21/14 08:53, Eduardo Habkost wrote:
> >On Fri, Nov 21, 2014 at 08:30:58AM -0500, Don Slutz wrote:
> >>On 11/20/14 21:01, Eduardo Habkost wrote:
> >>>On Thu, Nov 20, 2014 at 05:32:56PM -0500, Don Slutz wrote:
> >>>[...]
> [...]
> >>>>+    pcms->vmport = ON_OFF_AUTO_AUTO;
> >>>>+    object_property_add(obj, PC_MACHINE_VMPORT, "str",
> >>>I believe "OnOffAuto" is a valid type name, if it is defined in the QAPI
> >>>schema.
> >>I can only find:
> >>
> >>qapi-types.h:typedef enum OnOffAuto
> >>qapi-types.h:} OnOffAuto;
> >I don't understand what you mean, where did you expect to find it? You added it
> >to the schema, so it is now a valid type name.
> >
> >>Which I use to define pcms->vmport.  The best I can translate this is
> >>that "str" is what you are looking to replace.
> >>
> >>So I plan no change here.
> >You are not defining a string property, but an OnOffAuto enum property,
> >so why use "str"?
> >
> >See, for example, the type of an existing enum property:
> >ide-hd.bios-chs-trans:
> >
> >   $ qemu-system-x86_64 -device ide-hd,?
> >   [...]
> >   ide-hd.bios-chs-trans=BiosAtaTranslation (Logical CHS translation algorithm, auto/none/lba/large/rechs)
> >   [...]
> >   $
> >
> >
> Ok, I now understand what you are getting at.  From object.h:
> 
>  * @type: the type name of the property.  This namespace is pretty loosely
>  *   defined.  Sub namespaces are constructed by using a prefix and then
>  *   to angle brackets.  For instance, the type 'virtio-net-pci' in the
>  *   'link' namespace would be 'link<virtio-net-pci>'.
> 
> It turns out that BiosAtaTranslation is a .name not a .type:
> 

"-device ...,?" above is showing the property type. See
qdev_device_help().

> hyper-0-21-52:~/qemu>git grep BiosAtaTranslation
> hw/core/qdev-properties.c:QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) !=
> sizeof(int));
> hw/core/qdev-properties.c:    .name = "BiosAtaTranslation",
> hw/core/qdev-properties.c:    .enum_table = BiosAtaTranslation_lookup,
> qapi/block.json:# BiosAtaTranslation:
> qapi/block.json:{ 'enum': 'BiosAtaTranslation',

PropertyInfo.name is what is used as the 'type' parameter to
object_property_add() when qdev adds a static property to the object.
See qdev_property_add_static().

> 
> 
> so to me there are a few options:
> 
> 1) "enum"
> 2) "OnOffAuto"
> 3) "enum<OnOffAuto>"
> 4) "enum OnOffAuto"
> 5) "enum-OnOffAuto"
> 
> I think #2 was what you were thinking of, but I am not sure.  Please advise.

The documentation is unclear about the set of valid type names. But as
existing enum properties simply use the enum type name directly, I
suggest "OnOffAuto" to follow existing practice.

-- 
Eduardo

  reply	other threads:[~2014-11-21 15:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20 22:32 [Qemu-devel] [BUGFIX][PATCH for 2.2 v5 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen Don Slutz
2014-11-21  2:01 ` Eduardo Habkost
2014-11-21 13:30   ` Don Slutz
2014-11-21 13:53     ` Eduardo Habkost
2014-11-21 14:56       ` Don Slutz
2014-11-21 15:10         ` Eduardo Habkost [this message]
2014-11-21 16:19           ` Don Slutz

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=20141121151024.GF3137@thinpad.lan.raisama.net \
    --to=ehabkost@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=dgilbert@redhat.com \
    --cc=dslutz@verizon.com \
    --cc=mjt@tls.msk.ru \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.