The following patch eliminates the uninitialized mem pointer, using
instead the corresponding entry from the slots array to fix :
libkvm.c:580: warning: 'mem' is used uninitialized in this function
Also changes the formatting type for phys_addr to long to prevent :
libkvm.c:581: warning: format '%llx' expects type 'long long unsigned int'
, but argument 5 has type 'long unsigned int'
Signed-off-by: Carlo Marcelo Arenas Belon <[EMAIL PROTECTED]>
---
libkvm/libkvm.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
index 93d7b6b..fc2e265 100644
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -567,7 +567,6 @@ void kvm_destroy_phys_mem(kvm_context_t kvm, unsigned long
phys_start,
unsigned long len)
{
int slot;
- struct kvm_memory_region *mem;
slot = get_slot(phys_start);
@@ -578,9 +577,9 @@ void kvm_destroy_phys_mem(kvm_context_t kvm, unsigned long
phys_start,
}
if (phys_start != slots[slot].phys_addr) {
fprintf(stderr,
- "WARNING: %s: phys_start is 0x%lx expecting 0x%llx\n",
- __FUNCTION__, phys_start, mem->guest_phys_addr);
- phys_start = mem->guest_phys_addr;
+ "WARNING: %s: phys_start is 0x%lx expecting 0x%lx\n",
+ __FUNCTION__, phys_start, slots[slot].phys_addr);
+ phys_start = slots[slot].phys_addr;
}
kvm_create_phys_mem(kvm, phys_start, 0, 0, 0);
}
--
1.5.2.5
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel