All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Xu <wexu@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [RFC Patch 2/3] chardev: save the passed in 'fd' parameter during parsing
Date: Wed, 22 Jun 2016 23:26:33 +0800	[thread overview]
Message-ID: <576AAE29.8050802@redhat.com> (raw)
In-Reply-To: <1464712247-11655-3-git-send-email-wexu@redhat.com>

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

Save the 'fd' paramter as unix socket 'sockfd' member.

Signed-off-by: Wei Xu <wexu@redhat.com>
---
  qemu-char.c | 7 +++++++
  1 file changed, 7 insertions(+)

diff --git a/qemu-char.c b/qemu-char.c
index ea9c02e..8d20494 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3664,6 +3664,7 @@ static void qemu_chr_parse_socket(QemuOpts *opts, 
ChardevBackend *backend,
      bool is_telnet      = qemu_opt_get_bool(opts, "telnet", false);
      bool do_nodelay     = !qemu_opt_get_bool(opts, "delay", true);
      int64_t reconnect   = qemu_opt_get_number(opts, "reconnect", 0);
+    const int32_t fd = (int32_t)qemu_opt_get_number(opts, "sockfd", 0);
      const char *path = qemu_opt_get(opts, "path");
      const char *host = qemu_opt_get(opts, "host");
      const char *port = qemu_opt_get(opts, "port");
@@ -3708,6 +3709,12 @@ static void qemu_chr_parse_socket(QemuOpts *opts, 
ChardevBackend *backend,
          addr->type = SOCKET_ADDRESS_KIND_UNIX;
          q_unix = addr->u.q_unix.data = g_new0(UnixSocketAddress, 1);
          q_unix->path = g_strdup(path);
+
+        if (fd) {
+            q_unix->sockfd = fd;
+        } else {
+            q_unix->sockfd = 0;
+        }
      } else {
          addr->type = SOCKET_ADDRESS_KIND_INET;
          addr->u.inet.data = g_new(InetSocketAddress, 1);
-- 
2.7.1

      parent reply	other threads:[~2016-06-22 15:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1464712247-11655-1-git-send-email-wexu@redhat.com>
     [not found] ` <574DC83B.9010802@redhat.com>
2016-06-01 15:44   ` [Qemu-devel] [RFC Patch 0/3] Accept passed in socket 'fd' open from outside for unix socket Wei Xu
     [not found] ` <20160531164448.GE21628@redhat.com>
2016-06-01 16:16   ` Wei Xu
2016-06-02  7:41     ` Michal Privoznik
2016-06-02  8:29       ` Daniel P. Berrange
2016-06-02 11:38         ` Michal Privoznik
2016-06-02 18:07           ` Wei Xu
2016-06-03  8:32             ` Daniel P. Berrange
2016-06-08 10:07           ` Amnon Ilan
     [not found]             ` <20160608212738.GH3073@plex>
     [not found]               ` <f7tvb1jxsfq.fsf@redhat.com>
2016-06-09  7:46                 ` Amnon Ilan
2016-06-09  9:16                 ` Daniel P. Berrange
2016-06-13  8:57                   ` Michal Privoznik
2016-06-14  8:03                 ` Wei Xu
2016-06-14  8:17                   ` Daniel P. Berrange
2016-06-14 14:23                     ` Aaron Conole
2016-06-14 17:50                       ` Wei Xu
2016-06-14 12:47                   ` Amnon Ilan
2016-06-14 14:21                   ` Aaron Conole
2016-06-02 19:27         ` [Qemu-devel] Channel paths (was: Re: [RFC Patch 0/3] Accept passed in socket 'fd' open from outside for unix socket) Sascha Silbe
     [not found]         ` <201606021927.u52JB3YU031760@mx0a-001b2d01.pphosted.com>
2016-06-03  8:34           ` Daniel P. Berrange
2016-06-07 18:44             ` [Qemu-devel] Channel paths Sascha Silbe
2016-06-22 15:24 ` [Qemu-devel] [RFC Patch 0/3] Accept passed in socket 'fd' open from outside for unix socket Wei Xu
     [not found] ` <1464712247-11655-3-git-send-email-wexu@redhat.com>
     [not found]   ` <574DC93E.4000700@redhat.com>
2016-06-01 16:20     ` [Qemu-devel] [RFC Patch 2/3] chardev: save the passed in 'fd' parameter during parsing Wei Xu
2016-06-22 15:26   ` Wei Xu [this message]

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=576AAE29.8050802@redhat.com \
    --to=wexu@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.