提交 81acc14e 编写于 作者: D Daniel Veillard

fix the detach-disk command when using Xen tap devices

* src/xs_internal.[ch]: patch from Saori Fukuta to fix the
  detach-disk command when using Xen tap devices.
* docs/libvir.html: typo fix from Jim Meyering
Daniel
上级 b47ffc03
Fri Dec 14 16:36:02 CET 2007 Daniel Veillard <veillard@redhat.com>
* src/xs_internal.[ch]: patch from Saori Fukuta to fix the
detach-disk command when using Xen tap devices.
* docs/libvir.html: typo fix from Jim Meyering
Wed Dec 12 16:42:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com> Wed Dec 12 16:42:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
Fix virBufferEscapeString escaping of '<' Fix virBufferEscapeString escaping of '<'
......
...@@ -34,7 +34,7 @@ href="http://kvm.qumranet.com/">KVM</a> and ...@@ -34,7 +34,7 @@ href="http://kvm.qumranet.com/">KVM</a> and
<p>Here is the list of official releases, however since it is early on in the <p>Here is the list of official releases, however since it is early on in the
development of libvirt, it is preferable when possible to just use the <a development of libvirt, it is preferable when possible to just use the <a
href="downloads.html">CVS version or snapshot</a>, contact the mailing list href="downloads.html">CVS version or snapshot</a>, contact the mailing list
and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progresses.</p> and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
<h3>0.3.3: Sep 30 2007</h3> <h3>0.3.3: Sep 30 2007</h3>
......
...@@ -920,23 +920,43 @@ xenStoreDomainGetDiskID(virConnectPtr conn, int id, const char *dev) { ...@@ -920,23 +920,43 @@ xenStoreDomainGetDiskID(virConnectPtr conn, int id, const char *dev) {
snprintf(dir, sizeof(dir), "/local/domain/0/backend/vbd/%d", id); snprintf(dir, sizeof(dir), "/local/domain/0/backend/vbd/%d", id);
list = xs_directory(priv->xshandle, 0, dir, &num); list = xs_directory(priv->xshandle, 0, dir, &num);
if (list == NULL) if (list != NULL) {
return(NULL);
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
snprintf(path, sizeof(path), "%s/%s/%s", dir, list[i], "dev"); snprintf(path, sizeof(path), "%s/%s/%s", dir, list[i], "dev");
val = xs_read(priv->xshandle, 0, path, &len); val = xs_read(priv->xshandle, 0, path, &len);
if (val == NULL) if (val == NULL)
break; break;
if ((devlen != len) || memcmp(val, dev, len)) { if ((devlen != len) || memcmp(val, dev, len)) {
free(val); free (val);
} else { } else {
ret = strdup(list[i]); ret = strdup(list[i]);
free(val); free (val);
free (list);
return (ret);
}
}
free (list);
}
snprintf(dir, sizeof(dir), "/local/domain/0/backend/tap/%d", id);
list = xs_directory(priv->xshandle, 0, dir, &num);
if (list != NULL) {
for (i = 0; i < num; i++) {
snprintf(path, sizeof(path), "%s/%s/%s", dir, list[i], "dev");
val = xs_read(priv->xshandle, 0, path, &len);
if (val == NULL)
break; break;
if ((devlen != len) || memcmp(val, dev, len)) {
free (val);
} else {
ret = strdup(list[i]);
free (val);
free (list);
return (ret);
} }
} }
free(list); free (list);
return(ret); }
return (NULL);
} }
char *xenStoreDomainGetName(virConnectPtr conn, char *xenStoreDomainGetName(virConnectPtr conn,
......
...@@ -53,7 +53,7 @@ char * xenStoreDomainGetNetworkID(virConnectPtr conn, ...@@ -53,7 +53,7 @@ char * xenStoreDomainGetNetworkID(virConnectPtr conn,
const char *mac); const char *mac);
char * xenStoreDomainGetDiskID(virConnectPtr conn, char * xenStoreDomainGetDiskID(virConnectPtr conn,
int id, int id,
const char *mac); const char *dev);
char * xenStoreDomainGetName(virConnectPtr conn, char * xenStoreDomainGetName(virConnectPtr conn,
int id); int id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册