From 79398a2710be3e2cf228a23eb15cf9573ff9fe9b Mon Sep 17 00:00:00 2001 From: Kaifeng Zhu Date: Thu, 8 Jan 2015 06:14:37 +0000 Subject: [PATCH] cmdline: Parse -pciemulation before trying to use it 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 d21c3aa05..67d9d8677 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) { -- 2.39.5