From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZArNu-0000kJ-TO for qemu-devel@nongnu.org; Thu, 02 Jul 2015 23:11:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZArNr-0006fb-I5 for qemu-devel@nongnu.org; Thu, 02 Jul 2015 23:11:26 -0400 Received: from mga09.intel.com ([134.134.136.24]:48955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZArNr-0006fJ-CH for qemu-devel@nongnu.org; Thu, 02 Jul 2015 23:11:23 -0400 Message-ID: <5595FD51.8080902@intel.com> Date: Fri, 03 Jul 2015 11:11:13 +0800 From: "Chen, Tiejun" MIME-Version: 1.0 References: <1433493901-9332-1-git-send-email-tiejun.chen@intel.com> <1433493901-9332-10-git-send-email-tiejun.chen@intel.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v8][RESEND][PATCH 09/10] xen, gfx passthrough: register host bridge specific to passthrough List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mst@redhat.com >> #ifdef CONFIG_XEN >> +static void igd_passthrough_pc_init_pci(MachineState *machine) >> +{ >> + pc_init1(machine, >> + TYPE_I440FX_PCI_HOST_BRIDGE, >> + TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE); >> +} >> + >> +static void pc_init_pci(MachineState *machine) >> +{ >> + pc_init1(machine, >> + TYPE_I440FX_PCI_HOST_BRIDGE, >> + TYPE_I440FX_PCI_DEVICE); >> +} >> + >> +static void pc_xen_hvm_init_pci(MachineState *machine) >> +{ >> + if (has_igd_gfx_passthru) >> + igd_passthrough_pc_init_pci(machine); >> + else >> + pc_init_pci(machine); >> +} > > I don't see any value in introducing pc_init_pci and > igd_passthrough_pc_init_pci. I would expand both of them here. > Agree, and what about this? static void pc_xen_hvm_init_pci(MachineState *machine) { const char *pci_type = has_igd_gfx_passthru ? TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE : TYPE_I440FX_PCI_DEVICE; pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, pci_type); } Thanks Tiejun