提交 34908a6a 编写于 作者: D Daniel P. Berrange

move conversion of NULL & xen URIs into libvirt.c

上级 8e760f1d
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册