From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpdsC-0001gw-An for qemu-devel@nongnu.org; Fri, 23 Oct 2015 11:03:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zpds7-0007gn-7q for qemu-devel@nongnu.org; Fri, 23 Oct 2015 11:03:16 -0400 Received: from smtp.aimale.com ([166.78.138.199]:51165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpds6-0007gi-Vr for qemu-devel@nongnu.org; Fri, 23 Oct 2015 11:03:11 -0400 References: <1444952643-5033-1-git-send-email-valerio@aimale.com> <87h9lrkz56.fsf@blackfin.pond.sub.org> <56210A17.6080401@aimale.com> <87io63xpke.fsf@blackfin.pond.sub.org> <56250035.40805@aimale.com> <87twpkqyow.fsf@blackfin.pond.sub.org> <20151022191203.GC3736@thinpad.lan.raisama.net> <877fmeqeho.fsf@blackfin.pond.sub.org> <562A47CE.9090801@aimale.com> <562A4AA8.7020002@redhat.com> From: Valerio Aimale Message-ID: <562A4C2A.30107@aimale.com> Date: Fri, 23 Oct 2015 09:03:06 -0600 MIME-Version: 1.0 In-Reply-To: <562A4AA8.7020002@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] QEMU patch to allow VM introspection via libvmi List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Markus Armbruster , Eduardo Habkost Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com On 10/23/15 8:56 AM, Eric Blake wrote: > On 10/23/2015 08:44 AM, Valerio Aimale wrote: > >> Libvmi dependence on virsh is so strict, that libvmi does not even know >> if the QEMU VM has an open qmp unix socket or inet socket, to send >> commands through. Thus, libvmi sends qmp commands (to query registers, >> as an example) via >> >> virsh qemu-monitor-command Windows10B '{"execute": >> "human-monitor-command", "arguments": {"command-line": "info registers"}}' > This is an unsupported back door of libvirt; you should really also > consider enhancing libvirt to add a formal API to expose this > information so that you don't have to resort to the monitor back door. > But that's a topic for the libvirt list. > >> so that libvmi can find the rendezvous unix/inet address and sends >> commands through that. As of now, each qmp commands requires a popen() >> that forks virsh, which compounds to the slowness. > No, don't blame virsh for your slowness. Write your own C program that > links against libvirt.so, and which holds and reuses a persistent > connection, using the same libvirt APIs as would be used by virsh. All > the overhead of spawning a shell to spawn virsh to open a fresh > connection for each command will go away. Any solution that uses > popen() to virsh is _screaming_ to be rewritten to use libvirt.so natively. > Eric, good points. Libvmi was written quite some time ago; that libvirt api might not even have been there. When we agree on an access method to the guest mem, I will rewrite those legacy parts. I'm not the author of libvmi. I'm just trying to make it better, when accessing QEMU/KVM VMs