From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpdlv-0007df-Bq for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:56:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zpdlq-0005BO-D2 for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:56:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpdlq-0005BK-6S for qemu-devel@nongnu.org; Fri, 23 Oct 2015 10:56:42 -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> From: Eric Blake Message-ID: <562A4AA8.7020002@redhat.com> Date: Fri, 23 Oct 2015 08:56:40 -0600 MIME-Version: 1.0 In-Reply-To: <562A47CE.9090801@aimale.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cHmNVsWmEviOeSWJfjqP8sDohVrH1UJBK" 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: Valerio Aimale , Markus Armbruster , Eduardo Habkost Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cHmNVsWmEviOeSWJfjqP8sDohVrH1UJBK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/23/2015 08:44 AM, Valerio Aimale wrote: >=20 > 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 >=20 > 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. >=20 > 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 nativel= y. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cHmNVsWmEviOeSWJfjqP8sDohVrH1UJBK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWKkqoAAoJEKeha0olJ0NqKF4H/3mrNHm3WoRjDPhRZFnAer+M swaj4TK4R8GU3SyDGGXdxxeIUyTC26d3w+aOSd2t6S54HbuWwfuG5IhPlxsd4UNJ G9MhS6W82/E56vGs4e1MZVDCMuV9N6Hbqhrxag9tn6czYn21Mih9N8m/j5IAVyhy VTKIfO5SL7YCGaZtMCfRfQBGze6WpXvZW6bARrzM69/zeAVhYQpMK/q3MSQj4zTr A1u6HWjVJSyPS1RKQUxD4PP4jNMDNriRg4dx9bgLMl0E1n1bQR1zlrfbQf+Ye2w2 0tbFlD1Qp8B2h2+ilaNZ6nnccyNX+DUzY9QNy7VC+jYtTEd1QOXbuZj+aWK+NOg= =hTpL -----END PGP SIGNATURE----- --cHmNVsWmEviOeSWJfjqP8sDohVrH1UJBK--