]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Add MACRO for user and tap mode for virtio net
authorAsias He <asias.hejun@gmail.com>
Wed, 29 Jun 2011 08:47:29 +0000 (16:47 +0800)
committerPekka Enberg <penberg@kernel.org>
Thu, 30 Jun 2011 07:42:45 +0000 (10:42 +0300)
This patch prepares the user and tap mode for virtio net.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/include/kvm/virtio-net.h
tools/kvm/virtio/net.c

index 00f3220d03b99abb0bd6d52acf37871c4d53fae0..e93e8e4cac8c8d6f9e1e69d65238718be7481091 100644 (file)
@@ -8,8 +8,12 @@ struct virtio_net_parameters {
        const char *host_ip;
        char guest_mac[6];
        const char *script;
+       int mode;
 };
 
 void virtio_net__init(const struct virtio_net_parameters *params);
 
+#define NET_MODE_USER  0
+#define NET_MODE_TAP   1
+
 #endif /* KVM__VIRTIO_NET_H */
index 6916af60dc4ddc5777dd6cf77c66a95dab517c6f..68967f204e7132de063881d828d2c9bc2ec3c359 100644 (file)
@@ -63,6 +63,9 @@ struct net_device {
 
        int                             tap_fd;
        char                            tap_name[IFNAMSIZ];
+
+       int                             mode;
+
 };
 
 static struct net_device ndev = {