Re: [PATCH] tpm: Use /dev/null for cancel path if none was found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/29/2017 02:06 PM, Daniel P. Berrange wrote:
On Thu, Jun 29, 2017 at 02:01:11PM -0400, Stefan Berger wrote:
TPM 2 does not implement sysfs files for cancellation of commands.
We therefore use /dev/null for the cancel path passed to QEMU.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxxxxxxxxxx>
---
  src/util/virtpm.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/util/virtpm.c b/src/util/virtpm.c
index 6d9b065..d5c10da 100644
--- a/src/util/virtpm.c
+++ b/src/util/virtpm.c
@@ -61,9 +61,7 @@ virTPMCreateCancelPath(const char *devpath)
                  VIR_FREE(path);
              }
              if (!path)
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                               _("No usable sysfs TPM cancel file could be "
-                                 "found"));
+                ignore_value(VIR_STRDUP(path, "/dev/null"));
          } else {
              virReportError(VIR_ERR_INTERNAL_ERROR,
                             _("TPM device path %s is invalid"), devpath);
It would be better to simply not set the cancel-path= argument to QEMU if
it is not required / available.

Unfortunately QEMU will do the same thing as libvirt, that is search for the sysfs cancel path, unless it is provided via command line. We provide it here with a 'dummy path.'

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux