diff options
author | Stefan Hajnoczi | 2012-08-21 22:52:08 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2012-09-07 08:15:19 +0200 |
commit | 1241ed94c331ddd8fc8297b02b4508ead59467de (patch) | |
tree | 745c7cd744ae2b8f92832c50ea2e4e02ed33d02d /hw/vhost.c | |
parent | monitor: Rename+move net_handle_fd_param -> monitor_handle_fd_param (diff) | |
download | qemu-1241ed94c331ddd8fc8297b02b4508ead59467de.tar.gz qemu-1241ed94c331ddd8fc8297b02b4508ead59467de.tar.xz qemu-1241ed94c331ddd8fc8297b02b4508ead59467de.zip |
vhost: Pass device path to vhost_dev_init()
The path to /dev/vhost-net is currently hardcoded in vhost_dev_init().
This needs to be changed so that /dev/vhost-scsi can be used. Pass in
the device path instead of hardcoding it.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/vhost.c')
-rw-r--r-- | hw/vhost.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/vhost.c b/hw/vhost.c index 0fd8da84e2..d0ce5aad9b 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -747,14 +747,15 @@ static void vhost_eventfd_del(MemoryListener *listener, { } -int vhost_dev_init(struct vhost_dev *hdev, int devfd, bool force) +int vhost_dev_init(struct vhost_dev *hdev, int devfd, const char *devpath, + bool force) { uint64_t features; int r; if (devfd >= 0) { hdev->control = devfd; } else { - hdev->control = open("/dev/vhost-net", O_RDWR); + hdev->control = open(devpath, O_RDWR); if (hdev->control < 0) { return -errno; } |