[libvirt] [PATCH] util: removing dead code inside virstoragefile.

Julio Faracco posted 1 patch 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1496368569-14937-1-git-send-email-jcfaracco@gmail.com
src/util/virstoragefile.c | 7 -------
1 file changed, 7 deletions(-)
[libvirt] [PATCH] util: removing dead code inside virstoragefile.
Posted by Julio Faracco 6 years, 10 months ago
The host address or the socket path have already been checked at the begining 
of the function virStorageSourceParseNBDColonString(). So, when the parameter 
is not a unix socket, there is no reason to check the address again because 
if it does not exists, the logic will fail in the first IF conditional.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
---
 src/util/virstoragefile.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index b43acf6..6d8ada9 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2635,13 +2635,6 @@ virStorageSourceParseNBDColonString(const char *nbdstr,
             goto cleanup;
 
    } else {
-        if (!backing[1]) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("missing host name in nbd string '%s'"),
-                           nbdstr);
-            goto cleanup;
-        }
-
         if (VIR_STRDUP(src->hosts->name, backing[1]) < 0)
             goto cleanup;
 
-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] util: removing dead code inside virstoragefile.
Posted by Peter Krempa 6 years, 10 months ago
On Thu, Jun 01, 2017 at 22:56:09 -0300, Julio Faracco wrote:
> The host address or the socket path have already been checked at the begining 
> of the function virStorageSourceParseNBDColonString(). So, when the parameter 
> is not a unix socket, there is no reason to check the address again because 
> if it does not exists, the logic will fail in the first IF conditional.
> 
> Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
> ---
>  src/util/virstoragefile.c | 7 -------
>  1 file changed, 7 deletions(-)

ACK, I'll push this in a while.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list