From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XknMf-0000WS-Nh for mharc-qemu-trivial@gnu.org; Sun, 02 Nov 2014 01:06:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XknMe-0000VY-7O for qemu-trivial@nongnu.org; Sun, 02 Nov 2014 01:06:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XknMd-0007h8-9s for qemu-trivial@nongnu.org; Sun, 02 Nov 2014 01:06:08 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:59995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XknMX-0007gj-Ar; Sun, 02 Nov 2014 01:06:01 -0400 Received: from [192.168.88.2] (mjt.vpn.tls.msk.ru [192.168.177.99]) by isrv.corpit.ru (Postfix) with ESMTP id 8A0D740231; Sun, 2 Nov 2014 08:06:00 +0300 (MSK) Message-ID: <5455BBB8.5040205@msgid.tls.msk.ru> Date: Sun, 02 Nov 2014 08:06:00 +0300 From: Michael Tokarev Organization: Telecom Service, JSC User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: arei.gonglei@huawei.com, qemu-devel@nongnu.org References: <1414735861-1232-1-git-send-email-arei.gonglei@huawei.com> <1414735861-1232-2-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1414735861-1232-2-git-send-email-arei.gonglei@huawei.com> OpenPGP: id=804465C5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, peter.huangpeng@huawei.com, stefanha@redhat.com Subject: Re: [Qemu-trivial] [PATCH 1/2] tap: remove close(fd) X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 05:06:09 -0000 31.10.2014 09:11, arei.gonglei@huawei.com wrote: > From: Gonglei > > commit 5193e5fb (tap: factor out common tap initialization) > introduce net_init_tap_one(). But it's inapposite that close > fd in net_init_tap_one(), we should lay it in the caller, > becuase some caller needn't to close it if we get the fd > by monitor_handle_fd_param(). > > On the other hand, in other exceptional branch fd doesn't > be closed, so that's incomplete. Applied to -trivial, with grammar tweaking in commit message and with slightly better (in my opinion) subject, like this: tap: do not close(fd) in net_init_tap_one() commit 5193e5fb (tap: factor out common tap initialization) introduce net_init_tap_one(). But it's inappropriate that we close fd in net_init_tap_one(), we should lay it in the caller, becuase some callers needn't to close it if we get the fd by monitor_handle_fd_param(). On the other hand, in other exceptional branches fd isn't closed, so that's incomplete anyway. Thanks, /mjt From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XknMc-0000VT-Bz for qemu-devel@nongnu.org; Sun, 02 Nov 2014 01:06:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XknMX-0007gn-HM for qemu-devel@nongnu.org; Sun, 02 Nov 2014 01:06:06 -0400 Message-ID: <5455BBB8.5040205@msgid.tls.msk.ru> Date: Sun, 02 Nov 2014 08:06:00 +0300 From: Michael Tokarev MIME-Version: 1.0 References: <1414735861-1232-1-git-send-email-arei.gonglei@huawei.com> <1414735861-1232-2-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1414735861-1232-2-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH 1/2] tap: remove close(fd) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, peter.huangpeng@huawei.com, stefanha@redhat.com 31.10.2014 09:11, arei.gonglei@huawei.com wrote: > From: Gonglei > > commit 5193e5fb (tap: factor out common tap initialization) > introduce net_init_tap_one(). But it's inapposite that close > fd in net_init_tap_one(), we should lay it in the caller, > becuase some caller needn't to close it if we get the fd > by monitor_handle_fd_param(). > > On the other hand, in other exceptional branch fd doesn't > be closed, so that's incomplete. Applied to -trivial, with grammar tweaking in commit message and with slightly better (in my opinion) subject, like this: tap: do not close(fd) in net_init_tap_one() commit 5193e5fb (tap: factor out common tap initialization) introduce net_init_tap_one(). But it's inappropriate that we close fd in net_init_tap_one(), we should lay it in the caller, becuase some callers needn't to close it if we get the fd by monitor_handle_fd_param(). On the other hand, in other exceptional branches fd isn't closed, so that's incomplete anyway. Thanks, /mjt