|
From: | Christoph Egger |
Subject: | Re: [Qemu-devel] [PATCH] block/raw-posix: use a character device if a block device is given |
Date: | Mon, 23 May 2011 15:49:12 +0200 |
User-agent: | Mozilla/5.0 (X11; U; NetBSD amd64; en-US; rv:1.9.2.13) Gecko/20110202 Lightning/1.0b3pre Thunderbird/3.1.7 |
On 05/23/11 15:42, Christoph Hellwig wrote:
+ 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.
Why? What raw_get_rawdevice() does is only relevant to block devices and this hunk makes that clear. Christoph> Also it might be worth to rename it to something like raw_normalize_devicepath.
-- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632
[Prev in Thread] | Current Thread | [Next in Thread] |