Re: [PATCH v6 04/11] Helper functions for host TPM support

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

 



On 04/12/2013 03:40 PM, Eric Blake wrote:
On 04/12/2013 12:47 PM, Stefan Berger wrote:
After a further simplification the patch now looks like this:


Implement helper function to create the TPM's sysfs cancel file.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Corey Bryant <coreyb@xxxxxxxxxxxxxxxxxx>
Tested-by: Corey Bryant <coreyb@xxxxxxxxxxxxxxxxxx>

---
+char *
+virTPMCreateCancelPath(const char *devpath)
+{
+    char *path = NULL;
+    const char *dev;
+
+    if (devpath) {
+        dev = strrchr(devpath, '/');
+        if (dev) {
+            dev++;
+            if (virAsprintf(&path, "/sys/class/misc/%s/device/cancel",
+                            dev) < 0) {
Do we need to worry about systems that don't mount sysfs at /sys?  But
if there is someone in such a situation, they can provide a patch for
further configuration tuning.

Right...


+                virReportOOMError();
+                goto cleanup;
+            }
+        } else {
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("TPM device path %s is invalid"), devpath);
+        }
+    } else {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("Missing TPM device path"));
+    }
+
+cleanup:
+    return path;
+}
Looks okay to me.

Sounds like an ACK...

--
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]