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

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

 



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@xxxxxxxxx>
Fixes: e325f3e77e78 ("kvmtool: Add minimal support for macvtap")
---
 tools/kvm/virtio/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));
-- 
1.8.3.1

--
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