From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKcWV-0002Oq-2R for qemu-devel@nongnu.org; Wed, 07 Jan 2009 12:48:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKcWU-0002OG-Af for qemu-devel@nongnu.org; Wed, 07 Jan 2009 12:48:54 -0500 Received: from [199.232.76.173] (port=33783 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKcWT-0002O8-C8 for qemu-devel@nongnu.org; Wed, 07 Jan 2009 12:48:53 -0500 Received: from savannah.gnu.org ([199.232.41.3]:41686 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LKcWS-0005kQ-Mp for qemu-devel@nongnu.org; Wed, 07 Jan 2009 12:48:53 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LKcWS-0007vD-0r for qemu-devel@nongnu.org; Wed, 07 Jan 2009 17:48:52 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LKcWR-0007v4-K4 for qemu-devel@nongnu.org; Wed, 07 Jan 2009 17:48:51 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Wed, 07 Jan 2009 17:48:51 +0000 Subject: [Qemu-devel] [6220] Add a -net name=foo parameter (Mark McLoughlin) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6220 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6220 Author: aliguori Date: 2009-01-07 17:48:51 +0000 (Wed, 07 Jan 2009) Log Message: ----------- Add a -net name=foo parameter (Mark McLoughlin) Allow the user to supply a vlan client name on the command line. This is probably only useful for management tools so that they can use their own names rather than parsing the output of 'info network'. Signed-off-by: Mark McLoughlin Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/hw/e1000.c trunk/hw/eepro100.c trunk/hw/etraxfs_eth.c trunk/hw/mcf_fec.c trunk/hw/mipsnet.c trunk/hw/musicpal.c trunk/hw/ne2000.c trunk/hw/pcnet.c trunk/hw/rtl8139.c trunk/hw/smc91c111.c trunk/hw/stellaris_enet.c trunk/hw/usb-net.c trunk/hw/virtio-net.c trunk/net.c trunk/net.h trunk/qemu-doc.texi trunk/sysemu.h trunk/tap-win32.c trunk/vl.c Modified: trunk/hw/e1000.c =================================================================== --- trunk/hw/e1000.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/e1000.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -1071,7 +1071,7 @@ d->rxbuf_min_shift = 1; memset(&d->tx, 0, sizeof d->tx); - d->vc = qemu_new_vlan_client(nd->vlan, nd->model, + d->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, e1000_receive, e1000_can_receive, d); qemu_format_nic_info_str(d->vc, d->nd->macaddr); Modified: trunk/hw/eepro100.c =================================================================== --- trunk/hw/eepro100.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/eepro100.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -1776,7 +1776,7 @@ nic_reset(s); - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, nic_receive, nic_can_receive, s); qemu_format_nic_info_str(s->vc, s->macaddr); Modified: trunk/hw/etraxfs_eth.c =================================================================== --- trunk/hw/etraxfs_eth.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/etraxfs_eth.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -572,7 +572,7 @@ eth->ethregs = cpu_register_io_memory(0, eth_read, eth_write, eth); cpu_register_physical_memory (base, 0x5c, eth->ethregs); - eth->vc = qemu_new_vlan_client(nd->vlan, nd->model, + eth->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, eth_receive, eth_can_receive, eth); return dma; Modified: trunk/hw/mcf_fec.c =================================================================== --- trunk/hw/mcf_fec.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/mcf_fec.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -452,7 +452,7 @@ mcf_fec_writefn, s); cpu_register_physical_memory(base, 0x400, iomemtype); - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, mcf_fec_receive, mcf_fec_can_receive, s); memcpy(s->macaddr, nd->macaddr, 6); qemu_format_nic_info_str(n->vc, s->macaddr); Modified: trunk/hw/mipsnet.c =================================================================== --- trunk/hw/mipsnet.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/mipsnet.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -250,7 +250,7 @@ s->irq = irq; s->nd = nd; if (nd && nd->vlan) { - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, mipsnet_receive, mipsnet_can_receive, s); } else { s->vc = NULL; Modified: trunk/hw/musicpal.c =================================================================== --- trunk/hw/musicpal.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/musicpal.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -718,7 +718,7 @@ if (!s) return; s->irq = irq; - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, eth_receive, eth_can_receive, s); iomemtype = cpu_register_io_memory(0, mv88w8618_eth_readfn, mv88w8618_eth_writefn, s); Modified: trunk/hw/ne2000.c =================================================================== --- trunk/hw/ne2000.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/ne2000.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -741,7 +741,7 @@ ne2000_reset(s); - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, ne2000_receive, ne2000_can_receive, s); qemu_format_nic_info_str(s->vc, s->macaddr); @@ -804,7 +804,7 @@ s->pci_dev = (PCIDevice *)d; memcpy(s->macaddr, nd->macaddr, 6); ne2000_reset(s); - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, ne2000_receive, ne2000_can_receive, s); qemu_format_nic_info_str(s->vc, s->macaddr); Modified: trunk/hw/pcnet.c =================================================================== --- trunk/hw/pcnet.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/pcnet.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -1936,7 +1936,7 @@ d->nd = nd; if (nd && nd->vlan) { - d->vc = qemu_new_vlan_client(nd->vlan, nd->model, + d->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, pcnet_receive, pcnet_can_receive, d); qemu_format_nic_info_str(d->vc, d->nd->macaddr); Modified: trunk/hw/rtl8139.c =================================================================== --- trunk/hw/rtl8139.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/rtl8139.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -3438,7 +3438,7 @@ s->pci_dev = (PCIDevice *)d; memcpy(s->macaddr, nd->macaddr, 6); rtl8139_reset(s); - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, rtl8139_receive, rtl8139_can_receive, s); qemu_format_nic_info_str(s->vc, s->macaddr); Modified: trunk/hw/smc91c111.c =================================================================== --- trunk/hw/smc91c111.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/smc91c111.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -704,7 +704,7 @@ smc91c111_reset(s); - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, smc91c111_receive, smc91c111_can_receive, s); qemu_format_nic_info_str(s->vc, s->macaddr); /* ??? Save/restore. */ Modified: trunk/hw/stellaris_enet.c =================================================================== --- trunk/hw/stellaris_enet.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/stellaris_enet.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -397,7 +397,7 @@ memcpy(s->macaddr, nd->macaddr, 6); if (nd->vlan) { - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, stellaris_enet_receive, stellaris_enet_can_receive, s); qemu_format_nic_info_str(s->vc, s->macaddr); } Modified: trunk/hw/usb-net.c =================================================================== --- trunk/hw/usb-net.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/usb-net.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -1453,7 +1453,7 @@ pstrcpy(s->dev.devname, sizeof(s->dev.devname), "QEMU USB Network Interface"); - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, + s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, usbnet_receive, usbnet_can_receive, s); qemu_format_nic_info_str(s->vc, s->mac); Modified: trunk/hw/virtio-net.c =================================================================== --- trunk/hw/virtio-net.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/hw/virtio-net.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -315,7 +315,7 @@ n->rx_vq = virtio_add_queue(&n->vdev, 256, virtio_net_handle_rx); n->tx_vq = virtio_add_queue(&n->vdev, 256, virtio_net_handle_tx); memcpy(n->mac, nd->macaddr, 6); - n->vc = qemu_new_vlan_client(nd->vlan, nd->model, + n->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, virtio_net_receive, virtio_net_can_receive, n); qemu_format_nic_info_str(n->vc, n->mac); Modified: trunk/net.c =================================================================== --- trunk/net.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/net.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -325,6 +325,7 @@ VLANClientState *qemu_new_vlan_client(VLANState *vlan, const char *model, + const char *name, IOReadHandler *fd_read, IOCanRWHandler *fd_can_read, void *opaque) @@ -334,7 +335,10 @@ if (!vc) return NULL; vc->model = strdup(model); - vc->name = assign_name(vc, model); + if (name) + vc->name = strdup(name); + else + vc->name = assign_name(vc, model); vc->fd_read = fd_read; vc->fd_can_read = fd_can_read; vc->opaque = opaque; @@ -474,13 +478,13 @@ slirp_input(buf, size); } -static int net_slirp_init(VLANState *vlan, const char *model) +static int net_slirp_init(VLANState *vlan, const char *model, const char *name) { if (!slirp_inited) { slirp_inited = 1; slirp_init(); } - slirp_vc = qemu_new_vlan_client(vlan, model, + slirp_vc = qemu_new_vlan_client(vlan, model, name, slirp_receive, NULL, NULL); slirp_vc->info_str[0] = '\0'; return 0; @@ -694,7 +698,10 @@ /* fd support */ -static TAPState *net_tap_fd_init(VLANState *vlan, const char *model, int fd) +static TAPState *net_tap_fd_init(VLANState *vlan, + const char *model, + const char *name, + int fd) { TAPState *s; @@ -702,7 +709,7 @@ if (!s) return NULL; s->fd = fd; - s->vc = qemu_new_vlan_client(vlan, model, tap_receive, NULL, s); + s->vc = qemu_new_vlan_client(vlan, model, name, tap_receive, NULL, s); #ifdef HAVE_IOVEC s->vc->fd_readv = tap_receive_iov; #endif @@ -937,7 +944,8 @@ return 0; } -static int net_tap_init(VLANState *vlan, const char *model, const char *ifname1, +static int net_tap_init(VLANState *vlan, const char *model, + const char *name, const char *ifname1, const char *setup_script, const char *down_script) { TAPState *s; @@ -958,7 +966,7 @@ if (launch_script(setup_script, ifname, fd)) return -1; } - s = net_tap_fd_init(vlan, model, fd); + s = net_tap_fd_init(vlan, model, name, fd); if (!s) return -1; snprintf(s->vc->info_str, sizeof(s->vc->info_str), @@ -1002,7 +1010,8 @@ } } -static int net_vde_init(VLANState *vlan, const char *model, const char *sock, +static int net_vde_init(VLANState *vlan, const char *model, + const char *name, const char *sock, int port, const char *group, int mode) { VDEState *s; @@ -1023,7 +1032,7 @@ free(s); return -1; } - s->vc = qemu_new_vlan_client(vlan, model, vde_from_qemu, NULL, s); + s->vc = qemu_new_vlan_client(vlan, model, name, vde_from_qemu, NULL, s); qemu_set_fd_handler(vde_datafd(s->vde), vde_to_qemu, NULL, s); snprintf(s->vc->info_str, sizeof(s->vc->info_str), "sock=%s,fd=%d", sock, vde_datafd(s->vde)); @@ -1045,6 +1054,7 @@ typedef struct NetSocketListenState { VLANState *vlan; char *model; + char *name; int fd; } NetSocketListenState; @@ -1198,7 +1208,9 @@ return -1; } -static NetSocketState *net_socket_fd_init_dgram(VLANState *vlan, const char *model, +static NetSocketState *net_socket_fd_init_dgram(VLANState *vlan, + const char *model, + const char *name, int fd, int is_connected) { struct sockaddr_in saddr; @@ -1242,7 +1254,7 @@ return NULL; s->fd = fd; - s->vc = qemu_new_vlan_client(vlan, model, net_socket_receive_dgram, NULL, s); + s->vc = qemu_new_vlan_client(vlan, model, name, net_socket_receive_dgram, NULL, s); qemu_set_fd_handler(s->fd, net_socket_send_dgram, NULL, s); /* mcast: save bound address as dst */ @@ -1261,7 +1273,9 @@ qemu_set_fd_handler(s->fd, net_socket_send, NULL, s); } -static NetSocketState *net_socket_fd_init_stream(VLANState *vlan, const char *model, +static NetSocketState *net_socket_fd_init_stream(VLANState *vlan, + const char *model, + const char *name, int fd, int is_connected) { NetSocketState *s; @@ -1269,7 +1283,7 @@ if (!s) return NULL; s->fd = fd; - s->vc = qemu_new_vlan_client(vlan, model, + s->vc = qemu_new_vlan_client(vlan, model, name, net_socket_receive, NULL, s); snprintf(s->vc->info_str, sizeof(s->vc->info_str), "socket: fd=%d", fd); @@ -1281,7 +1295,8 @@ return s; } -static NetSocketState *net_socket_fd_init(VLANState *vlan, const char *model, +static NetSocketState *net_socket_fd_init(VLANState *vlan, + const char *model, const char *name, int fd, int is_connected) { int so_type=-1, optlen=sizeof(so_type); @@ -1293,13 +1308,13 @@ } switch(so_type) { case SOCK_DGRAM: - return net_socket_fd_init_dgram(vlan, model, fd, is_connected); + return net_socket_fd_init_dgram(vlan, model, name, fd, is_connected); case SOCK_STREAM: - return net_socket_fd_init_stream(vlan, model, fd, is_connected); + return net_socket_fd_init_stream(vlan, model, name, fd, is_connected); default: /* who knows ... this could be a eg. a pty, do warn and continue as stream */ fprintf(stderr, "qemu: warning: socket type=%d for fd=%d is not SOCK_DGRAM or SOCK_STREAM\n", so_type, fd); - return net_socket_fd_init_stream(vlan, model, fd, is_connected); + return net_socket_fd_init_stream(vlan, model, name, fd, is_connected); } return NULL; } @@ -1321,7 +1336,7 @@ break; } } - s1 = net_socket_fd_init(s->vlan, s->model, fd, 1); + s1 = net_socket_fd_init(s->vlan, s->model, s->name, fd, 1); if (!s1) { closesocket(fd); } else { @@ -1331,7 +1346,9 @@ } } -static int net_socket_listen_init(VLANState *vlan, const char *model, +static int net_socket_listen_init(VLANState *vlan, + const char *model, + const char *name, const char *host_str) { NetSocketListenState *s; @@ -1368,12 +1385,15 @@ } s->vlan = vlan; s->model = strdup(model); + s->name = strdup(name); s->fd = fd; qemu_set_fd_handler(fd, net_socket_accept, NULL, s); return 0; } -static int net_socket_connect_init(VLANState *vlan, const char *model, +static int net_socket_connect_init(VLANState *vlan, + const char *model, + const char *name, const char *host_str) { NetSocketState *s; @@ -1412,7 +1432,7 @@ break; } } - s = net_socket_fd_init(vlan, model, fd, connected); + s = net_socket_fd_init(vlan, model, name, fd, connected); if (!s) return -1; snprintf(s->vc->info_str, sizeof(s->vc->info_str), @@ -1421,7 +1441,9 @@ return 0; } -static int net_socket_mcast_init(VLANState *vlan, const char *model, +static int net_socket_mcast_init(VLANState *vlan, + const char *model, + const char *name, const char *host_str) { NetSocketState *s; @@ -1436,7 +1458,7 @@ if (fd < 0) return -1; - s = net_socket_fd_init(vlan, model, fd, 0); + s = net_socket_fd_init(vlan, model, name, fd, 0); if (!s) return -1; @@ -1474,6 +1496,7 @@ char buf[1024]; int vlan_id, ret; VLANState *vlan; + char *name = NULL; vlan_id = 0; if (get_param_value(buf, sizeof(buf), "vlan", p)) { @@ -1484,6 +1507,9 @@ fprintf(stderr, "Could not create vlan %d\n", vlan_id); return -1; } + if (get_param_value(buf, sizeof(buf), "name", p)) { + name = strdup(buf); + } if (!strcmp(device, "nic")) { NICInfo *nd; uint8_t *macaddr; @@ -1511,6 +1537,8 @@ nd->model = strdup(buf); } nd->vlan = vlan; + nd->name = name; + name = NULL; nb_nics++; vlan->nb_guest_devs++; ret = 0; @@ -1526,7 +1554,7 @@ pstrcpy(slirp_hostname, sizeof(slirp_hostname), buf); } vlan->nb_host_devs++; - ret = net_slirp_init(vlan, device); + ret = net_slirp_init(vlan, device, name); } else #endif #ifdef _WIN32 @@ -1537,7 +1565,7 @@ return -1; } vlan->nb_host_devs++; - ret = tap_win32_init(vlan, device, ifname); + ret = tap_win32_init(vlan, device, name, ifname); } else #elif defined (_AIX) #else @@ -1550,7 +1578,7 @@ fd = strtol(buf, NULL, 0); fcntl(fd, F_SETFL, O_NONBLOCK); ret = -1; - if (net_tap_fd_init(vlan, device, fd)) + if (net_tap_fd_init(vlan, device, name, fd)) ret = 0; } else { if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0) { @@ -1562,7 +1590,7 @@ if (get_param_value(down_script, sizeof(down_script), "downscript", p) == 0) { pstrcpy(down_script, sizeof(down_script), DEFAULT_NETWORK_DOWN_SCRIPT); } - ret = net_tap_init(vlan, device, ifname, setup_script, down_script); + ret = net_tap_init(vlan, device, name, ifname, setup_script, down_script); } } else #endif @@ -1571,14 +1599,14 @@ int fd; fd = strtol(buf, NULL, 0); ret = -1; - if (net_socket_fd_init(vlan, device, fd, 1)) + if (net_socket_fd_init(vlan, device, name, fd, 1)) ret = 0; } else if (get_param_value(buf, sizeof(buf), "listen", p) > 0) { - ret = net_socket_listen_init(vlan, device, buf); + ret = net_socket_listen_init(vlan, device, name, buf); } else if (get_param_value(buf, sizeof(buf), "connect", p) > 0) { - ret = net_socket_connect_init(vlan, device, buf); + ret = net_socket_connect_init(vlan, device, name, buf); } else if (get_param_value(buf, sizeof(buf), "mcast", p) > 0) { - ret = net_socket_mcast_init(vlan, device, buf); + ret = net_socket_mcast_init(vlan, device, name, buf); } else { fprintf(stderr, "Unknown socket options: %s\n", p); return -1; @@ -1606,17 +1634,20 @@ } else { vde_mode = 0700; } - ret = net_vde_init(vlan, device, vde_sock, vde_port, vde_group, vde_mode); + ret = net_vde_init(vlan, device, name, vde_sock, vde_port, vde_group, vde_mode); } else #endif { fprintf(stderr, "Unknown network device: %s\n", device); + if (name) + free(name); return -1; } if (ret < 0) { fprintf(stderr, "Could not initialize device '%s'\n", device); } - + if (name) + free(name); return ret; } Modified: trunk/net.h =================================================================== --- trunk/net.h 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/net.h 2009-01-07 17:48:51 UTC (rev 6220) @@ -33,6 +33,7 @@ VLANState *qemu_find_vlan(int id); VLANClientState *qemu_new_vlan_client(VLANState *vlan, const char *model, + const char *name, IOReadHandler *fd_read, IOCanRWHandler *fd_can_read, void *opaque); @@ -53,6 +54,7 @@ struct NICInfo { uint8_t macaddr[6]; const char *model; + const char *name; VLANState *vlan; }; Modified: trunk/qemu-doc.texi =================================================================== --- trunk/qemu-doc.texi 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/qemu-doc.texi 2009-01-07 17:48:51 UTC (rev 6220) @@ -608,10 +608,11 @@ @table @option -@item -net nic[,vlan=@var{n}][,macaddr=@var{addr}][,model=@var{type}] +@item -net nic[,vlan=@var{n}][,macaddr=@var{addr}][,model=@var{type}][,name=@var{name}] Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n} = 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 +target. Optionally, the MAC address can be changed to @var{addr} +and a @var{name} can be assigned for use in monitor commands. If no @option{-net} option is specified, a single NIC is created. Qemu can emulate several different models of network card. Valid values for @var{type} are @@ -621,12 +622,12 @@ 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=@var{n}][,hostname=@var{name}] +@item -net user[,vlan=@var{n}][,hostname=@var{name}][,name=@var{name}] Use the user mode network stack which requires no administrator privilege to run. @option{hostname=name} can be used to specify the client hostname reported by the builtin DHCP server. -@item -net tap[,vlan=@var{n}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}] +@item -net tap[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}] Connect the host TAP network interface @var{name} to VLAN @var{n}, use the network script @var{file} to configure it and the network script @var{dfile} to deconfigure it. If @var{name} is not provided, the OS @@ -647,7 +648,7 @@ @end example -@item -net socket[,vlan=@var{n}][,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}] +@item -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}] Connect the VLAN @var{n} to a remote VLAN in another QEMU virtual machine using a TCP socket connection. If @option{listen} is @@ -667,7 +668,7 @@ -net socket,connect=127.0.0.1:1234 @end example -@item -net socket[,vlan=@var{n}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}] +@item -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}] Create a VLAN @var{n} shared with another QEMU virtual machines using a UDP multicast socket, effectively making a bus for @@ -707,7 +708,7 @@ /path/to/linux ubd0=/path/to/root_fs eth0=mcast @end example -@item -net vde[,vlan=@var{n}][,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}] +@item -net vde[,vlan=@var{n}][,name=@var{name}][,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}] Connect VLAN @var{n} to PORT @var{n} of a vde switch running on host and listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname} and MODE @var{octalmode} to change default ownership and permissions for Modified: trunk/sysemu.h =================================================================== --- trunk/sysemu.h 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/sysemu.h 2009-01-07 17:48:51 UTC (rev 6220) @@ -75,7 +75,8 @@ #endif /* TAP win32 */ -int tap_win32_init(VLANState *vlan, const char *model, const char *ifname); +int tap_win32_init(VLANState *vlan, const char *model, + const char *name, const char *ifname); /* SLIRP */ void do_info_slirp(void); Modified: trunk/tap-win32.c =================================================================== --- trunk/tap-win32.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/tap-win32.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -660,7 +660,8 @@ } } -int tap_win32_init(VLANState *vlan, const char *model, const char *ifname) +int tap_win32_init(VLANState *vlan, const char *model, + const char *name, const char *ifname) { TAPState *s; @@ -672,7 +673,7 @@ return -1; } - s->vc = qemu_new_vlan_client(vlan, model, tap_receive, NULL, s); + s->vc = qemu_new_vlan_client(vlan, model, name, tap_receive, NULL, s); snprintf(s->vc->info_str, sizeof(s->vc->info_str), "tap: ifname=%s", ifname); Modified: trunk/vl.c =================================================================== --- trunk/vl.c 2009-01-07 17:47:15 UTC (rev 6219) +++ trunk/vl.c 2009-01-07 17:48:51 UTC (rev 6220) @@ -3887,30 +3887,30 @@ "-uuid %%08x-%%04x-%%04x-%%04x-%%012x specify machine UUID\n" "\n" "Network options:\n" - "-net nic[,vlan=n][,macaddr=addr][,model=type]\n" + "-net nic[,vlan=n][,macaddr=addr][,model=type][,name=str]\n" " create a new Network Interface Card and connect it to VLAN 'n'\n" #ifdef CONFIG_SLIRP - "-net user[,vlan=n][,hostname=host]\n" + "-net user[,vlan=n][,name=str][,hostname=host]\n" " connect the user mode network stack to VLAN 'n' and send\n" " hostname 'host' to DHCP clients\n" #endif #ifdef _WIN32 - "-net tap[,vlan=n],ifname=name\n" + "-net tap[,vlan=n][,name=str],ifname=name\n" " connect the host TAP network interface to VLAN 'n'\n" #else - "-net tap[,vlan=n][,fd=h][,ifname=name][,script=file][,downscript=dfile]\n" + "-net tap[,vlan=n][,name=str][,fd=h][,ifname=name][,script=file][,downscript=dfile]\n" " connect the host TAP network interface to VLAN 'n' and use the\n" " network scripts 'file' (default=%s)\n" " and 'dfile' (default=%s);\n" " use '[down]script=no' to disable script execution;\n" " use 'fd=h' to connect to an already opened TAP interface\n" #endif - "-net socket[,vlan=n][,fd=h][,listen=[host]:port][,connect=host:port]\n" + "-net socket[,vlan=n][,name=str][,fd=h][,listen=[host]:port][,connect=host:port]\n" " connect the vlan 'n' to another VLAN using a socket connection\n" - "-net socket[,vlan=n][,fd=h][,mcast=maddr:port]\n" + "-net socket[,vlan=n][,name=str][,fd=h][,mcast=maddr:port]\n" " connect the vlan 'n' to multicast maddr and port\n" #ifdef CONFIG_VDE - "-net vde[,vlan=n][,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" + "-net vde[,vlan=n][,name=str][,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" " connect the vlan 'n' to port 'n' of a vde switch running\n" " on host and listening for incoming connections on 'socketpath'.\n" " Use group 'groupname' and mode 'octalmode' to change default\n"