There has been comments on this patch, but i forgot adding this patch to
the list, just forward it again.
When manage VMs via libvirt, qemu ofter runs with limited permission,
thus qemu can't create a file/socket, this patch is to add a new
parameter 'sockfd' to accept fd opened and passed in from libvirt.
Signed-off-by: Wei Xu <w...@redhat.com>
---
qapi-schema.json | 3 ++-
qemu-char.c | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index 8483bdf..e9f0268 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2921,7 +2921,8 @@
##
{ 'struct': 'UnixSocketAddress',
'data': {
- 'path': 'str' } }
+ 'path': 'str',
+ 'sockfd': 'int32' } }
##
# @SocketAddress
diff --git a/qemu-char.c b/qemu-char.c
index b597ee1..ea9c02e 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -4116,6 +4116,9 @@ QemuOptsList qemu_chardev_opts = {
.name = "path",
.type = QEMU_OPT_STRING,
},{
+ .name = "sockfd",
+ .type = QEMU_OPT_NUMBER,
+ },{
.name = "host",
.type = QEMU_OPT_STRING,
},{
--
2.7.1