From: Ian Campbell Subject: Re: [PATCH xm/xl enhancements for vptm 6/6] add vtpm support to libxl Date: Tue, 25 Sep 2012 11:49:20 +0100 Message-ID: <1348570160.3452.191.camel@zakaz.uk.xensource.com> References: <505CBEB4.8060105@jhuapl.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <505CBEB4.8060105@jhuapl.edu> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Matthew Fioravante Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Fri, 2012-09-21 at 20:23 +0100, Matthew Fioravante wrote: > Add support for vtpm=["VTPM_SPEC",...] to domain config files. Also add > commands vtpm-attach, vtpm-list, and vtpm-detach. > > Signed off by Matthew Fioravante matthew.fioravante@jhuapl.edu > > --- > Changes since previous: > * Rebased to latest xen > * Updated xl.cfg and xl manpages > > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 > --- a/docs/man/xl.cfg.pod.5 > +++ b/docs/man/xl.cfg.pod.5 > @@ -298,6 +298,35 @@ Specifies the networking provision (both emulated > network adapters, > and Xen virtual interfaces) to provided to the guest. See > F. > > +=item B > + > +Specifies the virtual trusted platform module to be can there be more than one? > +provided to the guest. Please see F > +for more details. > + > +Each B is a comma-separated list of C > +settings, from the following list: > + > +=over 4 > + > +=item C > + > +Specify the backend domain name of id. This value must be > +set if you are using the vtpm domain model. If this domain > +is a guest, the backend should be set to the vtpm domain name. > +If this domain is a vtpm, the backend should be set to the > +vtpm manager domain name. The default value is domain 0, > +which should be used if you are running the vtpm process model. I had a look in docs/misc/vtpm.txt but didn't see anything which explained "vtpm process model" vs "vtpm manager domain" vs "vtpm domain". I suppose that's part of the future doc work you were talking about ;-) > + > +=item C > + > +Specify the uuid of this vtpm device. The uuid is used to uniquely > +identify the vtpm device. You can create one using the uuidgen > +program on unix systems. If left unspecified, a new uuid > +will be randomly generated everytime the domain boots. ^missing space here > + > +=back > + > =item B > > Specifies the paravirtual framebuffer devices which should be supplied > [..] > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c [...] > +static void domcreate_attach_vtpms(libxl__egc *egc, libxl__multidev > *multidev, int ret) { > + libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, > multidev); > + STATE_AO_GC(dcs->ao); > + int domid = dcs->guest_domid; > + > + libxl_domain_config* const d_config = dcs->guest_config; > + > + if(ret) { > + LOG(ERROR, "unable to add nic devices"); > + goto error_out; > + } > + > + /* Plug nic interfaces */ You mean vtpms here. > +int main_vtpmdetach(int argc, char **argv) > +{ > + uint32_t domid; > + int opt, rc=0; > + libxl_device_vtpm vtpm; > + libxl_uuid uuid; > + > + if ((opt = def_getopt(argc, argv, "", "vtpm-detach", 2)) != -1) > + return opt; > + > + domid = find_domain(argv[optind]); > + > + if ( libxl_uuid_from_string(&uuid, argv[optind+1])) { Why does vtpm use/need UUID's for identification rather than just a domid+devid like other device types? Is the UUID used for something more than identification? Ian.