]> xenbits.xensource.com Git - libvirt.git/commitdiff
lxc: allow empty path in URI for historical compatibility
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 24 Dec 2018 15:09:25 +0000 (15:09 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 9 Jan 2019 14:10:00 +0000 (14:10 +0000)
The use of 'lxc://' was mistakenly broken in:

  commit 4c8574c85c554e68de0d8bf9b85727954a5bea91
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Wed Mar 28 12:49:29 2018 +0100

    driver: ensure NULL URI isn't passed to drivers with whitelisted URIs

Allow it again for historical compatibility.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/lxc/lxc_driver.c

index de045c80bb8d8d35a6eb87b1a76aba3c5435721c..df15a0da50c637ffea2aeb3dbf7015ffcc401026 100644 (file)
@@ -140,7 +140,8 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn,
     virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
 
     /* If path isn't '/' then they typoed, tell them correct path */
-    if (STRNEQ(conn->uri->path, "/") &&
+    if (STRNEQ(conn->uri->path, "") &&
+        STRNEQ(conn->uri->path, "/") &&
         STRNEQ(conn->uri->path, "/system")) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unexpected LXC URI path '%s', try lxc:///system"),