From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrX7E-0005Y4-Hq for qemu-devel@nongnu.org; Thu, 20 Nov 2014 14:10:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrX78-00056r-Fi for qemu-devel@nongnu.org; Thu, 20 Nov 2014 14:10:04 -0500 Received: from fldsmtpe04.verizon.com ([140.108.26.143]:27073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrX78-00056c-BG for qemu-devel@nongnu.org; Thu, 20 Nov 2014 14:09:58 -0500 From: Don Slutz Message-ID: <546E3C84.7040505@terremark.com> Date: Thu, 20 Nov 2014 14:09:56 -0500 MIME-Version: 1.0 References: <1416507678-15596-1-git-send-email-dslutz@verizon.com> <20141120190554.GB3137@thinpad.lan.raisama.net> In-Reply-To: <20141120190554.GB3137@thinpad.lan.raisama.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v4 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , Don Slutz Cc: Anthony Liguori , "Michael S. Tsirkin" , Michael Tokarev , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , Stefan Hajnoczi , Paolo Bonzini On 11/20/14 14:05, Eduardo Habkost wrote: > On Thu, Nov 20, 2014 at 01:21:18PM -0500, Don Slutz wrote: > [...] >> @@ -242,9 +243,16 @@ static void pc_q35_init(MachineState *machine) >> >> pc_register_ferr_irq(gsi[13]); >> >> + assert(pc_machine->vmport != ON_OFF_AUTO_MAX); >> + if (pc_machine->vmport == ON_OFF_AUTO_AUTO) { >> + no_vmport = xen_enabled(); >> + } else { >> + no_vmport = (pc_machine->vmport != ON_OFF_AUTO_ON); >> + } >> + >> /* init basic PC hardware */ >> pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, >> - !pc_machine->vmport, 0xff0104); >> + no_vmport, 0xff0104); >> > Sorry for suggesting yet another change, but: what about changing > pc_machine->vmport here instead of using a no_vmport variable, so the > actual vmport configuration may be queried by anybody later using the > QOM property? It would even make the code shorter. > > I mean: > > if (pc_machine->vmport == ON_OFF_AUTO_AUTO) { > pc_machine->vmport = xen_enabled() ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON); > } > pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, > (pc_machine->vmport != ON_OFF_AUTO_ON), 0xff0104); > > Look better to me also. So will adjust the patch. -Don Slutz