Commit 098ffa66 authored by Max Reitz's avatar Max Reitz Committed by Kevin Wolf

block/raw-posix: Catch fsync() errors

fsync() may fail, and that case should be handled.
Reported-by: default avatarLászló Érsek <>
Signed-off-by: default avatarMax Reitz <>
Signed-off-by: default avatarKevin Wolf <>
parent 731de380
......@@ -1454,7 +1454,12 @@ static int raw_create(const char *filename, QemuOpts *opts, Error **errp)
left -= result;
if (result >= 0) {
result = fsync(fd);
if (result < 0) {
result = -errno;
error_setg_errno(errp, -result,
"Could not flush new file to disk");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment