Re: [PATCH] Add -netdev to man page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/01/2012 02:51 PM, Miroslav Rezanina wrote:
> There's missing -netdev description in the man page for qemu. As this is
> recommended way to create network backend, lack of documentation can discourage
> its usage.
>
> -net option is preserved but marked as obsolete way.

Please post to qemu-devel@xxxxxxxxxx instead.

>      "socket],id=str[,option][,option][,...]\n", QEMU_ARCH_ALL)
>  STEXI
> +@item -netdev user|tap|vde|socket,id=@var{str}[,option][,option][,...]
> +
> +Create a new network backend to the guest. 

"for the guest"?  But they're actually not for the guest, at least not
directly.

> Network's id 

"The backend's id" or "network backend identifiers"

> can be used with
> +the -device option to "plug" a particular network device into the network 
> +backend, e.g.

"to connect a backend with a device"?

> +
> +@example
> +-netdev user,id=mynet -device e1000,netdev=mynet
> +@end example
> +
> +You can use following types of backend:
> +
> +@table @option
> +
> +@item -netdev user
> +
> +User networking is default network backend. This backend does not require root 
> +priviledges, does not allow ICMP trafic and host is not directly accessible 
> +from the host or the external network.
> +
> +Valid options are:
> +
> +@table @option
> +
> +@item restrict=y|yes|n|no
> +If this options is enabled, the guest will be isolated, i.e. it will not be
> +able to contact the host and no guest IP packets will be routed over the host
> +to the outside. This option does not affect explicitly set forwarding rule.

"rules"

> +
> +@item net=@var{addr}[/@var{mask}]
> +Set IP network address the guest will see. Optionally specify the netmask,

"the IP"

> +either in the form a.b.c.d or as number of valid top-most bits. Default is
> +10.0.2.0/8.
> +
> +@item host=@var{addr}
> +Specify the guest-visible address of the host. Default is the 2nd IP in the
> +guest network, i.e. x.x.x.2.
> +
> +@item hostname=@var{name}
> +Specifies the client hostname reported by the builtin DHCP server.
> +
> +@item dhcpstart=@var{addr}
> +Specify the first of the 16 IPs the built-in DHCP server can assign. Default
> +is the 16th to 31st IP in the guest network, i.e. x.x.x.16 to x.x.x.31.
> +
> +@item dns=@var{addr}
> +Specify the guest-visible address of the virtual nameserver. The address must
> +be different from the host address. Default is the 3rd IP in the guest network,
> +i.e. x.x.x.3.
> +
> +@item tftp=@var{dir}
> +When using the user mode network stack, activate a built-in TFTP
> +server. The files in @var{dir} will be exposed as the root of a TFTP server.
> +The TFTP client on the guest must be configured in binary mode (use the command
> +@code{bin} of the Unix TFTP client).
> +
> +@item bootfile=@var{file}
> +When using the user mode network stack, broadcast @var{file} as the BOOTP
> +filename. In conjunction with @option{tftp}, this can be used to network boot
> +a guest from a local directory.
> +
> +Example (using pxelinux):
> +@example
> +qemu -hda linux.img -boot n -netdev user,id=netid,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
> +@end example
> +
> +@item smb=@var{dir}[,smbserver=@var{addr}]
> +When using the user mode network stack, activate a built-in SMB
> +server so that Windows OSes can access to the host files in @file{@var{dir}}
> +transparently. The IP address of the SMB server can be set to @var{addr}. By
> +default the 4th IP in the guest network is used, i.e. x.x.x.4.
> +
> +In the guest Windows OS, the line:
> +@example
> +10.0.2.4 smbserver
> +@end example
> +must 

"may"?

> be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me)
> +or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
> +
> +Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
> +
> +Note that a SAMBA server must be installed on the host OS in
> +@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from
> +Red Hat 9, Fedora Core 3 and OpenSUSE 11.x.
> +
> +@item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
> +Redirect incoming TCP or UDP connections to the host port @var{hostport} to
> +the guest IP address @var{guestaddr} on guest port @var{guestport}. If
> +@var{guestaddr} is not specified, its value is x.x.x.15 (default first address
> +given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can
> +be bound to a specific host interface. If no connection type is set, TCP is
> +used. This option can be given multiple times.
> +
> +For example, to redirect host X11 connection from screen 1 to guest
> +screen 0, use the following:
> +
> +@example
> +# on the host
> +qemu -netdev user,id=netid,hostfwd=tcp:127.0.0.1:6001-:6000 [...]
> +# this host xterm should open in the guest X11 server
> +xterm -display :1
> +@end example
> +
> +To redirect telnet connections from host port 5555 to telnet port on
> +the guest, use the following:
> +
> +@example
> +# on the host
> +qemu -netdev user,id=netid,hostfwd=tcp:5555::23 [...]
> +telnet localhost 5555
> +@end example
> +
> +Then when you use on the host @code{telnet localhost 5555}, you
> +connect to the guest telnet server.
> +
> +@item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
> +Forward guest TCP connections to the IP address @var{server} on port @var{port}
> +to the character device @var{dev}. This option can be given multiple times.
> +
> +@end table
> +
> +@item -netdev tap
> +
> +The tap networking backend makes use of a tap networking device in the host. 
> +It offers very good performance and can be configured to create virtually 
> +any type of network topology. It requires configuration of that network 
> +topology in the host and invoking QEMU as root.

unless the tap device has been pre-configured to be owned by the user
invoking qemu, or the fd option is used.

> +
> +Valid options are:
> +
> +@table @option
> +
> +@item ifname=@var{name}
> +Name of host tap device to be used by qemu. 
> +
> +@item fd=@var{descriptor}
> +File descriptor of an already opened tap.
> +
> +@item script=@var{scriptpath}
> +Network script used to configure device.
> +
> +@item downscript=@var{scriptpath}
> +Network script used to deconfigure device.
> +
> +@item sndbuf=@var{size}
> +Limit for send buffer.
> +
> +@item vnet_hdr=on|off]
> +Enable the IFF_VNET_HDR flag on the tap interface.
> +
> +@item vhost=[on|off]
> +Enable vhost-net network accelerator.
> +
> +@item vhostfd=@var{descriptor}
> +File descriptor of an already opened vhost net device.

"vhost-net"


-- 
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux