On Thu, Sep 01, 2011 at 09:01:32PM -0400, Stefan Berger wrote: > >>Monitor support for 'info tpm' has been added. It for example prints the > >>following: > >> > >>TPM devices: > >> builtin: model=tpm-tis,id=tpm0 > >This mixes frontend and backend properties. > > > There's currently only one frontend 'model' and that's the > 'tpm-tis'. In case someone would want to write a virtio equivalent > it would show the that the 'builtin' backend is connected to the > 'virtio' frontend model. If above is not correct, how should it look > like?
E.g. for net: we list backends and frontends each with its properties. virtio-net-pci.0: type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56 \ foo: type=tap,ifname=msttap0,script=/home/mst/ifup,downscript=no > >>+ > >>+ value = qemu_opt_get(opts, "type"); > >>+ if (!value) { > >>+ qerror_report(QERR_MISSING_PARAMETER, "type"); > >>+ tpm_display_backend_drivers(stderr); > >>+ return 1; > >>+ } > >>+ > >>+ be = tpm_get_backend_driver(value); > >>+ if (be == NULL) { > >>+ qerror_report(QERR_INVALID_PARAMETER_VALUE, "type", > >>+ "a tpm backend type"); > >>+ tpm_display_backend_drivers(stderr); > >>+ return 1; > >>+ } > >>+ > >>+ assert((is_tpmdev&& model == NULL) || (!is_tpmdev&& model != NULL)); > >Why isn't this using qdev for parameter passing? > > > Can you point me to a device that is using qdev for parameter > passing. virtio-pci devices: block, net - have a huge number of these. I'm talking about frontend primarily. > Also this part is very similar to how the networking works > (net.c). > > Stefan A large part of that is legacy processing. -- MST