From: Don Slutz <dslutz@verizon.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Anthony Liguori <aliguori@amazon.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, Don Slutz <dslutz@verizon.com>,
"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 08:30:58 -0500 [thread overview]
Message-ID: <546F3E92.5080406@terremark.com> (raw)
In-Reply-To: <20141121020142.GC3137@thinpad.lan.raisama.net>
On 11/20/14 21:01, Eduardo Habkost wrote:
> On Thu, Nov 20, 2014 at 05:32:56PM -0500, Don Slutz wrote:
> [...]
>> @@ -1711,18 +1711,23 @@ static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v,
>> pcms->max_ram_below_4g = value;
>> }
>>
>> -static bool pc_machine_get_vmport(Object *obj, Error **errp)
>> +static void pc_machine_get_vmport(Object *obj, Visitor *v, void *opaque,
>> + const char *name, Error **errp)
>> {
>> PCMachineState *pcms = PC_MACHINE(obj);
>> + int vmport = pcms->vmport;
>>
>> - return pcms->vmport;
>> + visit_type_enum(v, &vmport, OnOffAuto_lookup, NULL, name, errp);
> A visit_type_OnOffAuto() function is automatically generated by the QAPI
> schema, so you don't need to deal with the low level visit_type_enum()
> function.
Ok. Will switch.
>> }
>>
>> -static void pc_machine_set_vmport(Object *obj, bool value, Error **errp)
>> +static void pc_machine_set_vmport(Object *obj, Visitor *v, void *opaque,
>> + const char *name, Error **errp)
>> {
>> PCMachineState *pcms = PC_MACHINE(obj);
>> + int vmport;
>>
>> - pcms->vmport = value;
>> + visit_type_enum(v, &vmport, OnOffAuto_lookup, NULL, name, errp);
>> + pcms->vmport = vmport;
> 'vmport' may be undefined in case the visitor return an error, and in
> this case you shouldn't change pcms->vmport. This won't be a problem if
> you just call:
>
> visit_type_OnOffAuto(v, &pcms->vmport, name, errp);
Will do.
>> }
>>
>> static void pc_machine_initfn(Object *obj)
>> @@ -1737,11 +1742,11 @@ static void pc_machine_initfn(Object *obj)
>> pc_machine_get_max_ram_below_4g,
>> pc_machine_set_max_ram_below_4g,
>> NULL, NULL, NULL);
>> - pcms->vmport = !xen_enabled();
>> - object_property_add_bool(obj, PC_MACHINE_VMPORT,
>> - pc_machine_get_vmport,
>> - pc_machine_set_vmport,
>> - NULL);
>> + 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;
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.
-Don Slutz
>> + pc_machine_get_vmport,
>> + pc_machine_set_vmport,
>> + NULL, NULL, NULL);
>> }
>>
> [...]
>
next prev parent reply other threads:[~2014-11-21 13:31 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 [this message]
2014-11-21 13:53 ` Eduardo Habkost
2014-11-21 14:56 ` Don Slutz
2014-11-21 15:10 ` Eduardo Habkost
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=546F3E92.5080406@terremark.com \
--to=dslutz@verizon.com \
--cc=aliguori@amazon.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.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 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).