mirror of https://gitee.com/openkylin/libvirt.git
move conversion of NULL & xen URIs into libvirt.c
This commit is contained in:
parent
8e760f1d09
commit
34908a6a1e
|
@ -1,3 +1,10 @@
|
|||
Thu Jul 5 09:47:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* src/libvirt.c, src/xen_unified.c: Move code converting NULL
|
||||
and 'xen' into 'xen://' from the Xen driver into the main libvirt.c
|
||||
entry point. We need this conversion done at the top level, so that
|
||||
the network driver open func gets a valid URI in Xen case
|
||||
|
||||
Thu Jul 5 09:46:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* src/remote_internal.c: Fixed typo in setting flags for network
|
||||
|
|
|
@ -372,6 +372,14 @@ do_open (const char *name, int flags)
|
|||
int i, res;
|
||||
virConnectPtr ret = NULL;
|
||||
|
||||
/* Convert NULL or "" to xen:/// for back compat */
|
||||
if (!name || name[0] == '\0')
|
||||
name = "xen:///";
|
||||
|
||||
/* Convert xen -> xen:/// for back compat */
|
||||
if (!strcasecmp(name, "xen"))
|
||||
name = "xen:///";
|
||||
|
||||
if (!initialized)
|
||||
if (virInitialize() < 0)
|
||||
return NULL;
|
||||
|
|
|
@ -90,14 +90,6 @@ xenUnifiedOpen (virConnectPtr conn, const char *name, int flags)
|
|||
xenUnifiedPrivatePtr priv;
|
||||
xmlURIPtr uri;
|
||||
|
||||
/* Convert NULL or "" to xen:/// for back compat */
|
||||
if (!name || name[0] == '\0')
|
||||
name = "xen:///";
|
||||
|
||||
/* Convert xen -> xen:/// for back compat */
|
||||
if (!strcasecmp(name, "xen"))
|
||||
name = "xen:///";
|
||||
|
||||
uri = xmlParseURI(name);
|
||||
if (uri == NULL) {
|
||||
return VIR_DRV_OPEN_DECLINED;
|
||||
|
|
Loading…
Reference in New Issue