Hong-Hua.Yin@freescale.com
2014-Jul-10 08:54 UTC
[libvirt-users] How to config qga to support dompmsuspend
Hi, I tried to run domsuspend command on my PowerPC board but failed. # virsh dompmsuspend sdk --target mem error: Domain sdk could not be suspended error: argument unsupported: QEMU guest agent is not configured It seemed that support suspend-to-mem only from capabilities. # virsh capabilities <capabilities> <host> <uuid>52498f7c-d584-45d8-8a15-345b14fa0d10</uuid> <cpu> <arch>ppc</arch> <topology sockets='1' cores='2' threads='1'/> <pages unit='KiB' size='4'/> <pages unit='KiB' size='1024'/> <pages unit='KiB' size='4096'/> <pages unit='KiB' size='16384'/> <pages unit='KiB' size='65536'/> <pages unit='KiB' size='262144'/> <pages unit='KiB' size='1048576'/> </cpu> <power_management> <suspend_mem/> </power_management> <migration_features> <live/> <uri_transports> <uri_transport>tcp</uri_transport> </uri_transports> </migration_features> <topology> <cells num='1'> <cell id='0'> <memory unit='KiB'>2066304</memory> <cpus num='2'> <cpu id='0' socket_id='0' core_id='0' siblings='0'/> <cpu id='1' socket_id='0' core_id='1' siblings='1'/> </cpus> </cell> </cells> </topology> <secmodel> <model>none</model> <doi>0</doi> </secmodel> <secmodel> <model>dac</model> <doi>0</doi> <baselabel type='kvm'>+0:+0</baselabel> <baselabel type='qemu'>+0:+0</baselabel> </secmodel> </host> <guest> <os_type>hvm</os_type> <arch name='ppc'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu-system-ppc</emulator> <machine maxCpus='1'>g3beige</machine> <machine maxCpus='32'>ppce500</machine> <machine maxCpus='1'>mac99</machine> <machine maxCpus='15'>mpc8544ds</machine> <machine maxCpus='1'>taihu</machine> <machine maxCpus='1'>ref405ep</machine> <machine maxCpus='1'>bamboo</machine> <machine maxCpus='1'>prep</machine> <machine maxCpus='1'>virtex-ml507</machine> <domain type='qemu'> </domain> <domain type='kvm'> <emulator>/usr/bin/qemu-system-ppc</emulator> </domain> </arch> <features> <deviceboot/> <disksnapshot default='on' toggle='no'/> </features> </guest> </capabilities> I read from some document about qemu guest agent but still don't know how to config it as daemon in guest domain. Best Regards, Olivia
Eric Blake
2014-Jul-10 13:16 UTC
Re: [libvirt-users] How to config qga to support dompmsuspend
On 07/10/2014 02:54 AM, Hong-Hua.Yin@freescale.com wrote:> Hi, > > I tried to run domsuspend command on my PowerPC board but failed. > # virsh dompmsuspend sdk --target mem > error: Domain sdk could not be suspended > error: argument unsupported: QEMU guest agent is not configured > > > It seemed that support suspend-to-mem only from capabilities.Whoops, you are mixing up who is getting suspended.> # virsh capabilities > <capabilities> > > <host>> <power_management> > <suspend_mem/> > </power_management>That says that 'virsh nodesuspend' will be able to suspend the HOST to memory, but nothing about what guests will support (and therefore, nothing about whether 'virsh dompmsuspend' will work).> I read from some document about qemu guest agent but still don't know how to config it as daemon in guest domain.Hooking up the qemu-guest-agent requires two parts. On the host, you must add a <channel> to your domain XML, per http://libvirt.org/formatdomain.html#elementCharChannel (modern virt-install and virt-manager do this for you when creating a new guest). Then, in the guest, you must install the agent as a service. On Fedora-based guests, this is as simple as installing the qemu-guest-agent package, which automatically sets itself up to run as a service if the virtual hardware is detected, and that will be the case if the channel designation was listed in the domain XML. On other Linux guests, you'll have to figure out if your distro of choice has made it as easy as Fedora-based guests. On Windows guests, there are steps to do it, but I don't personally have experience doing it myself, so you may have better luck searching the archives here or on the qemu mailing lists. For any other guest OS, you'd first have to port the qemu-guest-agent code to your guest OS. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Michal Privoznik
2014-Jul-10 13:24 UTC
Re: [libvirt-users] How to config qga to support dompmsuspend
On 10.07.2014 10:54, Hong-Hua.Yin@freescale.com wrote:> Hi, > > I tried to run domsuspend command on my PowerPC board but failed. > # virsh dompmsuspend sdk --target mem > error: Domain sdk could not be suspended > error: argument unsupported: QEMU guest agent is not configuredYou need to configure the guest agent: http://wiki.libvirt.org/page/Qemu_guest_agent> > > It seemed that support suspend-to-mem only from capabilities. > > # virsh capabilities > <capabilities> > > <host> > <uuid>52498f7c-d584-45d8-8a15-345b14fa0d10</uuid> > <cpu> > <arch>ppc</arch> > <topology sockets='1' cores='2' threads='1'/> > <pages unit='KiB' size='4'/> > <pages unit='KiB' size='1024'/> > <pages unit='KiB' size='4096'/> > <pages unit='KiB' size='16384'/> > <pages unit='KiB' size='65536'/> > <pages unit='KiB' size='262144'/> > <pages unit='KiB' size='1048576'/> > </cpu> > <power_management> > <suspend_mem/>This express the *host* PM capabilities (virsh nodesuspend) not the guest (virsh dompmsuspend). The guest ACPI capabilities can be found under domain XML: <domain type='kvm'> <name>gentoo</name> <uuid>a75aca4b-a02f-2bcb-4a91-c93cd848c34b</uuid> ... <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <pm> <suspend-to-mem enabled='yes'/> <suspend-to-disk enabled='yes'/> </pm> <devices/> </domain> These are purely on mgmt application (or users) decision. Can be enabled or disabled as you wish. Michal