qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block/raw-posix: use a character device if a bl


From: Christoph Hellwig
Subject: Re: [Qemu-devel] [PATCH] block/raw-posix: use a character device if a block device is given
Date: Mon, 23 May 2011 15:42:58 +0200
User-agent: Mutt/1.5.17 (2007-11-01)

> +    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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]