diff --git a/src/util/viruri.c b/src/util/viruri.c index 661ba761568077b3eb79f866c3826db41e470596..48796ddbeb89efb63d089fea0b72a680c2836a33 100644 --- a/src/util/viruri.c +++ b/src/util/viruri.c @@ -258,6 +258,13 @@ virURIFormat(virURIPtr uri) xmluri.server = tmpserver; } + /* + * This helps libxml2 deal with the difference + * between uri:/absolute/path and uri:///absolute/path. + */ + if (!xmluri.server && !xmluri.port) + xmluri.port = -1; + ret = (char *)xmlSaveUri(&xmluri); if (!ret) { virReportOOMError();