Message ID | 1437384527-22987-3-git-send-email-fan.du@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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));
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(-)