[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 1/4] xen: Make xenDaemon*DeviceFlags errors less confusing

On 10/01/2010 02:09 PM, Jiri Denemark wrote:
When a user calls to virDomain{Attach,Detach,Update}DeviceFlags() with
flags == VIR_DOMAIN_DEVICE_MODIFY_LIVE on an inactive guest running on
an old Xen hypervisor (such as RHEL-5) xend_internal driver reports:

     Xend version does not support modifying persistent config

which is pretty confusing since no-one requested to modify persistent

Hmm - given the recent discussion on vcpus (which is probably what made you look at this, right?)...

  src/xen/xend_internal.c |   36 ++++++++++++++++++------------------
  1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index fce0233..1318bd4 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -3878,6 +3878,12 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
      priv = (xenUnifiedPrivatePtr) domain->conn->privateData;

      if (domain->id<  0) {
+        /* Cannot modify live config if domain is inactive */
+        if (flags&  VIR_DOMAIN_DEVICE_MODIFY_LIVE) {
+            virXendError(VIR_ERR_OPERATION_INVALID, "%s",
+                         _("Cannot modify live config if domain is inactive"));
+            return -1;
+        }

Should we always error out if _LIVE and inactive, or should we special-case _CONFIG|_LIVE by silently ignoring the _LIVE flag on inactive domains?

Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]