Hello Everyone, I am working on a grad school project for virtual introspection. I have a vm running (with 512mb of memory) and want to access the pmemsave function through virsh with the qemu-monitor-command. I am typing the following: virsh qemu-monitor-command --hmp Shawn 'pmemsave 0 536870912 image.dump' Shawn is the name of my vm and image.dump is the name of my output file. No matter what I do, I keep getting: Could not open 'image.dump' I have tried the above with sudo and with the absolute path of where the newly created dump file should go and I still get that error. Any help is appreciated as to how I should enter this command. If I type in virsh qemu-monitor-command --hmp Shawn 'info mem' or any other command without an output path, it works fine and brings up information about my running vm. Regards, Shawn -------------- next part -------------- An HTML attachment was scrubbed... URL: <listman.redhat.com/archives/libvirt-users/attachments/20120320/726effd8/attachment.htm>
On 20.03.2012 14:30, Shawn Davis wrote:> Hello Everyone, > > > > I am working on a grad school project for virtual introspection. I have > a vm running(with 512mb of memory) and want to access the pmemsave > function through virsh with the qemu-monitor-command. I am typing the > following: > > > > virsh qemu-monitor-command --hmp Shawn ?pmemsave 0 536870912 image.dump? > > > > Shawn is the name of my vm and image.dump is the name of my output > file. No matter what I do, I keep getting: Could not open ?image.dump? > > > > I have tried the above with sudo and with the absolute path of where the > newly created dump file should go and I still get that error. Any help > is appreciated as to how I should enter this command. > > > > If I type in virsh qemu-monitor-command --hmp Shawn ?info mem? or any > other command without an output path, it works fineand brings up > information about my running vm. > > > > Regards, > > ShawnI guess qemu can't access the path you are trying, esp. when you run it without root privileges. However, you can use virDomainMemoryPeek() instead. Michal
On 03/20/2012 07:30 AM, Shawn Davis wrote:> Hello Everyone, > > I am working on a grad school project for virtual introspection. I have a > vm running (with 512mb of memory) and want to access the pmemsave function > through virsh with the qemu-monitor-command.Why? I would just access it through the public API virDomainMemoryPeek instead, then you don't have to worry about the nuances. Alas, virDomainMemoryPeek has not yet been wired into virsh (patches welcome!), so you'll have to access it through a custom C program, or through one of the other language bindings such as python or perl.> virsh qemu-monitor-command --hmp Shawn 'pmemsave 0 536870912 image.dump' > > Shawn is the name of my vm and image.dump is the name of my output file. No > matter what I do, I keep getting: Could not open 'image.dump'That's because when you do raw pass-through like this, you are asking qemu to open the relative pathname 'image.dump', relative to the current working directory of qemu, which isn't necessarily the current working directory of your virsh process. Furthermore, if you are accessing a remote connection (such as -c qemu+ssh://remote/system), the file name is relative to the remote system, but you probably want the file to appear on the machine where you are running virsh. Finally, if SELinux is in effect, you have to ensure that qemu has proper permissions, including SELinux label, to open() the file; this is something that libvirt can do for you via the virDomainMemoryPeek API, but if you go through qemu-monitor-command, you are on your own. -- Eric Blake eblake at redhat.com +1-919-301-3266 Libvirt virtualization library libvirt.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 620 bytes Desc: OpenPGP digital signature URL: <listman.redhat.com/archives/libvirt-users/attachments/20120320/bef0a94c/attachment.sig>