aboutsummaryrefslogtreecommitdiffstats
path: root/block/raw-posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/raw-posix.c')
-rw-r--r--block/raw-posix.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 57da1df64..93ed675b9 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1376,7 +1376,6 @@ static BlockDriverAIOCB *raw_aio_ioctl(BlockDriverState *bs,
}
#endif /* !linux && !FreeBSD */
-#if defined(__linux__) || defined(__FreeBSD__)
static int hdev_create(const char *filename, QEMUOptionParameter *options)
{
int fd;
@@ -1398,7 +1397,7 @@ static int hdev_create(const char *filename, QEMUOptionParameter *options)
if (fstat(fd, &stat_buf) < 0)
ret = -EIO;
- else if (!S_ISBLK(stat_buf.st_mode))
+ else if (!S_ISBLK(stat_buf.st_mode) && !S_ISCHR(stat_buf.st_mode))
ret = -EIO;
else if (lseek(fd, 0, SEEK_END) < total_size * 512)
ret = -ENOSPC;
@@ -1407,14 +1406,6 @@ static int hdev_create(const char *filename, QEMUOptionParameter *options)
return ret;
}
-#else /* !(linux || freebsd) */
-
-static int hdev_create(const char *filename, QEMUOptionParameter *options)
-{
- return -ENOTSUP;
-}
-#endif
-
static BlockDriver bdrv_host_device = {
.format_name = "host_device",
.instance_size = sizeof(BDRVRawState),