2009-12-29 18:35:03 +01:00
|
|
|
Index: libvirt-0.7.5/src/xen/xend_internal.c
|
2008-11-21 15:32:50 +01:00
|
|
|
===================================================================
|
2009-12-29 18:35:03 +01:00
|
|
|
--- libvirt-0.7.5.orig/src/xen/xend_internal.c
|
|
|
|
+++ libvirt-0.7.5/src/xen/xend_internal.c
|
|
|
|
@@ -4123,13 +4123,12 @@ xenDaemonAttachDevice(virDomainPtr domai
|
2009-12-11 16:19:30 +01:00
|
|
|
|
|
|
|
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
|
|
|
|
|
|
|
|
- /*
|
|
|
|
- * on older Xen without the inactive guests management
|
|
|
|
- * avoid doing this on inactive guests
|
|
|
|
- */
|
|
|
|
- if ((domain->id < 0) && (priv->xendConfigVersion < 3))
|
|
|
|
+ if (domain->id < 0) {
|
|
|
|
+ virXendError(domain->conn, VIR_ERR_OPERATION_INVALID,
|
|
|
|
+ "%s", _("cannot attach device on inactive domain"));
|
|
|
|
return -1;
|
|
|
|
-
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (!(def = xenDaemonDomainFetch(domain->conn,
|
|
|
|
domain->id,
|
|
|
|
domain->name,
|
2009-12-29 18:35:03 +01:00
|
|
|
@@ -4229,12 +4228,11 @@ xenDaemonDetachDevice(virDomainPtr domai
|
2009-12-11 16:19:28 +01:00
|
|
|
|
2009-12-11 16:19:30 +01:00
|
|
|
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
|
|
|
|
|
|
|
|
- /*
|
|
|
|
- * on older Xen without the inactive guests management
|
|
|
|
- * avoid doing this on inactive guests
|
|
|
|
- */
|
|
|
|
- if ((domain->id < 0) && (priv->xendConfigVersion < 3))
|
|
|
|
+ if (domain->id < 0) {
|
|
|
|
+ virXendError(domain->conn, VIR_ERR_OPERATION_INVALID,
|
|
|
|
+ "%s", _("cannot detach device on inactive domain"));
|
|
|
|
return -1;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (!(def = xenDaemonDomainFetch(domain->conn,
|
|
|
|
domain->id,
|
2009-12-29 18:35:03 +01:00
|
|
|
Index: libvirt-0.7.5/src/libvirt.c
|
2009-12-11 16:19:28 +01:00
|
|
|
===================================================================
|
2009-12-29 18:35:03 +01:00
|
|
|
--- libvirt-0.7.5.orig/src/libvirt.c
|
|
|
|
+++ libvirt-0.7.5/src/libvirt.c
|
|
|
|
@@ -5066,7 +5066,8 @@ error:
|
2009-12-11 16:19:30 +01:00
|
|
|
* @domain: pointer to domain object
|
|
|
|
* @xml: pointer to XML description of one device
|
|
|
|
*
|
|
|
|
- * Create a virtual device attachment to backend.
|
|
|
|
+ * Create a virtual device attachment to backend. This function, having
|
|
|
|
+ * hotplug semantics, is only allowed on an active domain.
|
|
|
|
*
|
|
|
|
* Returns 0 in case of success, -1 in case of failure.
|
|
|
|
*/
|
2009-12-29 18:35:03 +01:00
|
|
|
@@ -5109,7 +5110,8 @@ error:
|
2009-12-11 16:19:30 +01:00
|
|
|
* @domain: pointer to domain object
|
|
|
|
* @xml: pointer to XML description of one device
|
|
|
|
*
|
|
|
|
- * Destroy a virtual device attachment to backend.
|
|
|
|
+ * Destroy a virtual device attachment to backend. This function, having
|
|
|
|
+ * hot-unplug semantics, is only allowed on an active domain.
|
|
|
|
*
|
|
|
|
* Returns 0 in case of success, -1 in case of failure.
|
|
|
|
*/
|