From: "Denis V. Lunev" <den@openvz.org>
To: qemu-devel@nongnu.org
Cc: den@openvz.org, Yuriy Pudgorodskiy <yur@virtuozzo.com>,
Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 1/2] qga: fix fd leak with guest-exec i/o channels
Date: Wed, 6 Apr 2016 08:43:30 +0300 [thread overview]
Message-ID: <1459921411-20723-2-git-send-email-den@openvz.org> (raw)
In-Reply-To: <1459921411-20723-1-git-send-email-den@openvz.org>
From: Yuriy Pudgorodskiy <yur@virtuozzo.com>
Signed-off-by: Yuriy Pudgorodskiy <yur@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Michael Roth <mdroth@linux.vnet.ibm.com>
---
qga/commands.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qga/commands.c b/qga/commands.c
index e091ee1..9ad2f7d 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -446,6 +446,7 @@ GuestExec *qmp_guest_exec(const char *path,
g_io_channel_set_encoding(in_ch, NULL, NULL);
g_io_channel_set_buffered(in_ch, false);
g_io_channel_set_flags(in_ch, G_IO_FLAG_NONBLOCK, NULL);
+ g_io_channel_set_close_on_unref(in_ch, true);
g_io_add_watch(in_ch, G_IO_OUT, guest_exec_input_watch, &gei->in);
}
@@ -461,6 +462,8 @@ GuestExec *qmp_guest_exec(const char *path,
g_io_channel_set_encoding(err_ch, NULL, NULL);
g_io_channel_set_buffered(out_ch, false);
g_io_channel_set_buffered(err_ch, false);
+ g_io_channel_set_close_on_unref(out_ch, true);
+ g_io_channel_set_close_on_unref(err_ch, true);
g_io_add_watch(out_ch, G_IO_IN | G_IO_HUP,
guest_exec_output_watch, &gei->out);
g_io_add_watch(err_ch, G_IO_IN | G_IO_HUP,
--
2.1.4
next prev parent reply other threads:[~2016-04-06 5:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-06 5:43 [Qemu-devel] [PATCH for 2.6 0/2] qga: guest exec bugfixes Denis V. Lunev
2016-04-06 5:43 ` Denis V. Lunev [this message]
2016-04-06 23:53 ` [Qemu-devel] [PATCH 1/2] qga: fix fd leak with guest-exec i/o channels Michael Roth
2016-04-07 11:22 ` Yuriy Pudgorodskiy
2016-04-07 14:26 ` Michael Roth
2016-04-06 5:43 ` [Qemu-devel] [PATCH 2/2] qga: Workaround for console redirection from non-interactive qemu-ga service Denis V. Lunev
2016-04-07 14:29 ` [Qemu-devel] [PATCH for 2.6 0/2] qga: guest exec bugfixes Michael Roth
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=1459921411-20723-2-git-send-email-den@openvz.org \
--to=den@openvz.org \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=yur@virtuozzo.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).