From: Andrew Cooper Subject: [PATCH 12/32] cmdline: Parse -pciemulation before trying to use it Date: Wed, 22 Apr 2015 16:08:25 +0100 Message-ID: <1429715325-5027-12-git-send-email-andrew.cooper3@citrix.com> References: <1429715235-4759-1-git-send-email-andrew.cooper3@citrix.com> <1429715325-5027-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1429715325-5027-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel List-Id: xen-devel@lists.xenproject.org From: Kaifeng Zhu Signed-off-by: Kaifeng Zhu Reviewed-by: Andrew Cooper --- vl.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vl.c b/vl.c index d21c3aa..67d9d86 100644 --- a/vl.c +++ b/vl.c @@ -5952,6 +5952,15 @@ int main(int argc, char **argv, char **envp) } } +#ifdef CONFIG_PASSTHROUGH + for (i = 0; i < nb_pci_emulation; i++) { + if (pci_emulation_add(pci_emulation_config_text[i]) < 0) { + fprintf(stderr, "Warning: could not add PCI device %s\n", + pci_emulation_config_text[i]); + } + } +#endif + machine->init(ram_size, vga_ram_size, boot_devices, kernel_filename, kernel_cmdline, initrd_filename, cpu_model, direct_pci); @@ -6068,15 +6077,6 @@ int main(int argc, char **argv, char **envp) } } -#ifdef CONFIG_PASSTHROUGH - for (i = 0; i < nb_pci_emulation; i++) { - if (pci_emulation_add(pci_emulation_config_text[i]) < 0) { - fprintf(stderr, "Warning: could not add PCI device %s\n", - pci_emulation_config_text[i]); - } - } -#endif - for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) { const char *devname = virtio_consoles[i]; if (virtcon_hds[i] && devname) { -- 1.7.10.4