Message ID | 1416310508-5122-7-git-send-email-kwolf@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/block/raw-posix.c b/block/raw-posix.c index d106fc4..b1af77e 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -1454,7 +1454,12 @@ static int raw_create(const char *filename, QemuOpts *opts, Error **errp) left -= result; } if (result >= 0) { - fsync(fd); + result = fsync(fd); + if (result < 0) { + result = -errno; + error_setg_errno(errp, -result, + "Could not flush new file to disk"); + } } g_free(buf); break;