mirror of
https://github.com/systemd/systemd.git
synced 2026-08-12 22:17:19 +00:00
vmspawn: Use qemu config file for smp and memory
Pass -no-user-config while we're at it to avoid loading qemu config from /etc which is more likely to cause hard to debug issues rather than do something useful.
This commit is contained in:
committed by
Daan De Meyer
parent
fd1b84af98
commit
73c0a79789
@@ -2308,6 +2308,16 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
|
||||
return r;
|
||||
}
|
||||
|
||||
r = qemu_config_section(config_file, "smp-opts", /* id= */ NULL,
|
||||
"cpus", arg_cpus ?: "1");
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = qemu_config_section(config_file, "memory", /* id= */ NULL,
|
||||
"size", mem);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = qemu_config_section(config_file, "object", "rng0",
|
||||
"qom-type", "rng-random",
|
||||
"filename", "/dev/urandom");
|
||||
@@ -2349,8 +2359,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
|
||||
|
||||
/* Start building the cmdline for items that must remain as command line arguments */
|
||||
cmdline = strv_new(qemu_binary,
|
||||
"-smp", arg_cpus ?: "1",
|
||||
"-m", mem);
|
||||
"-no-user-config");
|
||||
if (!cmdline)
|
||||
return log_oom();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user