Skip to contentSkip to conversation

Show vtpm with xm

PATCH Applied Stefan Berger 3 participants 5 messages Jan 31, 2006 – Feb 10, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Show vtpm with xm

The attached patch adds 'xm vtpm-list <DomId>' functionality.

xen-unstable.hg/tools/python/xen/xm/main.py +12 -1
Index: root/xen-unstable.hg/tools/python/xen/xm/main.py
===================================================================
@@ -101,7 +101,7 @@ network_list_help = "network-list <DomId
 vnet_list_help = "vnet-list [-l|--long]            list vnets"
 vnet_create_help = "vnet-create <config>             create a vnet from a config file"
 vnet_delete_help = "vnet-delete <vnetid>             delete a vnet"
-
+vtpm_list_help = "vtpm-list <DomId>                list virtual TPM devices"
 
 short_command_list = [
     "console",
@@ -165,6 +165,7 @@ device_commands = [
     "network-attach",
     "network-detach",
     "network-list",
+    "vtpm-list",
     ]
 
 vnet_commands = [
@@ -699,6 +700,14 @@ def xm_block_list(args):
         sxp.show(x)
         print
 
+def xm_vtpm_list(args):
+    arg_check(args, "vtpm-list", 1)
+    dom = args[0]
+    from xen.xend.XendClient import server
+    for x in server.xend_domain_devices(dom, 'vtpm'):
+        sxp.show(x)
+        print
+
 def xm_block_attach(args):
     arg_check(args, 'block-attach', 4, 5)
 
@@ -834,6 +843,8 @@ commands = {
     "vnet-list": xm_vnet_list,
     "vnet-create": xm_vnet_create,
     "vnet-delete": xm_vnet_delete,
+    # vtpm
+    "vtpm-list": xm_vtpm_list,
     }
 
 ## The commands supported by a separate argument parser in xend.xm.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

I know all of the other devices spit out S-Expression outputs but perhaps we can spit something a little more friendly out.

Regards,

Anthony Liguori

Quoted 64 lines · Stefan Berger

The attached patch adds 'xm vtpm-list <DomId>' functionality.

------------------------------------------------------------------------

Index: root/xen-unstable.hg/tools/python/xen/xm/main.py
===================================================================

xen-unstable.hg/tools/python/xen/xm/main.py +0 -0
@@ -101,7 +101,7 @@ network_list_help = "network-list <DomId

vnet_list_help = "vnet-list [-l|--long] list vnets"
vnet_create_help = "vnet-create <config> create a vnet from a config file"
vnet_delete_help = "vnet-delete <vnetid> delete a vnet"

xen-unstable.hg/tools/python/xen/xm/main.py +1 -1
-
+vtpm_list_help = "vtpm-list <DomId>                list virtual TPM devices"

short_command_list = [

    "console",
xen-unstable.hg/tools/python/xen/xm/main.py +1 -0
@@ -165,6 +165,7 @@ device_commands = [
    "network-attach",
    "network-detach",
    "network-list",
+    "vtpm-list",
    ]
 

vnet_commands = [

xen-unstable.hg/tools/python/xen/xm/main.py +8 -0
@@ -699,6 +700,14 @@ def xm_block_list(args):
        sxp.show(x)
        print
 
+def xm_vtpm_list(args):
+    arg_check(args, "vtpm-list", 1)
+    dom = args[0]
+    from xen.xend.XendClient import server
+    for x in server.xend_domain_devices(dom, 'vtpm'):
+        sxp.show(x)
+        print
+

def xm_block_attach(args):

    arg_check(args, 'block-attach', 4, 5)
xen-unstable.hg/tools/python/xen/xm/main.py +2 -1
@@ -834,6 +843,8 @@ commands = {
    "vnet-list": xm_vnet_list,
    "vnet-create": xm_vnet_create,
    "vnet-delete": xm_vnet_delete,
+    # vtpm
+    "vtpm-list": xm_vtpm_list,
    }
 
 ## The commands supported by a separate argument parser in xend.xm.
 
 
------------------------------------------------------------------------

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

Anthony,

the other format that is supported for printout in the sxp class is to
print xml-style. Would that be better or is a format of

attribute = value

more friendly? The problem with attributes and values is that nesting - as it can obviously be done with S-Expression - is not so convenient to display.

Regards,
Stefan

[email protected] wrote on 01/30/2006 10:01:47 PM:

Quoted 27 lines

I know all of the other devices spit out S-Expression outputs but perhaps we can spit something a little more friendly out.

Regards,

Anthony Liguori

Quoted 7 lines · Stefan Berger

The attached patch adds 'xm vtpm-list <DomId>' functionality.

------------------------------------------------------------------------

Quoted 8 lines

Index: root/xen-unstable.hg/tools/python/xen/xm/main.py
===================================================================

xen-unstable.hg/tools/python/xen/xm/main.py +0 -0
@@ -101,7 +101,7 @@ network_list_help = "network-list <DomId

vnet_list_help = "vnet-list [-l|--long] list vnets"
vnet_create_help = "vnet-create <config> create a vnet

from a config file"

Quoted 3 lines

xen-unstable.hg/tools/python/xen/xm/main.py

Quoted 3 lines

vnet_delete_help = "vnet-delete <vnetid> delete a vnet"

xen-unstable.hg/tools/python/xen/xm/main.py +1 -1
-
+vtpm_list_help = "vtpm-list <DomId>                list virtual TPM 

devices"

Quoted 34 lines
Quoted 34 lines

short_command_list = [

    "console",
xen-unstable.hg/tools/python/xen/xm/main.py +1 -0
@@ -165,6 +165,7 @@ device_commands = [
    "network-attach",
    "network-detach",
    "network-list",
+    "vtpm-list",
    ]
 

vnet_commands = [

xen-unstable.hg/tools/python/xen/xm/main.py +8 -0
@@ -699,6 +700,14 @@ def xm_block_list(args):
        sxp.show(x)
        print
 
+def xm_vtpm_list(args):
+    arg_check(args, "vtpm-list", 1)
+    dom = args[0]
+    from xen.xend.XendClient import server
+    for x in server.xend_domain_devices(dom, 'vtpm'):
+        sxp.show(x)
+        print
+

def xm_block_attach(args):

    arg_check(args, 'block-attach', 4, 5)
xen-unstable.hg/tools/python/xen/xm/main.py +2 -0
@@ -834,6 +843,8 @@ commands = {
    "vnet-list": xm_vnet_list,
    "vnet-create": xm_vnet_create,
    "vnet-delete": xm_vnet_delete,
+    # vtpm
+    "vtpm-list": xm_vtpm_list,
    }
 
Quoted 13 lines

xen-unstable.hg/tools/python/xen/xm/main.py commands = { · line 850

Quoted 3 lines
xen-unstable.hg/tools/python/xen/xm/main.py +0 -0
 ## The commands supported by a separate argument parser in xend.xm.

------------------------------------------------------------------------

Quoted 7 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
Quoted 11 lines · Stefan Berger

Anthony,

the other format that is supported for printout in the sxp class is
to print xml-style. Would that be better or is a format of

attribute = value

more friendly? The problem with attributes and values is that nesting
- as it can obviously be done with S-Expression - is not so convenient to display.

Well, I was just thinking something that's more user oriented like the output of xm-list.

Regards,

Anthony Liguori

Quoted 83 lines

Regards,
Stefan

[email protected] wrote on 01/30/2006 10:01:47 PM:

Quoted 27 lines

I know all of the other devices spit out S-Expression outputs but perhaps we can spit something a little more friendly out.

Regards,

Anthony Liguori

Quoted 7 lines · Stefan Berger

The attached patch adds 'xm vtpm-list <DomId>' functionality.

------------------------------------------------------------------------

Quoted 8 lines

Index: root/xen-unstable.hg/tools/python/xen/xm/main.py
===================================================================

xen-unstable.hg/tools/python/xen/xm/main.py +0 -0
@@ -101,7 +101,7 @@ network_list_help = "network-list <DomId

vnet_list_help = "vnet-list [-l|--long] list vnets"
vnet_create_help = "vnet-create <config> create a vnet

from a config file"

Quoted 3 lines

xen-unstable.hg/tools/python/xen/xm/main.py

Quoted 3 lines

vnet_delete_help = "vnet-delete <vnetid> delete a vnet"

xen-unstable.hg/tools/python/xen/xm/main.py +1 -1
-
+vtpm_list_help = "vtpm-list <DomId>                list virtual 

TPM devices"

Quoted 47 lines
Quoted 29 lines

short_command_list = [

    "console",
xen-unstable.hg/tools/python/xen/xm/main.py +1 -0
@@ -165,6 +165,7 @@ device_commands = [
    "network-attach",
    "network-detach",
    "network-list",
+    "vtpm-list",
    ]
 

vnet_commands = [

xen-unstable.hg/tools/python/xen/xm/main.py +8 -0
@@ -699,6 +700,14 @@ def xm_block_list(args):
        sxp.show(x)
        print
 
+def xm_vtpm_list(args):
+    arg_check(args, "vtpm-list", 1)
+    dom = args[0]
+    from xen.xend.XendClient import server
+    for x in server.xend_domain_devices(dom, 'vtpm'):
+        sxp.show(x)
+        print
+

def xm_block_attach(args):

    arg_check(args, 'block-attach', 4, 5)

xen-unstable.hg/tools/python/xen/xm/main.py commands = { · line 850

Quoted 8 lines
xen-unstable.hg/tools/python/xen/xm/main.py +2 -0
@@ -834,6 +843,8 @@ commands = {
    "vnet-list": xm_vnet_list,
    "vnet-create": xm_vnet_create,
    "vnet-delete": xm_vnet_delete,
+    # vtpm
+    "vtpm-list": xm_vtpm_list,
    }
 
 ## The commands supported by a separate argument parser in xend.xm.

------------------------------------------------------------------------

Quoted 7 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Applied
#4 lore raw
In reply to Stefan Berger
Quoted 3 lines · Stefan Berger

The attached patch adds 'xm vtpm-list <DomId>' functionality.

Applied, thank you.

I agree with Anthony that it would be better if this command printed a table of pertinent parameters rather than give the s-expression. The s-expression could still be output with xm vtpm-list --long, just like xm list --long.

I've applied this patch anyway, because no-one seems to want to step forward to do this work, so until then, at least the basic functionality is there. It would be great if someone would do the work for network-list and block-list too.

Ewan.