From a8ea89d2588d8162404ff41d805d49a1cb0fba7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 27 Mar 2018 14:32:07 +0100 Subject: [PATCH] xen: encourage use of xen:///system URI as preferred format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Historically we have used a bare xen:/// URI for connecting to the legacy Xen driver. The new libxl Xen driver follows the new practice of allowing '/system' as a path, as well as bare '/' for compat with the old Xen driver. This documents xen:///system as the preferred format for Xen, leaving xen:/// as an undocumented feature just for back-compat. Signed-off-by: Daniel P. Berrangé --- docs/drvxen.html.in | 14 +++++++------- docs/remote.html.in | 6 +++--- docs/uri.html.in | 16 ++++++++-------- src/libvirt.c | 8 ++++---- src/libxl/libxl_driver.c | 4 ++-- tools/libvirt-guests.sysconf | 2 +- tools/virsh.pod | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in index b8d190c942..2e45e09527 100644 --- a/docs/drvxen.html.in +++ b/docs/drvxen.html.in @@ -43,11 +43,11 @@

-xen:///                        (local access, direct)
-xen+unix:///                   (local access, via daemon)
-xen://example.com/             (remote access, TLS/x509)
-xen+tcp://example.com/         (remote access, SASl/Kerberos)
-xen+ssh://root@example.com/    (remote access, SSH tunnelled)
+xen:///system                     (local access, direct)
+xen+unix:///system                (local access, via daemon)
+xen://example.com/system          (remote access, TLS/x509)
+xen+tcp://example.com/system      (remote access, SASl/Kerberos)
+xen+ssh://root@example.com/system (remote access, SSH tunnelled)
 

Import and export of libvirt domain XML configs

@@ -76,7 +76,7 @@ xen+ssh://root@example.com/ (remote access, SSH tunnelled) which can then be used by libvirt.

-
$ virsh -c xen:/// domxml-from-native xen-xm rhel5.cfg
+    
$ virsh -c xen:///system domxml-from-native xen-xm rhel5.cfg
 <domain type='xen'>
   <name>rhel5pv</name>
   <uuid>8f07fe28-753f-2729-d76d-bdbd892f949a</uuid>
@@ -122,7 +122,7 @@ xen+ssh://root@example.com/    (remote access, SSH tunnelled)
       format.
     

-
$ virsh -c xen:/// domxml-to-native xen-xm rhel5pv.xml
+    
$ virsh -c xen:///system domxml-to-native xen-xm rhel5pv.xml
 name = "rhel5pv"
 uuid = "8f07fe28-753f-2729-d76d-bdbd892f949a"
 maxmem = 2500
diff --git a/docs/remote.html.in b/docs/remote.html.in
index 8c22778f53..de09975039 100644
--- a/docs/remote.html.in
+++ b/docs/remote.html.in
@@ -130,14 +130,14 @@ to distinguish this from a local URI.
 Some examples:
 

    -
  • xen+ssh://rjones@towada/
    — Connect to a +
  • xen+ssh://rjones@towada/system
    — Connect to a remote Xen hypervisor on host towada using ssh transport and ssh username rjones.
  • -
  • xen://towada/
    — Connect to a +
  • xen://towada/system
    — Connect to a remote Xen hypervisor on host towada using TLS.
  • -
  • xen://towada/?no_verify=1
    — Connect to a +
  • xen://towada/system?no_verify=1
    — Connect to a remote Xen hypervisor on host towada using TLS. Do not verify the server's certificate.
  • diff --git a/docs/uri.html.in b/docs/uri.html.in index 5df73613ae..6da9eb9746 100644 --- a/docs/uri.html.in +++ b/docs/uri.html.in @@ -107,7 +107,7 @@ In virt-install use the --connect=URI option: virt-install --connect=test:///default [other options]

- xen:/// URI + xen:///system URI

This section describes a feature which is new in libvirt > @@ -115,7 +115,7 @@ virt-install --connect=test:///default [other options]

To access a Xen hypervisor running on the local machine -use the URI xen:///. +use the URI xen:///system.

qemu:///... QEMU and KVM URIs @@ -167,10 +167,10 @@ a NULL URI for a local connection. For example: - xen:/// + xen:///system - xen://oirase/ + xen://oirase/system Connect to the Xen hypervisor running on host oirase using TLS. @@ -187,10 +187,10 @@ a NULL URI for a local connection. For example: - xen:/// + xen:///system - xen+ssh://oirase/ + xen+ssh://oirase/system Connect to the Xen hypervisor running on host oirase by going over an ssh connection. @@ -251,7 +251,7 @@ In any case applications linked to libvirt can continue to pass user to override the URI, either by constructing one or by allowing the user to type a URI in directly (if that is appropriate). If your application wishes to connect specifically to a Xen hypervisor, then -for future proofing it should choose a full xen:/// URI. +for future proofing it should choose a full xen:///system URI.

Legacy: "xen" @@ -259,7 +259,7 @@ for future proofing it should choose a full xen:/// Another legacy URI is to specify name as the string "xen". This will continue to refer to the Xen -hypervisor. However you should prefer a full xen:/// URI in all future code. +hypervisor. However you should prefer a full xen:///system URI in all future code.

diff --git a/src/libvirt.c b/src/libvirt.c index b7bcf80224..51acbbf83e 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -954,15 +954,15 @@ virConnectOpenInternal(const char *name, goto failed; } - /* Convert xen -> xen:/// for back compat */ + /* Convert xen -> xen:///system for back compat */ if (name && STRCASEEQ(name, "xen")) - name = "xen:///"; + name = "xen:///system"; - /* Convert xen:// -> xen:/// because xmlParseURI cannot parse the + /* Convert xen:// -> xen:///system because xmlParseURI cannot parse the * former. This allows URIs such as xen://localhost to work. */ if (name && STREQ(name, "xen://")) - name = "xen:///"; + name = "xen:///system"; /* * If no URI is passed, then check for an environment string if not diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index de70abaaae..c559bf6514 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -839,7 +839,7 @@ libxlConnectOpen(virConnectPtr conn, if (libxl_driver == NULL) return VIR_DRV_OPEN_DECLINED; - if (!(conn->uri = virURIParse("xen:///"))) + if (!(conn->uri = virURIParse("xen:///system"))) return VIR_DRV_OPEN_ERROR; } else { /* Only xen scheme */ @@ -863,7 +863,7 @@ libxlConnectOpen(virConnectPtr conn, STRNEQ(conn->uri->path, "/") && STRNEQ(conn->uri->path, "/system")) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected Xen URI path '%s', try xen:///"), + _("unexpected Xen URI path '%s', try xen:///system"), NULLSTR(conn->uri->path)); return VIR_DRV_OPEN_ERROR; } diff --git a/tools/libvirt-guests.sysconf b/tools/libvirt-guests.sysconf index 08204ca039..4e11464d2d 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:/// vbox+tcp://host/system lxc:///' +# example: URIS='default xen:///system vbox+tcp://host/system lxc:///' #URIS=default # action taken on host boot diff --git a/tools/virsh.pod b/tools/virsh.pod index 9d69a75244..4d25ac5d9b 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -254,7 +254,7 @@ common are: =over 4 -=item xen:/// +=item xen:///system this is used to connect to the local Xen hypervisor