Question about direct memory access of domU from dom0
Hello,
I am porting a C application that requires taking a snapshot of memory on the computer you are running. The original program uses an external PCI card to read the memory and now I am trying to port this to xen. I want to run the program in the dom0 guest but the memory that it will be taking a snapshot of is the of memory in the domU guest. I am using the xen hypervisor 3.3. Is there any specific library or API I can use in C to do this? The xen api on xensource seems to only talk about xensource never about the hypervisor alone. Thank you.
Jeff
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 10 lines · Jeff Bickford
Hello,
I am porting a C application that requires taking a snapshot of memory on the computer you are running. The original program uses an external PCI card to read the memory and now I am trying to port this to xen. I want to run the program in the dom0 guest but the memory that it will be taking a snapshot of is the of memory in the domU guest. I am using the xen hypervisor 3.3. Is there any specific library or API I can use in C to do this? The xen api on xensource seems to only talk about xensource never about the hypervisor alone. Thank you.
Have a look at tools/libxc/xc_domain_save.c. That's the heart of xm save/xm migrate. Basically it's:
1. pause the domU
2. map its memory
3. copy it out
4. unpause
You may need to map in batches if the guest memory is too large to fit in your copying process's address space.
The shell command 'xm save <domain>' will save the memory image of a domain, and more besides. If you're interested in snapshotting just a domain's memory, while the domain continues to run, then some variant of tools/libxc/xc_domain_save.c:xc_domain_save() is what you want.
-- Keir
Quoted 13 lines · Jeff Bickford
Hello,
I am porting a C application that requires taking a snapshot of memory on the computer you are running. The original program uses an external PCI card to read the memory and now I am trying to port this to xen. I want to run the program in the dom0 guest but the memory that it will be taking a snapshot of is the of memory in the domU guest. I am using the xen hypervisor 3.3. Is there any specific library or API I can use in C to do this? The xen api on xensource seems to only talk about xensource never about the hypervisor alone. Thank you.
Jeff