fix QEMU bug that does not odd numbers for memory

This commit is contained in:
ghe0 2025-01-27 02:56:14 +02:00
parent 56f88aad3f
commit f74d2887fb
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4

@ -811,9 +811,9 @@ impl VM {
vars += "\n";
vars += &format!(r#"export VCPUS="{}""#, self.vcpus);
vars += "\n";
vars += &format!(r#"export MEMORY="{}M""#, self.memory_mb);
vars += &format!(r#"export MEMORY="{}M""#, (self.memory_mb / 2 * 2));
vars += "\n";
vars += &format!(r#"export MAX_MEMORY="{}M""#, self.memory_mb + 256);
vars += &format!(r#"export MAX_MEMORY="{}M""#, (self.memory_mb / 2 * 2) + 256);
vars += "\n";
vars += &format!(r#"export DISK="{}""#, self.disk_path());
vars += "\n";