QemuOpts: Fix qemu_config_parse() to catch file read errors
diff --git a/qemu-config.c b/qemu-config.c
index 2de97cd..ad130fb 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -475,6 +475,10 @@
         error_report("parse error");
         goto out;
     }
+    if (ferror(fp)) {
+        error_report("error reading file");
+        goto out;
+    }
     res = 0;
 out:
     loc_pop(&loc);