From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nu1J6-0003kP-Lk for qemu-devel@nongnu.org; Tue, 23 Mar 2010 06:25:56 -0400 Received: from [199.232.76.173] (port=57011 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nu1J6-0003kG-6E for qemu-devel@nongnu.org; Tue, 23 Mar 2010 06:25:56 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nu1J4-0004vf-Df for qemu-devel@nongnu.org; Tue, 23 Mar 2010 06:25:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18709) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nu1J4-0004vb-00 for qemu-devel@nongnu.org; Tue, 23 Mar 2010 06:25:54 -0400 Message-ID: <4BA89725.8000601@redhat.com> Date: Tue, 23 Mar 2010 11:25:41 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [libvirt] Supporting hypervisor specific APIs in libvirt References: <4BA7C40C.2040505@codemonkey.ws> <20100322201003.GC28709@redhat.com> <4BA7E23A.2070502@redhat.com> <4BA7E6F0.5010501@codemonkey.ws> <4BA881D5.8000506@redhat.com> In-Reply-To: <4BA881D5.8000506@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes Sorensen Cc: "libvir-list@redhat.com" , qemu-devel On 03/23/10 09:54, Jes Sorensen wrote: > On 03/22/10 22:53, Anthony Liguori wrote: >> On 03/22/2010 04:33 PM, Gerd Hoffmann wrote: >>> libvirt is very unfriendly to qemu hackers. There is no easy way to >>> add command line switches. There is no easy way to get access to the >>> monitor. I can get it done by pointing to a wrapper script >>> and mangle the qemu command line there. But this sucks big time. And >>> it doesn't integrate with libvirt at all. >> >> It's not just developers. As we're doing deployments of qemu/kvm, we >> keep running into the same problem. We realize that we need to use a >> feature of qemu/kvm that isn't modelled by libvirt today. I've gone as >> far as to temporarily pausing libvirtd, finding the pty fd from >> /proc/, and hijacking the monitor session temporarily. > > One problem I have found, and I am not sure how to fix this in this > context. Sometimes when hacking on qemu, I want to try out a new > qemu binary on an existing image, without replacing the system wide > one and may want to pass new command line flags for testing those, plus > have access to the monitor. Works with the wrapper script trick mentioned above. virsh edit $domain grep for make it point to a wrapper script. My setup: [root@xenb ~]# virsh dumpxml fedora | grep emulator /root/bin/qemu-wrapper [root@xenb ~]# cat /root/bin/qemu-wrapper #!/bin/sh # distro qemu-kvm REAL_QEMU="/usr/bin/qemu-kvm" MORE_ARGS="-boot menu=on -cpu host -enable-nesting" # fresh build #REAL_QEMU="/home/kraxel/git/kvm/x86_64-softmmu/qemu-system-x86_64" #MORE_ARGS="-L /home/kraxel/git/kvm/pc-bios -boot menu=on" # go! case "$1" in "" | -h | -help | --help) # libvirt capability check exec $REAL_QEMU $1 ;; *) # run qemu with additional args exec $REAL_QEMU "$@" $MORE_ARGS ;; esac # should never ever arrive here echo "$0: exec $REAL_QEMU failed" >&2 exit 1 HTH, Gerd