Sorry about that... Looks like you found some code that didn't get
properly updated in the XenAccess to LibVMI conversion.
> the code will at least run for a while before complaining:
>
> xc: error: xc_map_foreign_batch: mmap failed (12 = Cannot allocate
> memory): Internal error
>
> How can I unmap so this doesn't happen?
Your code looks right. I think the problem is with the LibVMI
page-level caching. I looked into it today and found a bug where
pages were not being released properly (thus exhausting the resources
over time). If you want to fix it yourself without waiting for the
next release, try looking towards the bottom of
libvmi/driver/memory_cache.c. In memory_cache_insert, the key needs
to be created with malloc instead of a straight assignment. So it
will look something like this:
gint64 *key = malloc(sizeof(gint64));
*key = paddr;
Then you just need to change they &key to key when it is used in the
function calls below.
> I'm looking for code that efficiently looks through a VM's "physical"
> memory. Is this the best way of doing it?
Yep!
Cheers,
bryan
> I think the problem is with the LibVMI page-level caching.
OK. Make sense, since the updated function call doesn't allow me to munmap
the page manually, libvmi will presumably be doing so itself at some time in
the near future.
> If you want to fix it yourself without waiting for the next release
I made the changes you suggested. I still see the error messages while
running the modified dump-memory.c followed by a segfault at the end.
Will enable debugging and follow the logic through today.
If it makes any difference, the VM whose memory I'm trying to dump is a HVM
not PVM.
-- gyre --
Thanks,
bryan
> --
> You received this message because you are subscribed to the Google Groups
> "vmitools" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/vmitools/-/4T5WgEBX8mcJ.
>
> To post to this group, send email to vmit...@googlegroups.com.
> To unsubscribe from this group, send email to
> vmitools+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/vmitools?hl=en.