diff --git a/docs/drvlxc.html.in b/docs/drvlxc.html.in index 58a336ed30..44c49609d9 100644 --- a/docs/drvlxc.html.in +++ b/docs/drvlxc.html.in @@ -308,8 +308,8 @@ unit file specifies how systemd will start the libvirt LXC container Description=My little container [Service] -ExecStart=/usr/bin/virsh -c lxc:/// start --pass-fds 3 mycontainer -ExecStop=/usr/bin/virsh -c lxc:/// destroy mycontainer +ExecStart=/usr/bin/virsh -c lxc:///system start --pass-fds 3 mycontainer +ExecStop=/usr/bin/virsh -c lxc:///system destroy mycontainer Type=oneshot RemainAfterExit=yes KillMode=none @@ -621,9 +621,9 @@ The use of namespace passthrough requires libvirt >= 1.2.19 As with any libvirt virtualization driver, LXC containers can be managed via a wide variety of libvirt based tools. At the lowest level the virsh command can be used to perform many -tasks, by passing the -c lxc:/// argument. As an +tasks, by passing the -c lxc:///system argument. As an alternative to repeating the URI with every command, the LIBVIRT_DEFAULT_URI -environment variable can be set to lxc:///. The +environment variable can be set to lxc:///system. The examples that follow outline some common operations with virsh and LXC. For further details about usage of virsh consult its manual page. @@ -637,7 +637,7 @@ document and loads it into libvirt, saving the configuration on disk

-# virsh -c lxc:/// define myguest.xml
+# virsh -c lxc:///system define myguest.xml
 

Viewing container configuration

@@ -652,7 +652,7 @@ using the --inactive flag

-# virsh -c lxc:/// dumpxml myguest
+# virsh -c lxc:///system dumpxml myguest
 

Starting containers

@@ -663,7 +663,7 @@ container from a previously defined persistent configuration

-# virsh -c lxc:/// start myguest
+# virsh -c lxc:///system start myguest
 

@@ -673,7 +673,7 @@ by libvirt, using the virsh create command.

-# virsh -c lxc:/// create myguest.xml
+# virsh -c lxc:///system create myguest.xml
 
@@ -689,7 +689,7 @@ to PID 1 inside the container.

-# virsh -c lxc:/// shutdown myguest
+# virsh -c lxc:///system shutdown myguest
 

@@ -698,7 +698,7 @@ request, it can be forcibly stopped using the virsh destroy

-# virsh -c lxc:/// destroy myguest
+# virsh -c lxc:///system destroy myguest
 
@@ -714,7 +714,7 @@ to PID 1 inside the container.

-# virsh -c lxc:/// reboot myguest
+# virsh -c lxc:///system reboot myguest
 

Undefining (deleting) a container configuration

@@ -726,7 +726,7 @@ running, this will turn it into a "transient" guest.

-# virsh -c lxc:/// undefine myguest
+# virsh -c lxc:///system undefine myguest
 

Connecting to a container console

@@ -737,7 +737,7 @@ to the text console associated with a container.

-# virsh -c lxc:/// console myguest
+# virsh -c lxc:///system console myguest
 

@@ -749,7 +749,7 @@ as 'console0', 'console1', 'console2', etc.

-# virsh -c lxc:/// console myguest --devname console1
+# virsh -c lxc:///system console myguest --devname console1
 

Running commands in a container

@@ -761,7 +761,7 @@ and then execute an arbitrary command.

-# virsh -c lxc:/// lxc-enter-namespace myguest -- /bin/ls -al /dev
+# virsh -c lxc:///system lxc-enter-namespace myguest -- /bin/ls -al /dev
 

Monitoring container utilization

@@ -773,7 +773,7 @@ host

-# virt-top -c lxc:///
+# virt-top -c lxc:///system
 

Converting LXC container configuration

@@ -784,7 +784,7 @@ most of the LXC container configuration into a domain XML fragment

-# virsh -c lxc:/// domxml-from-native lxc-tools /var/lib/lxc/myguest/config
+# virsh -c lxc:///system domxml-from-native lxc-tools /var/lib/lxc/myguest/config
 

diff --git a/examples/lxcconvert/virt-lxc-convert b/examples/lxcconvert/virt-lxc-convert index e62172eea4..5260eb708f 100644 --- a/examples/lxcconvert/virt-lxc-convert +++ b/examples/lxcconvert/virt-lxc-convert @@ -123,5 +123,5 @@ if test -z "$mem_limit"; then echo "lxc.cgroup.memory.limit_in_bytes = $memory" >> "$conf_new" fi -virsh -c lxc:/// domxml-from-native lxc-tools $conf_new +virsh -c lxc:///system domxml-from-native lxc-tools $conf_new exit $? diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 9cf67b9854..f61e0b33ef 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -164,7 +164,7 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn, if (lxc_driver == NULL) return VIR_DRV_OPEN_DECLINED; - if (!(conn->uri = virURIParse("lxc:///"))) + if (!(conn->uri = virURIParse("lxc:///system"))) return VIR_DRV_OPEN_ERROR; } else { if (conn->uri->scheme == NULL || @@ -177,9 +177,10 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn, /* If path isn't '/' then they typoed, tell them correct path */ if (conn->uri->path != NULL && - 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:///"), + _("Unexpected LXC URI path '%s', try lxc:///system"), conn->uri->path); return VIR_DRV_OPEN_ERROR; } diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 96041f2ec7..e911d88b56 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -105,7 +105,7 @@ virLXCProcessReboot(virLXCDriverPtr driver, virObjectRef(conn); autodestroy = true; } else { - conn = virConnectOpen("lxc:///"); + conn = virConnectOpen("lxc:///system"); /* Ignoring NULL conn which is mostly harmless here */ } @@ -1625,7 +1625,7 @@ virLXCProcessAutostartAll(virLXCDriverPtr driver) * to lookup the bridge associated with a virtual * network */ - virConnectPtr conn = virConnectOpen("lxc:///"); + virConnectPtr conn = virConnectOpen("lxc:///system"); /* Ignoring NULL conn which is mostly harmless here */ struct virLXCProcessAutostartData data = { driver, conn }; diff --git a/tools/libvirt-guests.sysconf b/tools/libvirt-guests.sysconf index 4e11464d2d..669b046507 100644 --- a/tools/libvirt-guests.sysconf +++ b/tools/libvirt-guests.sysconf @@ -1,5 +1,5 @@ # URIs to check for running guests -# example: URIS='default xen:///system vbox+tcp://host/system lxc:///' +# example: URIS='default xen:///system vbox+tcp://host/system lxc:///system' #URIS=default # action taken on host boot diff --git a/tools/virsh.pod b/tools/virsh.pod index 4d25ac5d9b..929958a953 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -266,7 +266,7 @@ connect locally as root to the daemon supervising QEMU and KVM domains connect locally as a normal user to his own set of QEMU and KVM domains -=item lxc:/// +=item lxc:///system connect to a local linux container diff --git a/tools/virt-login-shell.c b/tools/virt-login-shell.c index 016e2b6d4e..b68c393026 100644 --- a/tools/virt-login-shell.c +++ b/tools/virt-login-shell.c @@ -253,7 +253,7 @@ main(int argc, char **argv) if (virConfGetValueBool(conf, "auto_shell", &autoshell) < 0) goto cleanup; - conn = virConnectOpen("lxc:///"); + conn = virConnectOpen("lxc:///system"); if (!conn) goto cleanup;