From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnoO3-0004qc-68 for qemu-devel@nongnu.org; Thu, 19 Jan 2012 04:34:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnoNz-0006Gu-SA for qemu-devel@nongnu.org; Thu, 19 Jan 2012 04:34:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnoNz-0006Gh-M4 for qemu-devel@nongnu.org; Thu, 19 Jan 2012 04:34:23 -0500 Message-ID: <4F17E39B.6030503@redhat.com> Date: Thu, 19 Jan 2012 10:34:19 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1326876486-13995-1-git-send-email-cyliu@suse.com> <4F16A56E.4040303@msgid.tls.msk.ru> <4F16AC61.3000400@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH][resend] Add -f option to qemu-nbd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chunyan Liu , Michael Tokarev , Stefan Hajnoczi , qemu-devel On 01/19/2012 10:16 AM, Chunyan Liu wrote: >> > Yes, that's true. He could have two definitions (SOCKET_PATH with %d and >> > SOCKET_PATH_HELP without) so that the occurrences would stay close in the >> > source code. > Not clear how it will use SOCKET_PATH and SOCKET_PATH_HELP. > SOCKET_PATH_HELP stores the abstract string of sock path? (e.g. > /var/lock/qemu-nbd-xxx) Yes (s/xxx/PID/). >> Yes, though actually ENOENT is an important special case that is worth >> reporting to the user. It happens when the nbd module is not loaded. > If nbd module is not loaded, open device will fail, we can add error info: > fd = open(device, O_RDWR); > if (fd == -1) { > fprintf(stderr, "Failed to open %s\n", device); > continue; > } > And in next place, if using err instead of fprintf, it will print ENOENT error > message. Is that enough? You do not need this fprintf. Otherwise, yes. Please build your patch on top of git://github.com/bonzini/qemu.git, branch nbd-next. Thanks, Paolo