From: Asias He Date: Wed, 18 May 2011 08:19:12 +0000 (+0800) Subject: kvm tools: Remove unnecessary S_ISBLK check X-Git-Tag: next-20110824~3^2~297 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=429e1c70e2a2040d67fd191c9800ee19ea68978f;p=karo-tx-linux.git kvm tools: Remove unnecessary S_ISBLK check Let's do it in blkdev__probe. Signed-off-by: Asias He Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/disk/core.c b/tools/kvm/disk/core.c index a0ccdc526b6a..6894b177a73c 100644 --- a/tools/kvm/disk/core.c +++ b/tools/kvm/disk/core.c @@ -34,18 +34,22 @@ struct disk_image *disk_image__open(const char *filename, bool readonly) if (stat(filename, &st) < 0) return NULL; - if (S_ISBLK(st.st_mode)) - return blkdev__probe(filename, &st); + /* blk device ?*/ + disk = blkdev__probe(filename, &st); + if (disk) + return disk; fd = open(filename, readonly ? O_RDONLY : O_RDWR); if (fd < 0) return NULL; - disk = qcow_probe(fd, readonly); + /* qcow image ?*/ + disk = qcow_probe(fd, readonly); if (disk) return disk; - disk = raw_image__probe(fd, &st, readonly); + /* raw image ?*/ + disk = raw_image__probe(fd, &st, readonly); if (disk) return disk;