[libvirt] [PATCH v2 1/4] util: Modify virStorageFileGetSCSIKey return

Ján Tomko jtomko at redhat.com
Fri Feb 1 14:46:10 UTC 2019


On Fri, Jan 18, 2019 at 09:42:34AM -0500, John Ferlan wrote:
>Alter the "real" code to return -2 on virCommandRun failure.
>Alter the comments and function header to describe the function
>and it's returns.

*its

>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/util/virstoragefile.c | 21 ++++++++++++++++++---
> 1 file changed, 18 insertions(+), 3 deletions(-)
>
>diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
>index bd4b0274df..2511511d14 100644
>--- a/src/util/virstoragefile.c
>+++ b/src/util/virstoragefile.c
>@@ -1425,9 +1425,24 @@ int virStorageFileGetLVMKey(const char *path,
> }
> #endif
>
>+

Unrelated whitespace change

> #ifdef WITH_UDEV
>-int virStorageFileGetSCSIKey(const char *path,
>-                             char **key)
>+/* virStorageFileGetSCSIKey
>+ * @path: Path to the SCSI device
>+ * @key: Unique key to be returned
>+ *
>+ * Using a udev specific function, query the @path to get and return a
>+ * unique @key for the caller to use.
>+ *
>+ * Returns:
>+ *     0 On success, with the @key filled in or @key=NULL if the
>+ *       returned string was empty.
>+ *    -1 When WITH_UDEV is undefined and a system error is reported
>+ *    -2 When WITH_UDEV is defined, but calling virCommandRun fails
>+ */
>+int
>+virStorageFileGetSCSIKey(const char *path,
>+                         char **key)
> {
>     int status;
>     virCommandPtr cmd = virCommandNewArgList("/lib/udev/scsi_id",

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190201/f1f2d20e/attachment-0001.sig>


More information about the libvir-list mailing list