When a user runs 'virsh detach-disk' on a running domain, the disk is
removed, but reappears after the domain is rebooted. This seems odd, as
someone who types detach-disk most likely wants the change to be permanent.
This patch updates the code in xenDaemonDetachDevice() to pass the
rm_cfg flag to Xen, so that the change is committed to the domain's
configuration file.
This change depends on a xen patch that was committed to unstable on
March 20:
http://lists.xensource.com/archives/html/xen-changelog/2008-03/msg00122.html
-Ryan
diff --git a/src/xend_internal.c b/src/xend_internal.c
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -3347,7 +3347,7 @@ xenDaemonDetachDevice(virDomainPtr domai
if (virDomainXMLDevID(domain, xml, class, ref, sizeof(ref)))
return (-1);
return(xend_op(domain->conn, domain->name, "op",
"device_destroy",
- "type", class, "dev", ref, NULL));
+ "type", class, "dev", ref, "force", "0",
"rm_cfg", "1", NULL));
}