|
From: | Antonios Motakis |
Subject: | Re: [Qemu-devel] [PATCH 3/5] Add vhostsock option |
Date: | Wed, 4 Dec 2013 16:21:45 +0100 |
On Fri, Nov 29, 2013 at 08:52:24PM +0100, Antonios Motakis wrote:This is a weird hack. Why check for VHOST_NET_DEFAULT_SOCK at all?
> @@ -91,15 +91,27 @@ static int vhost_net_get_fd(NetClientState *backend)
> }
> }
>
> -struct vhost_net *vhost_net_init(NetClientState *backend, int devfd,
> - bool force)
> +struct vhost_net *vhost_net_init(NetClientState *backend, char *vhostsock,
> + int devfd, bool force)
> {
> int r;
> struct vhost_net *net = g_malloc(sizeof *net);
> + const char *backend_sock = 0;
> + VhostBackendType backend_type = VHOST_BACKEND_TYPE_NONE;
> +
> if (!backend) {
> fprintf(stderr, "vhost-net requires backend to be setup\n");
> goto fail;
> }
> +
> + if (vhostsock && strcmp(vhostsock, VHOST_NET_DEFAULT_SOCK) != 0) {
If the option is not present then kernel vhost is used, if the option is
present then userspace vhost is used. I don't understand why a magic
hardcoded path is useful.
[Prev in Thread] | Current Thread | [Next in Thread] |