All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen
@ 2007-01-30 14:29 Stefan Berger
  2007-01-30 15:12 ` Ewan Mellor
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Berger @ 2007-01-30 14:29 UTC (permalink / raw)
  To: xen-devel; +Cc: ewan

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

This patch aligns vTPM support in the Xen-API, documentation and lib-xen
(after the recent changes).

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>



[-- Attachment #2: xenapi_vtpm_upd.diff --]
[-- Type: text/x-patch, Size: 13283 bytes --]

Index: root/xen-unstable.hg/tools/python/xen/xend/XendAPI.py
===================================================================
--- root.orig/xen-unstable.hg/tools/python/xen/xend/XendAPI.py
+++ root/xen-unstable.hg/tools/python/xen/xend/XendAPI.py
@@ -1675,8 +1675,7 @@ class XendAPI(object):
 
     VTPM_attr_rw = [ ]
     VTPM_attr_ro = ['VM',
-                    'backend',
-                    'instance']
+                    'backend']
 
     VTPM_attr_inst = VTPM_attr_rw
 
@@ -1693,27 +1692,14 @@ class XendAPI(object):
             return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
         valid_vtpm_keys = self.VTPM_attr_ro + self.VTPM_attr_rw + \
                           self.Base_attr_ro + self.Base_attr_rw
+        return_cfg = {}
         for k in cfg.keys():
-            if k not in valid_vtpm_keys:
-                del cfg[k]
+            if k in valid_vtpm_keys:
+                return_cfg[k] = cfg[k]
 
-        return xen_api_success(cfg)
+        return xen_api_success(return_cfg)
 
     # Class Functions
-    def VTPM_get_instance(self, session, vtpm_ref):
-        xendom = XendDomain.instance()
-        vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        if not vm:
-            return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
-        cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
-        if not cfg:
-            return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
-        if cfg.has_key('instance'):
-            instance = cfg['instance']
-        else:
-            instance = -1
-        return xen_api_success(instance)
-
     def VTPM_get_backend(self, session, vtpm_ref):
         xendom = XendDomain.instance()
         vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
@@ -1722,11 +1708,9 @@ class XendAPI(object):
         cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
         if not cfg:
             return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
-        if cfg.has_key('backend'):
-            backend = cfg['backend']
-        else:
-            backend = "Domain-0"
-        return xen_api_success(backend)
+        if not cfg.has_key('backend'):
+            return xen_api_error(['VTPM backend not set'])
+        return xen_api_success(cfg['backend'])
 
     def VTPM_get_VM(self, session, vtpm_ref):
         xendom = XendDomain.instance()
@@ -1735,12 +1719,18 @@ class XendAPI(object):
 
     def VTPM_destroy(self, session, vtpm_ref):
         xendom = XendDomain.instance()
-        vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
-        if not vm:
-            return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
-
-        vm.destroy_vtpm(vtpm_ref)
-        return xen_api_success_void()    
+        dom = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
+        if dom:
+            if dom.state != XEN_API_VM_POWER_STATE_HALTED:
+                vm_ref = dom.get_dev_property('vtpm', vtpm_ref, 'VM')
+                return xen_api_error(['VM_BAD_POWER_STATE', vm_ref,
+                 XendDomain.POWER_STATE_NAMES[XEN_API_VM_POWER_STATE_HALTED],
+                 XendDomain.POWER_STATE_NAMES[dom.state]])
+            from xen.xend.server import tpmif
+            tpmif.destroy_vtpmstate(dom.getName())
+            return xen_api_success(True)
+        else:
+            return xen_api_error(['VM_HANDLE_INVALID', vtpm_struct['VM']])
 
     # class methods
     def VTPM_create(self, session, vtpm_struct):
Index: root/xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- root.orig/xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
+++ root/xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
@@ -2125,7 +2125,10 @@ class XendDomainInfo:
                 config['mode'] = 'RW'
 
         if dev_class == 'vtpm':
-            config['driver'] = 'paravirtualised' # TODO
+            if not config.has_type('type'):
+                config['type'] = 'paravirtualised' # TODO
+            if not config.has_key('backend'):
+                config['backend'] = "00000000-0000-0000-0000-000000000000"
 
         return config
 
Index: root/xen-unstable.hg/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
===================================================================
--- root.orig/xen-unstable.hg/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
+++ root/xen-unstable.hg/tools/xm-test/tests/vtpm/09_vtpm-xapi.py
@@ -4,14 +4,22 @@
 # Author: Stefan Berger <stefanb@us.ibm.com>
 
 # Test to test the vtpm class through the Xen-API
+#
+# Tested methods:
+#  VTPM: get_uuid, get_backend, get_by_uuid, get_record
+#        create, destroy, get_VM
+#  VM: get_VTPMS
 
 from XmTestLib import xapi
 from XmTestLib.XenAPIDomain import XmTestAPIDomain
 from XmTestLib import *
+from xen.xend import XendDomain
 from vtpm_utils import *
 import commands
 import os
 
+VTPM_RECORD_KEYS = [ 'backend', 'VM', 'uuid' ]
+
 try:
     # XmTestAPIDomain tries to establish a connection to XenD
     domain = XmTestAPIDomain()
@@ -20,52 +28,131 @@ except Exception, e:
 vm_uuid = domain.get_uuid()
 
 vtpmcfg = {}
-vtpmcfg['type'] = "paravirtualised"
-vtpmcfg['backend'] = "Domain-0"
-vtpmcfg['instance'] = 1
+vtpmcfg['backend'] = XendDomain.DOM0_UUID
 vtpmcfg['VM'] = vm_uuid
 
 session = xapi.connect()
 
 vtpm_uuid = session.xenapi.VTPM.create(vtpmcfg)
 
-vtpm_id = session.xenapi.VTPM.get_instance(vtpm_uuid)
 vtpm_be = session.xenapi.VTPM.get_backend(vtpm_uuid)
 if vtpm_be != vtpmcfg['backend']:
     FAIL("vTPM's backend is in '%s', expected: '%s'" %
          (vtpm_be, vtpmcfg['backend']))
 
-driver = session.xenapi.VTPM.get_driver(vtpm_uuid)
-if driver != vtpmcfg['type']:
-    FAIL("vTPM has driver type '%s', expected: '%s'" %
-         (driver, vtpmcfg['type']))
-
 vtpm_rec = session.xenapi.VTPM.get_record(vtpm_uuid)
 
-if vtpm_rec['driver']  != vtpmcfg['type']:
-    FAIL("vTPM record shows driver type '%s', expected: '%s'" %
-         (vtpm_rec['driver'], vtpmcfg['type']))
+miss_keys = []
+for k in VTPM_RECORD_KEYS:
+    if k not in vtpm_rec.keys():
+        miss_keys.append(k)
+if len(miss_keys) > 0:
+    FAIL("vTPM record is missing key(s): %s" % miss_keys)
+
 if vtpm_rec['uuid']  != vtpm_uuid:
     FAIL("vTPM record shows vtpm uuid '%s', expected: '%s'" %
          (vtpm_rec['uuid'], vtpm_uuid))
 if vtpm_rec['VM']  != vm_uuid:
     FAIL("vTPM record shows VM uuid '%s', expected: '%s'" %
          (vtpm_rec['VM'], vm_uuid))
+if vtpm_rec['backend'] != vtpmcfg['backend']:
+    FAIL("vTPM record shows VM bakcned '%s', expected: '%s'" %
+         (vtpm_rev['backend'], vtpmcfg['backend']))
+
+badkeys = []
+keys = vtpm_rec.keys()
+for k in keys:
+    if k not in VTPM_RECORD_KEYS:
+        badkeys.append(k)
+if len(badkeys) > 0:
+    FAIL("Unexpected attributes in result: %s" % badkeys)
+
+if vm_uuid != session.xenapi.VTPM.get_VM(vtpm_uuid):
+    FAIL("VM uuid from VTPM.get_VM different (%s) than expected (%s)." %
+         (vm_ref, vm_uuid))
+
+uuid = session.xenapi.VTPM.get_uuid(vtpm_uuid)
+if uuid != vtpm_uuid:
+    FAIL("vTPM from VTPM.get_uuid different (%s) than expected (%s)." %
+         (uuid, vtpm_uuid))
+
+vtpm_ref = session.xenapi.VTPM.get_by_uuid(vtpm_uuid)
+if vtpm_ref != vtpm_uuid:
+    FAIL("vTPM from VTPM.get_by_uuid different (%s) than expected (%s)." %
+         (vtpm_ref, vtpm_uuid))
+
+vm_vtpms = session.xenapi.VM.get_VTPMs(vm_uuid)
+if len(vm_vtpms) != 1:
+    FAIL("Number of vTPMs from get_VTPMs is (%d) not what was expected (%d)" %
+         (len(vm_vtpms), 1))
+if vtpm_uuid not in vm_vtpms:
+    FAIL("Other vTPM uuid (%s) returned from VM.get_VTPMs than expected (%s)" %
+         (vm_vtpms[0], vtpm_uuid))
 
-success = domain.start()
+try:
+    console = domain.start()
+except DomainError, e:
+    FAIL("Unable to create domain (%s)" % domName)
 
-console = domain.getConsole()
+try:
+    console.sendInput("input")
+except ConsoleError, e:
+    saveLog(console.getHistory())
+    FAIL(str(e))
 
 try:
     run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
 except ConsoleError, e:
     saveLog(console.getHistory())
-    vtpm_cleanup(domName)
-    FAIL("No result from dumping the PCRs")
+    FAIL("1. No result from dumping the PCRs")
 
 if re.search("No such file",run["output"]):
-    vtpm_cleanup(domName)
     FAIL("TPM frontend support not compiled into (domU?) kernel")
 
+if not re.search("PCR-00:",run["output"]):
+    saveLog(console.getHistory())
+    FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
+
+try:
+    rc = session.xenapi.VTPM.destroy(vtpm_uuid)
+    #Should never get here
+    FAIL("Could destroy vTPM while VM is running")
+except:
+    pass
+
+rc = session.xenapi.VM.suspend(vm_uuid)
+if rc:
+    FAIL("Could not suspend VM")
+
+try:
+    rc = session.xenapi.VTPM.destroy(vtpm_uuid)
+    #May not throw an exception in 'suspend' state
+except:
+    pass
+
+rc = session.xenapi.VM.resume(vm_uuid, False)
+if rc:
+    FAIL("Could not resume VM")
+
+try:
+    console = domain.getConsole()
+except ConsoleError, e:
+    FAIL(str(e))
+
+try:
+    run = console.runCmd("cat /sys/devices/xen/vtpm-0/pcrs")
+except ConsoleError, e:
+    saveLog(console.getHistory())
+    FAIL("2. No result from dumping the PCRs. vTPM has been removed?")
+
+if not re.search("PCR-00:",run["output"]):
+    saveLog(console.getHistory())
+    FAIL("2. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"])
+
 domain.stop()
+
+rc = session.xenapi.VTPM.destroy(vtpm_uuid)
+if not rc:
+    FAIL("Could NOT destroy vTPM while domain is halted.")
+
 domain.destroy()
Index: root/xen-unstable.hg/tools/python/scripts/xapi.py
===================================================================
--- root.orig/xen-unstable.hg/tools/python/scripts/xapi.py
+++ root/xen-unstable.hg/tools/python/scripts/xapi.py
@@ -678,14 +678,6 @@ def xapi_vtpm_create(args, async = False
     print "Creating vTPM with cfg = %s" % cfg
     vtpm_uuid = execute(server, 'VTPM.create', (session, cfg))
     print "Done. (%s)" % vtpm_uuid
-    vtpm_id = execute(server, 'VTPM.get_instance', (session, vtpm_uuid))
-    print "Has instance number '%s'" % vtpm_id
-    vtpm_be = execute(server, 'VTPM.get_backend', (session, vtpm_uuid))
-    print "Has backend in '%s'" % vtpm_be
-    driver = execute(server, 'VTPM.get_driver', (session, vtpm_uuid))
-    print "Has driver type '%s'" % driver
-    vtpm_rec = execute(server, 'VTPM.get_record', (session, vtpm_uuid))
-    print "Has vtpm record '%s'" % vtpm_rec
 
 
 def xapi_pif_list(args, async = False):
Index: root/xen-unstable.hg/docs/xen-api/xenapi-datamodel.tex
===================================================================
--- root.orig/xen-unstable.hg/docs/xen-api/xenapi-datamodel.tex
+++ root/xen-unstable.hg/docs/xen-api/xenapi-datamodel.tex
@@ -9231,38 +9231,6 @@ value of the field
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
-\subsubsection{RPC name:~get\_instance}
-
-{\bf Overview:} 
-Get the instance field of the given VTPM.
-
- \noindent {\bf Signature:} 
-\begin{verbatim} int get_instance (session_id s, VTPM ref self)\end{verbatim}
-
-
-\noindent{\bf Arguments:}
-
- 
-\vspace{0.3cm}
-\begin{tabular}{|c|c|p{7cm}|}
- \hline
-{\bf type} & {\bf name} & {\bf description} \\ \hline
-{\tt VTPM ref } & self & reference to the object \\ \hline 
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:} 
-{\tt 
-int
-}
-
-
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
 \subsubsection{RPC name:~create}
 
 {\bf Overview:} 
Index: root/xen-unstable.hg/tools/libxen/include/xen_vtpm.h
===================================================================
--- root.orig/xen-unstable.hg/tools/libxen/include/xen_vtpm.h
+++ root/xen-unstable.hg/tools/libxen/include/xen_vtpm.h
@@ -196,12 +196,4 @@ xen_vtpm_get_vm(xen_session *session, xe
 extern bool
 xen_vtpm_get_backend(xen_session *session, xen_vm *result, xen_vtpm vtpm);
 
-
-/**
- * Get the instance field of the given VTPM.
- */
-extern bool
-xen_vtpm_get_instance(xen_session *session, int64_t *result, xen_vtpm vtpm);
-
-
 #endif
Index: root/xen-unstable.hg/tools/libxen/src/xen_vtpm.c
===================================================================
--- root.orig/xen-unstable.hg/tools/libxen/src/xen_vtpm.c
+++ root/xen-unstable.hg/tools/libxen/src/xen_vtpm.c
@@ -47,9 +47,6 @@ static const struct_member xen_vtpm_reco
         { .key = "backend",
           .type = &abstract_type_ref,
           .offset = offsetof(xen_vtpm_record, backend) },
-        { .key = "instance",
-          .type = &abstract_type_int,
-          .offset = offsetof(xen_vtpm_record, instance) }
     };
 
 const abstract_type xen_vtpm_record_abstract_type_ =
@@ -183,22 +180,6 @@ xen_vtpm_get_backend(xen_session *sessio
 
 
 bool
-xen_vtpm_get_instance(xen_session *session, int64_t *result, xen_vtpm vtpm)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vtpm }
-        };
-
-    abstract_type result_type = abstract_type_int;
-
-    XEN_CALL_("VTPM.get_instance");
-    return session->ok;
-}
-
-
-bool
 xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm)
 {
     *result = session->ok ? xen_strdup_((char *)vtpm) : NULL;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen
  2007-01-30 14:29 [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen Stefan Berger
@ 2007-01-30 15:12 ` Ewan Mellor
  2007-01-30 15:23   ` Stefan Berger
  0 siblings, 1 reply; 8+ messages in thread
From: Ewan Mellor @ 2007-01-30 15:12 UTC (permalink / raw)
  To: Stefan Berger; +Cc: xen-devel

On Tue, Jan 30, 2007 at 09:29:47AM -0500, Stefan Berger wrote:

> This patch aligns vTPM support in the Xen-API, documentation and lib-xen
> (after the recent changes).
> 
> Signed-off-by: Stefan Berger <stefanb@us.ibm.com>

What's the intention here?  You've removed the get_instance calls, but not the
instance field from the documentation.  Assuming that that's just a mistake,
and you meant to remove the instance field, we're left with a VTPM class that
has nothing other than a reference to a VM and a reference to a backend
domain.  What are the semantics of that object now?

Ewan.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen
  2007-01-30 15:12 ` Ewan Mellor
@ 2007-01-30 15:23   ` Stefan Berger
  2007-01-30 15:32     ` Ewan Mellor
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Berger @ 2007-01-30 15:23 UTC (permalink / raw)
  To: Ewan Mellor; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1155 bytes --]

Ewan Mellor <ewan@xensource.com> wrote on 01/30/2007 10:12:10 AM:

> On Tue, Jan 30, 2007 at 09:29:47AM -0500, Stefan Berger wrote:
> 
> > This patch aligns vTPM support in the Xen-API, documentation and 
lib-xen
> > (after the recent changes).
> > 
> > Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
> 
> What's the intention here?  You've removed the get_instance calls, but 
not the
> instance field from the documentation.  Assuming that that's just a 
mistake,
> and you meant to remove the instance field, we're left with a VTPM class 
that
> has nothing other than a reference to a VM and a reference to a backend
> domain.  What are the semantics of that object now?

The instance will remain to be assigned by the hotplug scripts. In the 
old-style of VM configuration file one could still pass it as parameter, 
but its ignored. I rather not have it passed in as a parameter by the 
Xen-API, either. From what I can see a getter for it is not useful, 
either, since I want the instance number to be hidden from management 
software.
The instance field should then also be removed from the documentation - I 
forgot that.
 
Stefan

> 
> Ewan.

[-- Attachment #1.2: Type: text/html, Size: 1505 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen
  2007-01-30 15:23   ` Stefan Berger
@ 2007-01-30 15:32     ` Ewan Mellor
  2007-01-30 15:53       ` Stefan Berger
  0 siblings, 1 reply; 8+ messages in thread
From: Ewan Mellor @ 2007-01-30 15:32 UTC (permalink / raw)
  To: Stefan Berger; +Cc: xen-devel

On Tue, Jan 30, 2007 at 10:23:13AM -0500, Stefan Berger wrote:

> Ewan Mellor <ewan@xensource.com> wrote on 01/30/2007 10:12:10 AM:
> 
> > On Tue, Jan 30, 2007 at 09:29:47AM -0500, Stefan Berger wrote:
> >
> > > This patch aligns vTPM support in the Xen-API, documentation and
> lib-xen
> > > (after the recent changes).
> > >
> > > Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
> >
> > What's the intention here?  You've removed the get_instance calls, but
> not the
> > instance field from the documentation.  Assuming that that's just a
> mistake,
> > and you meant to remove the instance field, we're left with a VTPM class
> that
> > has nothing other than a reference to a VM and a reference to a backend
> > domain.  What are the semantics of that object now?
> 
> The instance will remain to be assigned by the hotplug scripts. In the
> old-style of VM configuration file one could still pass it as parameter,
> but its ignored. I rather not have it passed in as a parameter by the
> Xen-API, either. From what I can see a getter for it is not useful,
> either, since I want the instance number to be hidden from management
> software.

What we're left with seems like a pretty expensive way of saying "VTPM_backend
= N".  Is there really nothing else that's configurable?  We could just put
this into VM.other_config if that's the only thing that you need, which would
make configuring a VTPM a lot easier.

Ewan.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen
  2007-01-30 15:32     ` Ewan Mellor
@ 2007-01-30 15:53       ` Stefan Berger
  2007-01-30 16:13         ` Ewan Mellor
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Berger @ 2007-01-30 15:53 UTC (permalink / raw)
  To: Ewan Mellor; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1825 bytes --]

Ewan Mellor <ewan@xensource.com> wrote on 01/30/2007 10:32:40 AM:

> On Tue, Jan 30, 2007 at 10:23:13AM -0500, Stefan Berger wrote:
> 
> > Ewan Mellor <ewan@xensource.com> wrote on 01/30/2007 10:12:10 AM:
> > 
> > > On Tue, Jan 30, 2007 at 09:29:47AM -0500, Stefan Berger wrote:
> > >
> > > > This patch aligns vTPM support in the Xen-API, documentation and
> > lib-xen
> > > > (after the recent changes).
> > > >
> > > > Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
> > >
> > > What's the intention here?  You've removed the get_instance calls, 
but
> > not the
> > > instance field from the documentation.  Assuming that that's just a
> > mistake,
> > > and you meant to remove the instance field, we're left with a VTPM 
class
> > that
> > > has nothing other than a reference to a VM and a reference to a 
backend
> > > domain.  What are the semantics of that object now?
> > 
> > The instance will remain to be assigned by the hotplug scripts. In the
> > old-style of VM configuration file one could still pass it as 
parameter,
> > but its ignored. I rather not have it passed in as a parameter by the
> > Xen-API, either. From what I can see a getter for it is not useful,
> > either, since I want the instance number to be hidden from management
> > software.
> 
> What we're left with seems like a pretty expensive way of saying 
"VTPM_backend
> = N".  Is there really nothing else that's configurable?  We could just 
put
> this into VM.other_config if that's the only thing that you need, which 
would
> make configuring a VTPM a lot easier.

I would like to treat the vTPM as a device like VIF and VBDs with create 
and destroy methods exported to management software so that a TPM device 
can be added to a VM similar to other devices and possibly removed when 
the VM is not running.

  Stefan

> 
> Ewan.

[-- Attachment #1.2: Type: text/html, Size: 2383 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen
  2007-01-30 15:53       ` Stefan Berger
@ 2007-01-30 16:13         ` Ewan Mellor
  2007-01-30 16:18           ` Stefan Berger
  0 siblings, 1 reply; 8+ messages in thread
From: Ewan Mellor @ 2007-01-30 16:13 UTC (permalink / raw)
  To: Stefan Berger; +Cc: xen-devel

On Tue, Jan 30, 2007 at 10:53:24AM -0500, Stefan Berger wrote:

> Ewan Mellor <ewan@xensource.com> wrote on 01/30/2007 10:32:40 AM:
> 
> > On Tue, Jan 30, 2007 at 10:23:13AM -0500, Stefan Berger wrote:
> >
> > > Ewan Mellor <ewan@xensource.com> wrote on 01/30/2007 10:12:10 AM:
> > >
> > > > On Tue, Jan 30, 2007 at 09:29:47AM -0500, Stefan Berger wrote:
> > > >
> > > > > This patch aligns vTPM support in the Xen-API, documentation and
> > > lib-xen
> > > > > (after the recent changes).
> > > > >
> > > > > Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
> > > >
> > > > What's the intention here?  You've removed the get_instance calls,
> but
> > > not the
> > > > instance field from the documentation.  Assuming that that's just a
> > > mistake,
> > > > and you meant to remove the instance field, we're left with a VTPM
> class
> > > that
> > > > has nothing other than a reference to a VM and a reference to a
> backend
> > > > domain.  What are the semantics of that object now?
> > >
> > > The instance will remain to be assigned by the hotplug scripts. In the
> > > old-style of VM configuration file one could still pass it as
> parameter,
> > > but its ignored. I rather not have it passed in as a parameter by the
> > > Xen-API, either. From what I can see a getter for it is not useful,
> > > either, since I want the instance number to be hidden from management
> > > software.
> >
> > What we're left with seems like a pretty expensive way of saying
> "VTPM_backend
> > = N".  Is there really nothing else that's configurable?  We could just
> put
> > this into VM.other_config if that's the only thing that you need, which
> would
> > make configuring a VTPM a lot easier.
> 
> I would like to treat the vTPM as a device like VIF and VBDs with create
> and destroy methods exported to management software so that a TPM device
> can be added to a VM similar to other devices and possibly removed when
> the VM is not running.

Well you'll certainly be able to remove it, whichever way it's modelled.  I'm
not sure that treating the VTPM as a device is worth the cost, but if you
prefer it that way, that's fine by me.

I'll just remove that instance field from the docs, and leave it at that.

Ewan.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen
  2007-01-30 16:13         ` Ewan Mellor
@ 2007-01-30 16:18           ` Stefan Berger
  2007-01-30 16:33             ` Ewan Mellor
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Berger @ 2007-01-30 16:18 UTC (permalink / raw)
  To: Ewan Mellor; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2585 bytes --]

Ewan Mellor <ewan@xensource.com> wrote on 01/30/2007 11:13:35 AM:

> On Tue, Jan 30, 2007 at 10:53:24AM -0500, Stefan Berger wrote:
> 
> > Ewan Mellor <ewan@xensource.com> wrote on 01/30/2007 10:32:40 AM:
> > 
> > > On Tue, Jan 30, 2007 at 10:23:13AM -0500, Stefan Berger wrote:
> > >
> > > > Ewan Mellor <ewan@xensource.com> wrote on 01/30/2007 10:12:10 AM:
> > > >
> > > > > On Tue, Jan 30, 2007 at 09:29:47AM -0500, Stefan Berger wrote:
> > > > >
> > > > > > This patch aligns vTPM support in the Xen-API, documentation 
and
> > > > lib-xen
> > > > > > (after the recent changes).
> > > > > >
> > > > > > Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
> > > > >
> > > > > What's the intention here?  You've removed the get_instance 
calls,
> > but
> > > > not the
> > > > > instance field from the documentation.  Assuming that that's 
just a
> > > > mistake,
> > > > > and you meant to remove the instance field, we're left with a 
VTPM
> > class
> > > > that
> > > > > has nothing other than a reference to a VM and a reference to a
> > backend
> > > > > domain.  What are the semantics of that object now?
> > > >
> > > > The instance will remain to be assigned by the hotplug scripts. In 
the
> > > > old-style of VM configuration file one could still pass it as
> > parameter,
> > > > but its ignored. I rather not have it passed in as a parameter by 
the
> > > > Xen-API, either. From what I can see a getter for it is not 
useful,
> > > > either, since I want the instance number to be hidden from 
management
> > > > software.
> > >
> > > What we're left with seems like a pretty expensive way of saying
> > "VTPM_backend
> > > = N".  Is there really nothing else that's configurable?  We could 
just
> > put
> > > this into VM.other_config if that's the only thing that you need, 
which
> > would
> > > make configuring a VTPM a lot easier.
> > 
> > I would like to treat the vTPM as a device like VIF and VBDs with 
create
> > and destroy methods exported to management software so that a TPM 
device
> > can be added to a VM similar to other devices and possibly removed 
when
> > the VM is not running.
> 
> Well you'll certainly be able to remove it, whichever way it's modelled. 
 I'm
> not sure that treating the VTPM as a device is worth the cost, but if 
you
> prefer it that way, that's fine by me.
> 
> I'll just remove that instance field from the docs, and leave it at 
that.
> 

Thank you. I noticed there's an error in the patch to XendDomainInfo. If 
you replace the has_type() part with has_key() then test 9 passes. Sorry 
for that.

  Stefan


> Ewan.

[-- Attachment #1.2: Type: text/html, Size: 3538 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen
  2007-01-30 16:18           ` Stefan Berger
@ 2007-01-30 16:33             ` Ewan Mellor
  0 siblings, 0 replies; 8+ messages in thread
From: Ewan Mellor @ 2007-01-30 16:33 UTC (permalink / raw)
  To: Stefan Berger; +Cc: xen-devel

On Tue, Jan 30, 2007 at 11:18:01AM -0500, Stefan Berger wrote:

> I noticed there's an error in the patch to XendDomainInfo. If
> you replace the has_type() part with has_key() then test 9 passes. Sorry
> for that.

Fixed, thanks.

Ewan.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-01-30 16:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-30 14:29 [PATCH] [XEND] alignment of vtpm support in xenapi, documentation and libxen Stefan Berger
2007-01-30 15:12 ` Ewan Mellor
2007-01-30 15:23   ` Stefan Berger
2007-01-30 15:32     ` Ewan Mellor
2007-01-30 15:53       ` Stefan Berger
2007-01-30 16:13         ` Ewan Mellor
2007-01-30 16:18           ` Stefan Berger
2007-01-30 16:33             ` Ewan Mellor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.