Skip to contentSkip to conversation

vTPM: limit libxl__add_vtpms() function to para virtual machine

PATCH Superseded Quan Xu 2 participants 5 messages Dec 31, 2014 – Jan 6, 2015

v2 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Quan Xu

author
#0 lore raw

PATCH v2 2/5 vTPM: limit libxl__add_vtpms() function to para virtual machine

---
 tools/libxl/libxl_create.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/libxl/libxl_create.c +3 -2
index b1ff5ae..0a09925 100644
@@ -1358,8 +1358,9 @@ static void domcreate_attach_vtpms(libxl__egc *egc,
        goto error_out;
    }
 
-    /* Plug vtpm devices */
-   if (d_config->num_vtpms > 0) {
+   /* Plug vtpm devices for para virtual domain*/
+   if (d_config->num_vtpms > 0 &&
+       d_config->b_info.type == LIBXL_DOMAIN_TYPE_PV) {
        /* Attach vtpms */
        libxl__multidev_begin(ao, &dcs->multidev);
        dcs->multidev.callback = domcreate_attach_pci;
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 10 lines · Quan Xu
---
 tools/libxl/libxl_create.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/libxl/libxl_create.c +0 -0
index b1ff5ae..0a09925 100644

tools/libxl/libxl_create.c static void domcreate_attach_vtpms(libxl__egc *egc, · line 1363

Quoted 8 lines
tools/libxl/libxl_create.c +3 -2
@@ -1358,8 +1358,9 @@ static void domcreate_attach_vtpms(libxl__egc *egc,
        goto error_out;
    }
 
-    /* Plug vtpm devices */
-   if (d_config->num_vtpms > 0) {
+   /* Plug vtpm devices for para virtual domain*/
+   if (d_config->num_vtpms > 0 &&
+       d_config->b_info.type == LIBXL_DOMAIN_TYPE_PV) {

It's unclear to me why you stub out HVM domain. You need to state your reasoning in comment and commit log. :-/

Wei.

Quoted 5 lines
tools/libxl/libxl_create.c +0 -0
        /* Attach vtpms */
        libxl__multidev_begin(ao, &dcs->multidev);
        dcs->multidev.callback = domcreate_attach_pci;
Signature · 1 line
1.8.3.2
author
#2 lore raw
Quoted 27 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: Monday, January 05, 2015 8:53 PM
To: Xu, Quan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 2/5] vTPM: limit libxl__add_vtpms() function to para virtual machine

tools/libxl/libxl_create.c static void domcreate_attach_vtpms(libxl__egc

Quoted 10 lines · Quan Xu
---
 tools/libxl/libxl_create.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/libxl/libxl_create.c +0 -0
index b1ff5ae..0a09925 100644
@@ -1358,8 +1358,9 @@ static void domcreate_attach_vtpms(libxl__egc

*egc,

Quoted 3 lines
tools/libxl/libxl_create.c +0 -0
        goto error_out;
    }
 
Quoted 8 lines

tools/libxl/libxl_create.c static void domcreate_attach_vtpms(libxl__egc *egc, · line 1363

Quoted 5 lines
tools/libxl/libxl_create.c +3 -2
-    /* Plug vtpm devices */
-   if (d_config->num_vtpms > 0) {
+   /* Plug vtpm devices for para virtual domain*/
+   if (d_config->num_vtpms > 0 &&
+       d_config->b_info.type == LIBXL_DOMAIN_TYPE_PV) {

It's unclear to me why you stub out HVM domain. You need to state your reasoning in comment and commit log. :-/

In brief, it is different to plug vtpm device for HVM/PV domain. I will try to describe more detailed in next v3. Thanks Wei.

Thanks
Quan Xu

Quoted 8 lines

Wei.

Quoted 5 lines
tools/libxl/libxl_create.c +0 -1
        /* Attach vtpms */
        libxl__multidev_begin(ao, &dcs->multidev);
        dcs->multidev.callback = domcreate_attach_pci;
--

1.8.3.2

#3 lore raw
Quoted 33 lines · Quan
Quoted 33 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: Monday, January 05, 2015 8:53 PM
To: Xu, Quan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 2/5] vTPM: limit libxl__add_vtpms() function to para virtual machine

tools/libxl/libxl_create.c static void domcreate_attach_vtpms(libxl__egc

Quoted 10 lines · Quan Xu
---
 tools/libxl/libxl_create.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/libxl/libxl_create.c +0 -0
index b1ff5ae..0a09925 100644
@@ -1358,8 +1358,9 @@ static void domcreate_attach_vtpms(libxl__egc

*egc,

Quoted 8 lines
tools/libxl/libxl_create.c +3 -2
        goto error_out;
    }
 
-    /* Plug vtpm devices */
-   if (d_config->num_vtpms > 0) {
+   /* Plug vtpm devices for para virtual domain*/
+   if (d_config->num_vtpms > 0 &&
+       d_config->b_info.type == LIBXL_DOMAIN_TYPE_PV) {
Quoted 5 lines
Quoted 2 lines

It's unclear to me why you stub out HVM domain. You need to state your reasoning in comment and commit log. :-/

In brief, it is different to plug vtpm device for HVM/PV domain. I will try to describe more detailed in next v3. Thanks Wei.

I got that idea when I read your later patch. But stubbing out PV here is wrong. Essentially this patch introduces a functional regression by itself because now you can't add vtpms for PV. I doubt that you will still need this patch in your next round. See my reply to patch 4/5.

Wei.

Quoted 10 lines

Thanks
Quan Xu

Quoted 8 lines

Wei.

Quoted 5 lines
tools/libxl/libxl_create.c +0 -1
        /* Attach vtpms */
        libxl__multidev_begin(ao, &dcs->multidev);
        dcs->multidev.callback = domcreate_attach_pci;
--

1.8.3.2

author
#4 lore raw
Quoted 49 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: Tuesday, January 06, 2015 5:45 PM
To: Xu, Quan
Cc: Wei Liu; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 2/5] vTPM: limit libxl__add_vtpms() function to para virtual machine

Quoted 37 lines · Quan
Quoted 36 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: Monday, January 05, 2015 8:53 PM
To: Xu, Quan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 2/5] vTPM: limit libxl__add_vtpms() function to para virtual machine

Quoted 11 lines · Quan Xu
---
 tools/libxl/libxl_create.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/tools/libxl/libxl_create.c index b1ff5ae..0a09925 100644

tools/libxl/libxl_create.c +0 -0
@@ -1358,8 +1358,9 @@ static void

domcreate_attach_vtpms(libxl__egc

*egc,

tools/libxl/libxl_create.c static void domcreate_attach_vtpms(libxl__egc *egc, · line 1363

Quoted 8 lines
        goto error_out;
    }
tools/libxl/libxl_create.c +3 -2
-    /* Plug vtpm devices */
-   if (d_config->num_vtpms > 0) {
+   /* Plug vtpm devices for para virtual domain*/
+   if (d_config->num_vtpms > 0 &&
+       d_config->b_info.type == LIBXL_DOMAIN_TYPE_PV) {

It's unclear to me why you stub out HVM domain. You need to state your reasoning in comment and commit log. :-/

Quoted 9 lines
Quoted 1 line

In brief, it is different to plug vtpm device for HVM/PV domain. I will try to

describe more detailed in next v3. Thanks Wei.

Quoted 1 line

I got that idea when I read your later patch. But stubbing out PV here is wrong. Essentially this patch introduces a functional regression by itself because now you can't add vtpms for PV. I doubt that you will still need this patch in your next round. See my reply to patch 4/5.

Okay, I will reply with that email directly..
Quan

Quoted 12 lines

Wei.

Quoted 10 lines

Thanks
Quan Xu

Quoted 8 lines

Wei.

Quoted 5 lines
        /* Attach vtpms */
        libxl__multidev_begin(ao, &dcs->multidev);
        dcs->multidev.callback = domcreate_attach_pci;

--
1.8.3.2