From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOVPQ-0000m9-JC for qemu-devel@nongnu.org; Mon, 23 May 2011 09:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOVPP-0006OR-LY for qemu-devel@nongnu.org; Mon, 23 May 2011 09:43:00 -0400 Received: from verein.lst.de ([213.95.11.211]:43305 helo=newverein.lst.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOVPP-0006OM-Gf for qemu-devel@nongnu.org; Mon, 23 May 2011 09:42:59 -0400 Date: Mon, 23 May 2011 15:42:58 +0200 From: Christoph Hellwig Message-ID: <20110523134258.GA18354@lst.de> References: <4DDA5442.30801@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DDA5442.30801@amd.com> Subject: Re: [Qemu-devel] [PATCH] block/raw-posix: use a character device if a block device is given List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Egger Cc: "qemu-devel@nongnu.org" > + if (lstat(filename, &sb) < 0) { > + fprintf(stderr, "%s: stat failed: %s\n", filename, > strerror(errno)); > + return -errno; > + } > + > + if (S_ISBLK(sb.st_mode)) > + filename = raw_get_rawdevice(filename); Please move the lstat and S_ISBLK check into raw_get_rawdevice. Also it might be worth to rename it to something like raw_normalize_devicepath.