qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Glines <mark@glines.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] add -net nic,model=? to list available models
Date: Sun, 20 May 2007 07:54:59 -0700	[thread overview]
Message-ID: <20070520075459.48edc58a@chirp> (raw)

[-- Attachment #1: Type: text/plain, Size: 3211 bytes --]

Hi,

What do you think about this feature?  The manpage just says "Not all
devices are supported on all targets", but this allows the user to get
some more specifics.

The output looks like this:

$ i386-softmmu/qemu -hda /dev/null -net nic,model=?
qemu: Supported ISA NICs: ne2k_isa
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139


I tested the various platforms with the following script:

$ for EXE in */qemu-system-*; do $EXE -M ? | grep -v ^Supported | awk '{print $1}' | sort | while read MACHINE; do echo EXE `basename $EXE` MACHINE $MACHINE; $EXE -M $MACHINE -hda /dev/null -net nic,model=? 2>&1 | grep -i 'supported ' | grep -i nic; done; done
EXE qemu-system-arm MACHINE akita
EXE qemu-system-arm MACHINE borzoi
EXE qemu-system-arm MACHINE integratorcp
qemu: Supported NICs: smc91c111
EXE qemu-system-arm MACHINE realview
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139
EXE qemu-system-arm MACHINE spitz
EXE qemu-system-arm MACHINE terrier
EXE qemu-system-arm MACHINE versatileab
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139
EXE qemu-system-arm MACHINE versatilepb
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139
EXE qemu-system-mips64el MACHINE malta
EXE qemu-system-mips64el MACHINE mips
qemu: Supported NICs: ne2k_isa
EXE qemu-system-mips64el MACHINE pica61
EXE qemu-system-mips64 MACHINE malta
EXE qemu-system-mips64 MACHINE mips
qemu: Supported NICs: ne2k_isa
EXE qemu-system-mips64 MACHINE pica61
EXE qemu-system-mipsel MACHINE malta
EXE qemu-system-mipsel MACHINE mips
qemu: Supported NICs: ne2k_isa
EXE qemu-system-mipsel MACHINE pica61
EXE qemu-system-mips MACHINE malta
EXE qemu-system-mips MACHINE mips
qemu: Supported NICs: ne2k_isa
EXE qemu-system-mips MACHINE pica61
EXE qemu-system-ppc64 MACHINE g3bw
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139
EXE qemu-system-ppc64 MACHINE mac99
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139
EXE qemu-system-ppc64 MACHINE prep
qemu: Supported NICs: ne2k_isa
EXE qemu-system-ppc64 MACHINE ref405ep
EXE qemu-system-ppc64 MACHINE taihu
EXE qemu-system-ppcemb MACHINE g3bw
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139
EXE qemu-system-ppcemb MACHINE mac99
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139
EXE qemu-system-ppcemb MACHINE prep
qemu: Supported NICs: ne2k_isa
EXE qemu-system-ppcemb MACHINE ref405ep
EXE qemu-system-ppcemb MACHINE taihu
EXE qemu-system-ppc MACHINE g3bw
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139
EXE qemu-system-ppc MACHINE mac99
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139
EXE qemu-system-ppc MACHINE prep
qemu: Supported NICs: ne2k_isa
EXE qemu-system-ppc MACHINE ref405ep
EXE qemu-system-ppc MACHINE taihu
EXE qemu-system-sparc MACHINE SS-10
qemu: Supported NICs: lance
EXE qemu-system-sparc MACHINE SS-5
qemu: Supported NICs: lance
EXE qemu-system-x86_64 MACHINE isapc
qemu: Supported ISA NICs: ne2k_isa
EXE qemu-system-x86_64 MACHINE pc
qemu: Supported ISA NICs: ne2k_isa
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139

Mark

[-- Attachment #2: add_net_nic_model_question.diff --]
[-- Type: text/x-patch, Size: 13716 bytes --]

# 
# old_revision [cc71807c20df8f82fb20d0be4e28724ae72c327e]
# 
# patch "hw/integratorcp.c"
#  from [6284411c9e118660f9d21cd70caebed903bb629f]
#    to [a5a6fef89a1f835e74b063da356a426a5fc52a68]
# 
# patch "hw/mips_r4k.c"
#  from [be1ac0097faf383a1c6cfd1d835bdf50ccaa563d]
#    to [572c34624461e3a9d8b4c7e038258a38f94c7ef1]
# 
# patch "hw/pc.c"
#  from [5f693c4eec10860e505695aa67c95d773b4996ec]
#    to [f4e8b25ed2e3789eec6f17b2a0701b22eb3a8cbb]
# 
# patch "hw/pci.c"
#  from [bf605818b60016f30b48c557c73c501c88e970a7]
#    to [7241664eb877046ee2da34c9d2e52964fe549abf]
# 
# patch "hw/ppc_prep.c"
#  from [c263531add275ec5d312b01096389888d575714a]
#    to [1615e02777331289678405466aaff18b6eee407c]
# 
# patch "hw/sun4m.c"
#  from [0667d1f40df4a77bd3f66f58a60bb42a129c11f0]
#    to [e47f77993769cc6f4e832c3cbff8a4f4fd1c3b90]
# 
# patch "linux-user/main.c"
#  from [a5f5f249311aab750ce70bad10506bd9bbc00604]
#    to [744ce30cfe1a001c4a0d303e32211ed874dcc9ac]
# 
# patch "qemu-doc.texi"
#  from [05125ff074558272198207397bc3aa3ee2236c1d]
#    to [af08c9667112cb274764f4fe7e261afef3d98f5b]
# 
# patch "sparc-dis.c"
#  from [6f8a6444114340dedd654c96ea2a08a0d5205d7e]
#    to [8d9a02265af2e700429703e3de4486eb2db10415]
# 
# patch "target-i386/helper.c"
#  from [55bddc211b53dee78aa33ba7c2ca2eb36594f411]
#    to [c7161cd3e88fa1ef334118a5b78fe21287c8b5a5]
# 
# patch "target-i386/translate.c"
#  from [22866c61aedcd035db5fd36f7d52dde994d06e99]
#    to [4c4bcb92903cb21d26b63e86e1cd12fa50ebd30c]
# 
# patch "target-ppc/translate.c"
#  from [df49e3b4e6065e4351f7c4c895370aba27841d63]
#    to [0819c5288a595c0a05411020a73779545557f209]
# 
============================================================
--- hw/integratorcp.c	6284411c9e118660f9d21cd70caebed903bb629f
+++ hw/integratorcp.c	a5a6fef89a1f835e74b063da356a426a5fc52a68
@@ -500,6 +500,9 @@ static void integratorcp_init(int ram_si
         if (nd_table[0].model == NULL
             || strcmp(nd_table[0].model, "smc91c111") == 0) {
             smc91c111_init(&nd_table[0], 0xc8000000, pic[27]);
+        } else if (strcmp(nd_table[0].model, "?") == 0) {
+            fprintf(stderr, "qemu: Supported NICs: smc91c111\n");
+            exit (1);
         } else {
             fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd_table[0].model);
             exit (1);
============================================================
--- hw/mips_r4k.c	be1ac0097faf383a1c6cfd1d835bdf50ccaa563d
+++ hw/mips_r4k.c	572c34624461e3a9d8b4c7e038258a38f94c7ef1
@@ -227,6 +227,9 @@ void mips_r4k_init (int ram_size, int vg
         if (nd_table[0].model == NULL
             || strcmp(nd_table[0].model, "ne2k_isa") == 0) {
             isa_ne2000_init(0x300, i8259[9], &nd_table[0]);
+        } else if (strcmp(nd_table[0].model, "?") == 0) {
+            fprintf(stderr, "qemu: Supported NICs: ne2k_isa\n");
+            exit (1);
         } else {
             fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd_table[0].model);
             exit (1);
============================================================
--- hw/pc.c	5f693c4eec10860e505695aa67c95d773b4996ec
+++ hw/pc.c	f4e8b25ed2e3789eec6f17b2a0701b22eb3a8cbb
@@ -865,7 +865,12 @@ static void pc_init1(int ram_size, int v
         if (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");
             pci_nic_init(pci_bus, nd, -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);
============================================================
--- hw/pci.c	bf605818b60016f30b48c557c73c501c88e970a7
+++ hw/pci.c	7241664eb877046ee2da34c9d2e52964fe549abf
@@ -588,6 +588,10 @@ void pci_nic_init(PCIBus *bus, NICInfo *
         pci_rtl8139_init(bus, nd, devfn);
     } else if (strcmp(nd->model, "pcnet") == 0) {
         pci_pcnet_init(bus, nd, devfn);
+    } else if (strcmp(nd->model, "?") == 0) {
+        fprintf(stderr, "qemu: Supported PCI NICs: i82551 i82557b i82559er"
+                        " ne2k_pci pcnet rtl8139\n");
+        exit (1);
     } else {
         fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model);
         exit (1);
============================================================
--- hw/ppc_prep.c	c263531add275ec5d312b01096389888d575714a
+++ hw/ppc_prep.c	1615e02777331289678405466aaff18b6eee407c
@@ -626,6 +626,9 @@ static void ppc_prep_init (int ram_size,
         if (nd_table[0].model == NULL
             || strcmp(nd_table[0].model, "ne2k_isa") == 0) {
             isa_ne2000_init(ne2000_io[i], i8259[ne2000_irq[i]], &nd_table[i]);
+        } else if (strcmp(nd_table[0].model, "?") == 0) {
+            fprintf(stderr, "qemu: Supported NICs: ne2k_isa\n");
+            exit (1);
         } else {
             /* Why ? */
             cpu_abort(env, "qemu: Unsupported NIC: %s\n", nd_table[0].model);
============================================================
--- hw/sun4m.c	0667d1f40df4a77bd3f66f58a60bb42a129c11f0
+++ hw/sun4m.c	e47f77993769cc6f4e832c3cbff8a4f4fd1c3b90
@@ -309,6 +309,9 @@ static void sun4m_hw_init(const struct h
             || strcmp(nd_table[0].model, "lance") == 0) {
             main_lance = lance_init(&nd_table[0], hwdef->le_base, dma,
                                     slavio_irq[hwdef->le_irq]);
+        } else if (strcmp(nd_table[0].model, "?") == 0) {
+            fprintf(stderr, "qemu: Supported NICs: lance\n");
+            exit (1);
         } else {
             fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd_table[0].model);
             exit (1);
============================================================
--- linux-user/main.c	a5f5f249311aab750ce70bad10506bd9bbc00604
+++ linux-user/main.c	744ce30cfe1a001c4a0d303e32211ed874dcc9ac
@@ -1633,7 +1633,7 @@ void cpu_loop (CPUState *env)
             call_pal(env, (trapnr >> 6) | 0x80);
             break;
         case EXCP_CALL_PALP ... (EXCP_CALL_PALE - 1):
-            fprintf(stderr, "Priviledged call to PALcode\n");
+            fprintf(stderr, "Privileged call to PALcode\n");
             exit(1);
             break;
         case EXCP_DEBUG:
============================================================
--- qemu-doc.texi	05125ff074558272198207397bc3aa3ee2236c1d
+++ qemu-doc.texi	af08c9667112cb274764f4fe7e261afef3d98f5b
@@ -152,7 +152,7 @@ @section Introduction
 @item
 Floppy disk
 @item 
-NE2000 PCI network adapters
+PCI/ISA PCI network adapters
 @item
 Serial ports
 @item
@@ -354,7 +354,7 @@ @section Invocation
 
 @item -net nic[,vlan=n][,macaddr=addr][,model=type]
 Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n}
-= 0 is the default). The NIC is currently an NE2000 on the PC
+= 0 is the default). The NIC is an ne2k_pci by default on the PC
 target. Optionally, the MAC address can be changed. If no
 @option{-net} option is specified, a single NIC is created.
 Qemu can emulate several different models of network card.
@@ -362,7 +362,8 @@ @section Invocation
 @code{i82551}, @code{i82557b}, @code{i82559er},
 @code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139},
 @code{smc91c111} and @code{lance}.
-Not all devices are supported on all targets.
+Not all devices are supported on all targets.  Use -net nic,model=?
+for a list of available devices for your target.
 
 @item -net user[,vlan=n][,hostname=name]
 Use the user mode network stack which requires no administrator
@@ -1204,7 +1205,7 @@ @section Network emulation
 @node pcsys_network
 @section Network emulation
 
-QEMU can simulate several network cards (NE2000 boards on the PC
+QEMU can simulate several network cards (PCI or ISA cards on the PC
 target) and can connect them to an arbitrary number of Virtual Local
 Area Networks (VLANs). Host TAP devices can be connected to any QEMU
 VLAN. VLAN can be connected between separate instances of QEMU to
============================================================
--- sparc-dis.c	6f8a6444114340dedd654c96ea2a08a0d5205d7e
+++ sparc-dis.c	8d9a02265af2e700429703e3de4486eb2db10415
@@ -276,7 +276,7 @@ const struct sparc_opcode_arch sparc_opc
   { "v8", MASK_V6 | MASK_V7 | MASK_V8 },
   { "sparclet", MASK_V6 | MASK_V7 | MASK_V8 | MASK_SPARCLET },
   { "sparclite", MASK_V6 | MASK_V7 | MASK_V8 | MASK_SPARCLITE },
-  /* ??? Don't some v8 priviledged insns conflict with v9?  */
+  /* ??? Don't some v8 privileged insns conflict with v9?  */
   { "v9", MASK_V6 | MASK_V7 | MASK_V8 | MASK_V9 },
   /* v9 with ultrasparc additions */
   { "v9a", MASK_V6 | MASK_V7 | MASK_V8 | MASK_V9 | MASK_V9A },
============================================================
--- target-i386/helper.c	55bddc211b53dee78aa33ba7c2ca2eb36594f411
+++ target-i386/helper.c	c7161cd3e88fa1ef334118a5b78fe21287c8b5a5
@@ -687,7 +687,7 @@ static void do_interrupt_protected(int i
     if (!(e2 & DESC_P_MASK))
         raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
     if (!(e2 & DESC_C_MASK) && dpl < cpl) {
-        /* to inner priviledge */
+        /* to inner privilege */
         get_ss_esp_from_tss(&ss, &esp, dpl);
         if ((ss & 0xfffc) == 0)
             raise_exception_err(EXCP0A_TSS, ss & 0xfffc);
@@ -708,7 +708,7 @@ static void do_interrupt_protected(int i
         sp_mask = get_sp_mask(ss_e2);
         ssp = get_seg_base(ss_e1, ss_e2);
     } else if ((e2 & DESC_C_MASK) || dpl == cpl) {
-        /* to same priviledge */
+        /* to same privilege */
         if (env->eflags & VM_MASK)
             raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
         new_stack = 0;
@@ -901,7 +901,7 @@ static void do_interrupt64(int intno, in
     if (!(e2 & DESC_L_MASK) || (e2 & DESC_B_MASK))
         raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
     if ((!(e2 & DESC_C_MASK) && dpl < cpl) || ist != 0) {
-        /* to inner priviledge */
+        /* to inner privilege */
         if (ist != 0)
             esp = get_rsp_from_tss(ist + 3);
         else
@@ -910,7 +910,7 @@ static void do_interrupt64(int intno, in
         ss = 0;
         new_stack = 1;
     } else if ((e2 & DESC_C_MASK) || dpl == cpl) {
-        /* to same priviledge */
+        /* to same privilege */
         if (env->eflags & VM_MASK)
             raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
         new_stack = 0;
@@ -2208,7 +2208,7 @@ void helper_lcall_protected_T0_T1(int sh
             raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
 
         if (!(e2 & DESC_C_MASK) && dpl < cpl) {
-            /* to inner priviledge */
+            /* to inner privilege */
             get_ss_esp_from_tss(&ss, &sp, dpl);
 #ifdef DEBUG_PCALL
             if (loglevel & CPU_LOG_PCALL)
@@ -2255,7 +2255,7 @@ void helper_lcall_protected_T0_T1(int sh
             }
             new_stack = 1;
         } else {
-            /* to same priviledge */
+            /* to same privilege */
             sp = ESP;
             sp_mask = get_sp_mask(env->segs[R_SS].flags);
             ssp = env->segs[R_SS].base;
@@ -2437,7 +2437,7 @@ static inline void helper_ret_protected(
                        get_seg_limit(e1, e2),
                        e2);
     } else {
-        /* return to different priviledge level */
+        /* return to different privilege level */
 #ifdef TARGET_X86_64
         if (shift == 2) {
             POPQ(sp, new_esp);
============================================================
--- target-i386/translate.c	22866c61aedcd035db5fd36f7d52dde994d06e99
+++ target-i386/translate.c	4c4bcb92903cb21d26b63e86e1cd12fa50ebd30c
@@ -2245,7 +2245,7 @@ static void gen_exception(DisasContext *
 }
 
 /* an interrupt is different from an exception because of the
-   priviledge checks */
+   privilege checks */
 static void gen_interrupt(DisasContext *s, int intno, 
                           target_ulong cur_eip, target_ulong next_eip)
 {
============================================================
--- target-ppc/translate.c	df49e3b4e6065e4351f7c4c895370aba27841d63
+++ target-ppc/translate.c	0819c5288a595c0a05411020a73779545557f209
@@ -3026,10 +3026,10 @@ static inline void gen_op_mfspr (DisasCo
         } else {
             /* Privilege exception */
             if (loglevel != 0) {
-                fprintf(logfile, "Trying to read priviledged spr %d %03x\n",
+                fprintf(logfile, "Trying to read privileged spr %d %03x\n",
                         sprn, sprn);
             }
-            printf("Trying to read priviledged spr %d %03x\n", sprn, sprn);
+            printf("Trying to read privileged spr %d %03x\n", sprn, sprn);
             RET_PRIVREG(ctx);
         }
     } else {
@@ -3132,10 +3132,10 @@ GEN_HANDLER(mtspr, 0x1F, 0x13, 0x0E, 0x0
         } else {
             /* Privilege exception */
             if (loglevel != 0) {
-                fprintf(logfile, "Trying to write priviledged spr %d %03x\n",
+                fprintf(logfile, "Trying to write privileged spr %d %03x\n",
                         sprn, sprn);
             }
-            printf("Trying to write priviledged spr %d %03x\n", sprn, sprn);
+            printf("Trying to write privileged spr %d %03x\n", sprn, sprn);
             RET_PRIVREG(ctx);
         }
     } else {
@@ -4019,7 +4019,7 @@ GEN_HANDLER(cli, 0x1F, 0x16, 0x0F, 0x03E
 /* cli */
 GEN_HANDLER(cli, 0x1F, 0x16, 0x0F, 0x03E00000, PPC_POWER)
 {
-    /* Cache line invalidate: priviledged and treated as no-op */
+    /* Cache line invalidate: privileged and treated as no-op */
 #if defined(CONFIG_USER_ONLY)
     RET_PRIVOPC(ctx);
 #else

                 reply	other threads:[~2007-05-20 14:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070520075459.48edc58a@chirp \
    --to=mark@glines.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).