Jeff Bickford
2009-Sep-10 20:55 UTC
[Xen-devel] 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 Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Brendan Cully
2009-Sep-10 21:02 UTC
Re: [Xen-devel] Question about direct memory access of domU from dom0
On Thursday, 10 September 2009 at 16:55, Jeff Bickford wrote:> 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. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Sep-10 21:06 UTC
Re: [Xen-devel] Question about direct memory access of domU from dom0
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 On 10/09/2009 21:55, "Jeff Bickford" <tassadar27@gmail.com> wrote:> 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 Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel