mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-09-05 21:21:54 +00:00
kvm tools: Fix 'kvm run' on 32-bit machines with >2 GB of RAM
This patch fixes the following nasty 'kvm run' startup problem that's caused by
'long' and 'u64' mixup in the code:
$ ./kvm run
Fatal: out of memory
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
committed by
Will Deacon
parent
aa400b0039
commit
06761c76a4
+1
-1
@@ -43,7 +43,7 @@ struct kvm {
|
||||
int nr_disks;
|
||||
};
|
||||
|
||||
struct kvm *kvm__init(const char *kvm_dev, unsigned long ram_size);
|
||||
struct kvm *kvm__init(const char *kvm_dev, u64 ram_size);
|
||||
int kvm__max_cpus(struct kvm *kvm);
|
||||
void kvm__init_ram(struct kvm *kvm);
|
||||
void kvm__delete(struct kvm *kvm);
|
||||
|
||||
@@ -324,8 +324,8 @@ static u64 host_ram_size(void)
|
||||
|
||||
static u64 get_ram_size(int nr_cpus)
|
||||
{
|
||||
long available;
|
||||
long ram_size;
|
||||
u64 available;
|
||||
u64 ram_size;
|
||||
|
||||
ram_size = 64 * (nr_cpus + 3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user