Received: from eggs.gnu.org ([2001:4830:134:3::10]:32827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrX3P-0003BC-Oc for qemu-devel@nongnu.org; Thu, 20 Nov 2014 14:06:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrX3J-0003m0-GQ for qemu-devel@nongnu.org; Thu, 20 Nov 2014 14:06:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrX3J-0003kZ-Bx for qemu-devel@nongnu.org; Thu, 20 Nov 2014 14:06:01 -0500 Date: Thu, 20 Nov 2014 17:05:54 -0200 From: Eduardo Habkost Message-ID: <20141120190554.GB3137@thinpad.lan.raisama.net> References: <1416507678-15596-1-git-send-email-dslutz@verizon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1416507678-15596-1-git-send-email-dslutz@verizon.com> 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: Don Slutz Cc: Anthony Liguori , "Michael S. Tsirkin" , Michael Tokarev , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , Stefan Hajnoczi , Paolo Bonzini 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); -- Eduardo