return log_redirect_file;
}
-
// drive image file
static const char *drive_image_file = NULL;
return "";
}
+// swap image file
+static const char *swap_image_file = NULL;
+
+const char *get_swap_image_file(void)
+{
+ if (swap_image_file) {
+ return swap_image_file;
+ }
+
+ // we should parse from "swap" parameter.
+ // so qemu_main() had to be called before.
+ BlockBackend *bb = blk_by_name("swap");
+ if (bb) {
+ BlockDriverState *bs = blk_bs(bb);
+ swap_image_file = g_strdup(bs->filename);
+
+ return swap_image_file;
+ }
+
+ // called before device initialized
+ // or very weired situation
+ LOG_WARNING("Can not identify swap image file !!!\n");
+
+ return "";
+}
// http proxy
static const char *http_proxy_addr = NULL;
g_free((void *)drive_image_file);
drive_image_file = NULL;
+ g_free((void *)swap_image_file);
+ swap_image_file = NULL;
+
g_free((void *)http_proxy_addr);
http_proxy_addr = NULL;
char const *get_log_redirect_file(void);
char const *get_kernel_log_redirect_file(void);
const char *get_drive_image_file(void);
+const char *get_swap_image_file(void);
const char *get_http_proxy_addr(void);
const char *get_vm_name(void);
const char *get_profile_name(void);