From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwaOW-0007d3-1B for qemu-devel@nongnu.org; Sat, 19 Jan 2013 10:31:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwaOU-00062c-Km for qemu-devel@nongnu.org; Sat, 19 Jan 2013 10:31:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwaOU-00062Y-CY for qemu-devel@nongnu.org; Sat, 19 Jan 2013 10:31:42 -0500 Message-ID: <50FABC50.6090507@redhat.com> Date: Sat, 19 Jan 2013 08:31:28 -0700 From: Eric Blake MIME-Version: 1.0 References: <1358524968-22297-1-git-send-email-stefanb@linux.vnet.ibm.com> <1358524968-22297-9-git-send-email-stefanb@linux.vnet.ibm.com> <50F991FE.3000901@redhat.com> <50F9E580.2000602@linux.vnet.ibm.com> <50F9EEED.5020702@linux.vnet.ibm.com> In-Reply-To: <50F9EEED.5020702@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2OLODUKVASVEFUNFUOGIN" Subject: Re: [Qemu-devel] [PATCH V20 8/8] Add fd parameter for TPM passthrough driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Berger Cc: mst@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, andreas.niederl@iaik.tugraz.at This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OLODUKVASVEFUNFUOGIN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/18/2013 05:55 PM, Stefan Berger wrote: > On 01/18/2013 07:14 PM, Stefan Berger wrote: >> On 01/18/2013 01:18 PM, Eric Blake wrote: >>> On 01/18/2013 09:02 AM, Stefan Berger wrote: >> When libvirt forks, the child process inherits the file descriptors, >> among them those of the taps and /dev/tpm0. The subsequent execve >> keeps the file descriptor open. QEMU then reads the TPM file >> descriptor from the command line into above TPMInfo->fd. This also >> works with 'exec 100<>/dev/tpm0' via command line. >> Similar to the SELinux labeling of all the other file descriptors I >> also use the one for the TPM device for SELinux labeling. >> > I have to correct this: The libvirt patches for this use path=3D on the= > command line and also apply the SELinux label on the path rather than > the fd. So, this patch then adds file descriptor passing support to hav= e > equivalent functionality to other devices. You _still_ don't need extra handling for fd passing; neither on the command line, nor in QMP. Remember, we added --add-fd to the command line, precisely so we could use: qemu -add-fd set=3D1,fd=3D100 -tpmdev passthrough,path=3D/dev/fdset/1 \ 100<>/dev/tpm0 See - by making fd passing universally accessible under pathname processing, we've made it easier to add new commands that don't have to special-case fd handling. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2OLODUKVASVEFUNFUOGIN 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.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ+rxQAAoJEKeha0olJ0NqQOkH/1Wl02BaJCvcPRulryftCQSu c2Lk1pWzYa1m7MNurLBwJ8Jv1RzZEgxrUKnsp4FUeUqYwW/UfRzV8K9DZAvFeIes ceVm/KPdZDevcq91KmXTlqs+Tmq4m/fByqusz1r5hW0NBy/D38tVx3H7e8JZl09S GvRgQsQ7d89N3oWUA141TCyha1G8l461t3lrX5x3MS40E0pqx/okXDEH3MgS5OiS S75LeTwkyHLko1VnILTruE+OuQNKdHp+vFAfGDqJGLdIgtesGQwRIJZM63OR2EU1 QqNaoxJMg4jptSF7P8p9k1mh6/NwGWpKhkMDAJVcRXn8pCGxANWbvMfe7gQnTgU= =40RD -----END PGP SIGNATURE----- ------enig2OLODUKVASVEFUNFUOGIN--