[Top][All Lists]

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

[Qemu-devel] [RFC Patch 0/3] Accept passed in socket 'fd' open from outs

From: Wei Xu
Subject: [Qemu-devel] [RFC Patch 0/3] Accept passed in socket 'fd' open from outside for unix socket
Date: Wed, 22 Jun 2016 23:24:53 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

There has been comments on this patch, but i forgot adding this patch to the list, just forward it again.

Recently I'm working on a fd passing issue, selinux forbids qemu to
create a unix socket for a chardev when managing VMs with libvirt,
because qemu don't have sufficient permissions in this case, and
proposal from libvirt team is opening the 'fd' in libvirt and merely
passing it to qemu.

I finished a RFC patch for Unix socket after a glance of the code,
and not sure if this is right or there maybe other side-effects,
please point me out.

I tested it for both server and client mode 'PF_UNIX' socket with a VM
running vhost-user.

Old command line:
-chardev socket,id=char0,path=/var/run/openvswitch/vhost-user1,server

New command line:
-chardev socket,id=char0,path=/var/run/openvswitch/vhost-user1,server,sockfd=$n

because unix socket is bundled with a path, so it should be kept even with the
'fd' is indicated, this looks odd, any comments?

Wei Xu (3):
  chardev: add new socket fd parameter for unix socket
  chardev: save the passed in 'fd' parameter during parsing
  sockets: replace creating a new socket with the record one

 qapi-schema.json    |  3 ++-
 qemu-char.c         | 10 ++++++++++
 util/qemu-sockets.c | 25 +++++++++++++++++--------
 3 files changed, 29 insertions(+), 9 deletions(-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]