Add "romfile" code to assist with extract integer config settings.

Add romfile_loadint() function which can be used to extract a
little-endian binary encoded integer from rom.
diff --git a/src/paravirt.c b/src/paravirt.c
index 09e3d23..9cf77de 100644
--- a/src/paravirt.c
+++ b/src/paravirt.c
@@ -409,3 +409,22 @@
     data[filesize] = '\0';
     return data;
 }
+
+// Attempt to load an integer from the given file - return 'defval'
+// if unsuccesful.
+u64
+romfile_loadint(const char *name, u64 defval)
+{
+    u32 file = romfile_find(name);
+    if (!file)
+        return defval;
+
+    int filesize = romfile_size(file);
+    if (!filesize || filesize > sizeof(u64) || (filesize & (filesize-1)))
+        // Doesn't look like a valid integer.
+        return defval;
+
+    u64 val = 0;
+    romfile_copy(file, &val, sizeof(val));
+    return val;
+}
diff --git a/src/paravirt.h b/src/paravirt.h
index 7bf34b1..83166f4 100644
--- a/src/paravirt.h
+++ b/src/paravirt.h
@@ -101,6 +101,7 @@
     return qemu_cfg_name_file(fileid);
 }
 void *romfile_loadfile(const char *name, int *psize);
+u64 romfile_loadint(const char *name, u64 defval);
 
 u32 qemu_cfg_e820_entries(void);
 void* qemu_cfg_e820_load_next(void *addr);