diff --git a/tools/virsh.c b/tools/virsh.c index 1d0b6e4738a5478cd088a07960b867fbb69c6af3..78a5c5b4ab8d0758b0c81c259891f416104ea7e2 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -5829,20 +5829,12 @@ cmdPoolDiscoverSourcesAs(vshControl * ctl, const vshCmd * cmd ATTRIBUTE_UNUSED) return FALSE; if (host) { - size_t hostlen = strlen(host); char *port = vshCommandOptString(cmd, "port", &found); - if (!found) { - port = strrchr(host, ':'); - if (port) { - if (*(++port)) - hostlen = port - host - 1; - else - port = NULL; - } - } + if (!found) + port = NULL; virBuffer buf = VIR_BUFFER_INITIALIZER; virBufferAddLit(&buf, "\n"); - virBufferVSprintf(&buf, " \n");