From nobody Wed May 14 11:30:06 2025
Delivered-To: importer@patchew.org
Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28
as permitted sender) client-ip=209.132.183.28;
envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com;
Authentication-Results: mx.zohomail.com;
spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as
permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com;
dmarc=pass(p=none dis=none) header.from=redhat.com
Return-Path: 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_DEF=
AULT_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 configur=
ation on disk
-# virsh -c lxc:/// define myguest.xml +# virsh -c lxc:///system define myguest.xml=20
--inactive
flag
=20
-# virsh -c lxc:/// dumpxml myguest +# virsh -c lxc:///system dumpxml myguest=20
-# virsh -c lxc:/// start myguest +# virsh -c lxc:///system start myguest=20
@@ -673,7 +673,7 @@ by libvirt, using the virsh create
command.
-# virsh -c lxc:/// create myguest.xml +# virsh -c lxc:///system create myguest.xml=20 =20 @@ -689,7 +689,7 @@ to PID 1 inside the container. =20
-# virsh -c lxc:/// shutdown myguest +# virsh -c lxc:///system shutdown myguest=20
@@ -698,7 +698,7 @@ request, it can be forcibly stopped using the vir=
sh destroy
-# virsh -c lxc:/// destroy myguest +# virsh -c lxc:///system destroy myguest=20 =20 @@ -714,7 +714,7 @@ to PID 1 inside the container. =20
-# virsh -c lxc:/// reboot myguest +# virsh -c lxc:///system reboot myguest=20
-# virsh -c lxc:/// undefine myguest +# virsh -c lxc:///system undefine myguest=20
-# virsh -c lxc:/// console myguest +# virsh -c lxc:///system console myguest=20
@@ -749,7 +749,7 @@ as 'console0', 'console1', 'console2', etc.
=20-# virsh -c lxc:/// console myguest --devname console1 +# virsh -c lxc:///system console myguest --devname console1=20
-# virsh -c lxc:/// lxc-enter-namespace myguest -- /bin/ls -al /dev +# virsh -c lxc:///system lxc-enter-namespace myguest -- /bin/ls -al /dev=20
-# virt-top -c lxc:/// +# virt-top -c lxc:///system=20
-# 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=20
diff --git a/examples/lxcconvert/virt-lxc-convert b/examples/lxcconvert/vir= t-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 =3D $memory" >> "$conf_new" fi =20 -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 4f600f3df7..cb481bf20a 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -164,7 +164,7 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr co= nn, if (lxc_driver =3D=3D NULL) return VIR_DRV_OPEN_DECLINED; =20 - if (!(conn->uri =3D virURIParse("lxc:///"))) + if (!(conn->uri =3D virURIParse("lxc:///system"))) return VIR_DRV_OPEN_ERROR; } else { if (conn->uri->scheme =3D=3D NULL || @@ -177,9 +177,10 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr c= onn, =20 /* If path isn't '/' then they typoed, tell them correct path */ if (conn->uri->path !=3D 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:///sys= tem"), conn->uri->path); return VIR_DRV_OPEN_ERROR; } diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 85c7bcc321..99c41014ee 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -109,7 +109,7 @@ virLXCProcessReboot(virLXCDriverPtr driver, virObjectRef(conn); autodestroy =3D true; } else { - conn =3D virConnectOpen("lxc:///"); + conn =3D virConnectOpen("lxc:///system"); /* Ignoring NULL conn which is mostly harmless here */ } =20 @@ -1629,7 +1629,7 @@ virLXCProcessAutostartAll(virLXCDriverPtr driver) * to lookup the bridge associated with a virtual * network */ - virConnectPtr conn =3D virConnectOpen("lxc:///"); + virConnectPtr conn =3D virConnectOpen("lxc:///system"); /* Ignoring NULL conn which is mostly harmless here */ =20 struct virLXCProcessAutostartData data =3D { 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=3D'default xen:///system vbox+tcp://host/system lxc:///' +# example: URIS=3D'default xen:///system vbox+tcp://host/system lxc:///sys= tem' #URIS=3Ddefault =20 # 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 =20 connect locally as a normal user to his own set of QEMU and KVM domains =20 -=3Ditem lxc:/// +=3Ditem lxc:///system =20 connect to a local linux container =20 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; =20 - conn =3D virConnectOpen("lxc:///"); + conn =3D virConnectOpen("lxc:///system"); if (!conn) goto cleanup; =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list