diff mbox

[2/3] kvm-tool: Pass address of pointer to ioctl for tap

Message ID 1437384527-22987-3-git-send-email-fan.du@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Du, Fan July 20, 2015, 9:28 a.m. UTC
When enable virtio tap mode as root previliege by:
lkvm run --disk linux-0.2.img  --kernel bzImage --network virtio

lkvm spits:
[    1.981352] loop: module loaded
[    1.986039]  vda:
  Warning: Config tap device error. Are you root?
You have requested a TAP device, but creation of one has failed because: Invalid argument

The last param of ioctl should be a pointer address

Signed-off-by: Fan Du <fan.du@intel.com>
Fixes: e325f3e77e78 ("kvmtool: Add minimal support for macvtap")
---
 tools/kvm/virtio/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c
index f3f7200..5678ff2 100644
--- a/tools/kvm/virtio/net.c
+++ b/tools/kvm/virtio/net.c
@@ -286,7 +286,7 @@  static int virtio_net_request_tap(struct net_dev *ndev, struct ifreq *ifr,
 	if (tapname)
 		strncpy(ifr->ifr_name, tapname, sizeof(ifr->ifr_name));
 
-	ret = ioctl(ndev->tap_fd, TUNSETIFF, &ifr);
+	ret = ioctl(ndev->tap_fd, TUNSETIFF, ifr);
 
 	if (ret >= 0)
 		strncpy(ndev->tap_name, ifr->ifr_name, sizeof(ndev->tap_name));