aboutsummaryrefslogtreecommitdiff
path: root/qemu-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-config.c')
-rw-r--r--qemu-config.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/qemu-config.c b/qemu-config.c
index d4a2f43ff4..8254b35169 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -488,3 +488,18 @@ out:
loc_pop(&loc);
return res;
}
+
+int qemu_read_config_file(const char *filename)
+{
+ FILE *f = fopen(filename, "r");
+ if (f == NULL) {
+ return -errno;
+ }
+
+ if (qemu_config_parse(f, filename) != 0) {
+ return -EINVAL;
+ }
+ fclose(f);
+
+ return 0;
+}