[PATCH] KVM : Qemu: update call pci_nic_init

"Zhang, Yang" <[email protected]>
Newsgroups org.kernel.vger.kvm-ia64,org.kernel.vger.kvm
Message-ID <10C63FAD690C13458F0B32BCED571F1403D74F21@pdsmsx502.ccr.corp.intel.com>
Hi
As the definition pci_nic_init has modified, this patch update the corresponding calling in ipf_init1().

From 53a66f524a6c2215d61da797cca4b7b1acbb1266 Mon Sep 17 00:00:00 2001
From: Yang <[email protected]>
Date: Thu, 15 Jan 2009 13:09:43 +0800
Subject: [PATCH] KVM : Qemu: update call pci_nic_init

update call pci_nic_init in ipf_init1

Signed-off-by: Xiantao Zhang <[email protected]>
Signed-off-by: Yang Zhang <[email protected]>
---
 qemu/hw/ipf.c |   26 +++++---------------------
 1 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/qemu/hw/ipf.c b/qemu/hw/ipf.c
index 4e9b052..0326ee9 100644
--- a/qemu/hw/ipf.c
+++ b/qemu/hw/ipf.c
@@ -550,28 +550,12 @@ static void ipf_init1(ram_addr_t ram_size, int vga_ram_size,
     }
 
     for(i = 0; i < nb_nics; i++) {
-        nd = &nd_table[i];
-        if (!nd->model) {
-            if (pci_enabled) {
-                nd->model = "ne2k_pci";
-            } else {
-                nd->model = "ne2k_isa";
-            }
-        }
-        if (strcmp(nd->model, "ne2k_isa") == 0) {
+        NICInfo *nd = &nd_table[i];
+
+        if (!pci_enabled || (nd->model && strcmp(nd->model, "ne2k_isa") == 0))
             pc_init_ne2k_isa(nd, i8259);
-        } else if (pci_enabled) {
-            if (strcmp(nd->model, "?") == 0)
-                fprintf(stderr, "qemu: Supported ISA NICs: ne2k_isa\n");
-            if (!pci_nic_init(pci_bus, nd, -1))
-                exit(1);
-        } else if (strcmp(nd->model, "?") == 0) {
-            fprintf(stderr, "qemu: Supported ISA NICs: ne2k_isa\n");
-            exit(1);
-        } else {
-            fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model);
-            exit(1);
-        }
+        else
+            pci_nic_init(pci_bus, nd, -1, "e1000");
     }
 
 #undef USE_HYPERCALL  //Disable it now, need to implement later!
-- 
1.6.0.rc1
0001-KVM-Qemu-update-pci_nic_init.patch (application/octet-stream, 1.7 KB)
From 53a66f524a6c2215d61da797cca4b7b1acbb1266 Mon Sep 17 00:00:00 2001
From: Yang <[email protected]>
Date: Thu, 15 Jan 2009 13:09:43 +0800
Subject: [PATCH] KVM : Qemu: update call pci_nic_init

update call pci_nic_init in ipf_init1

Signed-off-by: Xiantao Zhang <[email protected]>
Signed-off-by: Yang Zhang <[email protected]>
---
 qemu/hw/ipf.c |   26 +++++---------------------
 1 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/qemu/hw/ipf.c b/qemu/hw/ipf.c
index 4e9b052..0326ee9 100644
--- a/qemu/hw/ipf.c
+++ b/qemu/hw/ipf.c
@@ -550,28 +550,12 @@ static void ipf_init1(ram_addr_t ram_size, int vga_ram_size,
     }
 
     for(i = 0; i < nb_nics; i++) {
-        nd = &nd_table[i];
-        if (!nd->model) {
-            if (pci_enabled) {
-                nd->model = "ne2k_pci";
-            } else {
-                nd->model = "ne2k_isa";
-            }
-        }
-        if (strcmp(nd->model, "ne2k_isa") == 0) {
+        NICInfo *nd = &nd_table[i];
+
+        if (!pci_enabled || (nd->model && strcmp(nd->model, "ne2k_isa") == 0))
             pc_init_ne2k_isa(nd, i8259);
-        } else if (pci_enabled) {
-            if (strcmp(nd->model, "?") == 0)
-                fprintf(stderr, "qemu: Supported ISA NICs: ne2k_isa\n");
-            if (!pci_nic_init(pci_bus, nd, -1))
-                exit(1);
-        } else if (strcmp(nd->model, "?") == 0) {
-            fprintf(stderr, "qemu: Supported ISA NICs: ne2k_isa\n");
-            exit(1);
-        } else {
-            fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model);
-            exit(1);
-        }
+        else
+            pci_nic_init(pci_bus, nd, -1, "e1000");
     }
 
 #undef USE_HYPERCALL  //Disable it now, need to implement later!
-- 
1.6.0.rc1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.