Bug 728806

Summary: Memsave,pmemsave command not usable from virsh with qemu-monitor-command
Product: [Community] Virtualization Tools Reporter: flying
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-23 13:09:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description flying 2011-08-07 19:48:17 UTC
Description of problem:

I cannot use the command virsh qemu-monitor-command --hmp WindowsXP_SP3 'pmemsave 0 444444 memorydump.img' 

The error occurs with pmemsave as well as with memsave.

The error message given is: Could not open 'memorydump.img'


Version-Release number of selected component (if applicable):
0.8.8


Steps to Reproduce:
1. Stop Virtual machine
2. virsh qemu-monitor-command --hmp WindowsXP_SP3 'pmemsave 0 444444 memorydump.img' 

  
Actual results:
Could not open 'memorydump.img'

Expected results:

Successful dump of the Virtual Memory to the given filename.


Additional info:

Tried to dump the memory off a Windows XP Machine with SP3.
I tried to use the commands directly from the Qemu-Monitor command but that worked fine as expected.

Comment 1 flying 2011-08-07 19:52:59 UTC
The hypervisor is used was kvm

Comment 2 Daniel Berrangé 2011-08-08 09:28:40 UTC
When run via libvirt, QEMU is run as user qemu:qemu and under a restricted SELinux/AppArmour security context. Any monitor command that involves QEMU creating files on disk is thus likely to be blocked.

libvirt does already support these monitor commands via the virDomainMemoryPeek API, but for some reason they are not wired up into virsh.

Comment 3 Cole Robinson 2016-03-23 13:09:45 UTC
yeah I think in this case the answer is to point it at /tmp, and disable selinux