mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu_conf: Add param memory_backing_dir
Add new parameter memory_backing_dir where files will be stored when memoryBacking source is selected as file. Value is stored inside char* memoryBackingDir
This commit is contained in:
parent
7c0c5f6d4b
commit
48d9e6cdcc
@ -109,6 +109,8 @@ module Libvirtd_qemu =
|
||||
|
||||
let gluster_debug_level_entry = int_entry "gluster_debug_level"
|
||||
|
||||
let memory_entry = str_entry "memory_backing_dir"
|
||||
|
||||
(* Each entry in the config is one of the following ... *)
|
||||
let entry = default_tls_entry
|
||||
| vnc_entry
|
||||
@ -125,6 +127,7 @@ module Libvirtd_qemu =
|
||||
| log_entry
|
||||
| nvram_entry
|
||||
| gluster_debug_level_entry
|
||||
| memory_entry
|
||||
|
||||
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
|
||||
let empty = [ label "#empty" . eol ]
|
||||
|
@ -673,3 +673,7 @@
|
||||
# devices entries throughout the domain lifetime. This namespace is turned on
|
||||
# by default.
|
||||
#namespaces = [ "mount" ]
|
||||
|
||||
# This directory is used for memoryBacking source if configured as file.
|
||||
# NOTE: big files will be stored here
|
||||
#memory_backing_dir = "/var/lib/libvirt/qemu/ram"
|
||||
|
@ -186,6 +186,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
|
||||
goto error;
|
||||
if (virAsprintf(&cfg->nvramDir, "%s/nvram", cfg->libDir) < 0)
|
||||
goto error;
|
||||
if (virAsprintf(&cfg->memoryBackingDir, "%s/ram", cfg->libDir) < 0)
|
||||
goto error;
|
||||
} else {
|
||||
char *rundir;
|
||||
char *cachedir;
|
||||
@ -231,6 +233,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
|
||||
if (virAsprintf(&cfg->nvramDir,
|
||||
"%s/qemu/nvram", cfg->configBaseDir) < 0)
|
||||
goto error;
|
||||
if (virAsprintf(&cfg->memoryBackingDir, "%s/qemu/ram", cfg->configBaseDir) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (virAsprintf(&cfg->configDir, "%s/qemu", cfg->configBaseDir) < 0)
|
||||
@ -408,6 +412,8 @@ static void virQEMUDriverConfigDispose(void *obj)
|
||||
VIR_FREE(cfg->lockManagerName);
|
||||
|
||||
virFirmwareFreeList(cfg->firmwares, cfg->nfirmwares);
|
||||
|
||||
VIR_FREE(cfg->memoryBackingDir);
|
||||
}
|
||||
|
||||
|
||||
@ -835,6 +841,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
|
||||
}
|
||||
}
|
||||
|
||||
if (virConfGetValueString(conf, "memory_backing_dir", &cfg->memoryBackingDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
|
@ -195,6 +195,8 @@ struct _virQEMUDriverConfig {
|
||||
virFirmwarePtr *firmwares;
|
||||
size_t nfirmwares;
|
||||
unsigned int glusterDebugLevel;
|
||||
|
||||
char *memoryBackingDir;
|
||||
};
|
||||
|
||||
/* Main driver state */
|
||||
|
@ -94,3 +94,4 @@ module Test_libvirtd_qemu =
|
||||
{ "namespaces"
|
||||
{ "1" = "mount" }
|
||||
}
|
||||
{ "memory_backing_dir" = "/var/lib/libvirt/qemu/ram" }
|
||||
|
Loading…
Reference in New Issue
Block a user