From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUUw-0007CN-7h for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:25:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGUUr-0001es-7C for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:25:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35619) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUUq-0001ec-Sc for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:25:37 -0500 Message-ID: <54C8FF6A.9000702@redhat.com> Date: Wed, 28 Jan 2015 08:25:30 -0700 From: Eric Blake MIME-Version: 1.0 References: <20150128150723.GB1762@HEDWIG.INI.CMU.EDU> In-Reply-To: <20150128150723.GB1762@HEDWIG.INI.CMU.EDU> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="D0JgIiG6Tp2w8JrkicJAdrG00tPXlEVh1" Subject: Re: [Qemu-devel] guest agent vs. host->guest "environment variables" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --D0JgIiG6Tp2w8JrkicJAdrG00tPXlEVh1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/28/2015 08:07 AM, Gabriel L. Somlo wrote: > Hi, >=20 > I'm looking for an equivalent to VMWare "guestinfo" variables > (the stuff one may set on a VM via e.g. the vSphere client, under > Summary->Annotations->Notes, and looks like a bunch of "name =3D value"= > environment variable definitions. These can then be retrieved from > the guest via 'vmtoolsd --cmd "info-get guestinfo.name"', which would > print the string "value" to stdout. >=20 > After some initial digging, it appears that the QEMU guest agent is > the closest thing to "vmtoolsd" right now, but it doesn't look like > it supports the functionality I'm interested in. >=20 > My question is, am I missing anything obvious? Is there anything in > the kvm/qemu/libvirt universe that currently offers this type of > functionality? If not, would it be of any interest? I'm willing (and > hopefully able) to send patches, if it comes to that :) The existing qga allows you to write arbitrary contents from the host into an arbitrary file on the guest; you could use the contents of that file to be your name/value store or anything else. As for whether it makes sense to make it easier for the guests to access queries from such a file, I guess we could patch the qga package to provide such a helper app for use in the guest. Or if you want to add an entirely new guest-agent command that makes such contents easier for the host to pass than what you get by writing a raw file, you could try that as well. There are several example threads in the list archives of proposals to add new qga commands. >=20 > Also, while extracting this type of "environment variable" on the > guest seems perfectly suited to something like qga, it also appears > that injecting them on the host side might involve cooperation from > a higher layer, such as libvirt. Yes, if you have a new qga command and/or new app bundled with qga used for querying a specific format of a specific file written by existing qga commands, then it would be reasonable to patch libvirt to make it easier to expose that functionality to the end user. But even without formal libvirt support, you can use the backdoor of 'virsh qemu-agent-command' to pass arbitrary qga commands through to the guest. >=20 > Any pointers, ideas and tips much appreciated (even just "directions" > to a more appropriate mailing list)... >=20 > Thanks much, > --Gabriel >=20 >=20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --D0JgIiG6Tp2w8JrkicJAdrG00tPXlEVh1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJUyP9qAAoJEKeha0olJ0NqxP8H+wdxQ72Wc4Vmp4TUhF1ohC2R Cg36UGx2gCHF3vOsXDD5VrbiiwaoJxw0qASEnAlgweibmDEhHiRU8uy3tFsSLotR k5zgsNBelAu+Ysfa/vo8btreCnIk3IkEK4vJ0H1lxB6QXI4QCobZspn9lli0MIJI 6ETCR5cQjQFJI8w+fv0yHR92IpPzmQDZpZdpKg3d6cX/FN3Q+fHsj5p6mGwLgoSs 6jfDzyvPwi/48HMKkPpAAesIPk+SvIMjLiEq3Ho4FBnKDz5Qo8nx2yoyV5riUeWJ urgmgApYNvgFmI71DzVpL9rdN24A6LZt5BAgCRPacUrCspPrSGhOTGobeljjE5U= =EAo/ -----END PGP SIGNATURE----- --D0JgIiG6Tp2w8JrkicJAdrG00tPXlEVh1--