[libvirt] [PATCH 1/2] libvirt/qemu - support updating inactive domains (take 2)

KAMEZAWA Hiroyuki kamezawa.hiroyu at jp.fujitsu.com
Thu Feb 24 10:04:54 UTC 2011


On Thu, 24 Feb 2011 16:43:25 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu at jp.fujitsu.com> wrote:

> On Thu, 24 Feb 2011 15:29:46 +0800
> Hu Tao <hutao at cn.fujitsu.com> wrote:
e set at the same time.
> 
> I'll add a test of VIR_DOMAIN_DEVICE_MODIFY_LIVE for now. But I'll remove it later.
> What we want to know here is the caller wants persistent change or not.
> 
> I think I'll update this function to allow modification of active domain
> in future.
> 

I'll add this logic in the next post.
Thanks,
-Kame
==
+    /*
+     * When both of MODIFY_CONFIG and MODIFY_LIVE is specified at the same time,
+     * return error for now. We should support this later.
+     */
+    if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) {
+        qemuReportError(VIR_ERR_INVALID_ARG, "%s",
+                        _("Now, cannot modify alive domain and its definition "
+                          "at the same time."));
         return -1;
     }
.......

+static int qemudDomainAttachDeviceFlags(virDomainPtr dom,
+                                        const char *xml,
+                                        unsigned int flags)
+{
+    if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG)
+        return qemuDomainModifyDevicePersistent(dom, xml, 1, flags);
+
+    if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE)
+        return qemudDomainAttachDevice(dom, xml);
+
+    qemuReportError(VIR_ERR_INVALID_ARG,
+        _("bad flag: %x only MODIFY_LIVE, MODIFY_CONFIG are supported now"),
+       flags);
+




More information about the libvir-list mailing list