All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fan Du <fan.du@intel.com>
To: kvm@vger.kernel.org
Cc: penberg@kernel.org, Fan Du <fan.du@intel.com>
Subject: [PATCH 2/3] kvm-tool: Pass address of pointer to ioctl for tap
Date: Mon, 20 Jul 2015 17:28:46 +0800	[thread overview]
Message-ID: <1437384527-22987-3-git-send-email-fan.du@intel.com> (raw)
In-Reply-To: <1437384527-22987-1-git-send-email-fan.du@intel.com>

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


  parent reply	other threads:[~2015-07-20  9:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20  9:28 [PATCH 0/3] Fixes for kvmtool virtio-net part Fan Du
2015-07-20  9:28 ` [PATCH 1/3] kvm-tool: Introduce downscript option Fan Du
2015-07-20 14:45   ` Andre Przywara
2015-07-20  9:28 ` Fan Du [this message]
2015-07-20  9:28 ` [PATCH 3/3] kvm-tool: Restrict queue number to 1 when vhost on Fan Du
2015-07-20 14:42 ` [PATCH 0/3] Fixes for kvmtool virtio-net part Andre Przywara
2015-07-21  3:09   ` Du, Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437384527-22987-3-git-send-email-fan.du@intel.com \
    --to=fan.du@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=penberg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.