diff --git a/qemu-io.c b/qemu-io.c index b2f2f5a9a97c73a76c2d93b62a085c1159f5263c..2f195bfe4fe34ceda85e130949c7128e45e26995 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -1284,7 +1284,7 @@ static int openfile(char *name, int flags, int growable) flags |= BDRV_O_FILE; } - if (bdrv_open(bs, name, flags) == -1) { + if (bdrv_open(bs, name, flags) < 0) { fprintf(stderr, "%s: can't open device %s\n", progname, name); bs = NULL; return 1;