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

Re: [libvirt] [PATCH] blkdeviotune: trigger tunable event for blkdeviotune updates



On 09/25/2014 11:10 AM, Jiri Denemark wrote:
On Thu, Sep 25, 2014 at 11:07:08 +0200, Jiri Denemark wrote:
On Wed, Sep 24, 2014 at 10:24:03 +0200, Pavel Hrdina wrote:
With the blkdeviotune event this patch also fixes a bug that the updated
live values weren't saved to the live XML so they won't survive
restarting the libvirtd.

Hmm, could you fix the bug in a separate patch (just in case it needs to
be backported somewhere)?

Signed-off-by: Pavel Hrdina <phrdina redhat com>
---
  include/libvirt/libvirt.h.in | 56 ++++++++++++++++++++++++++++++++++++++++++++
  src/qemu/qemu_driver.c       | 54 ++++++++++++++++++++++++++++++++++++++++++
  2 files changed, 110 insertions(+)

...
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d1a0657..173333a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
...
@@ -16405,6 +16443,20 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
          if (ret < 0)
              goto endjob;
          vm->def->disks[idx]->blkdeviotune = info;
+
+        ret = virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm);
+        if (ret < 0) {
+            virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                           _("Saving live XML config failed"));
+            goto endjob;
+        }
+
+        if (eventNparams) {
+            event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
+            eventNparams = 0;
+            if (event)
+                qemuDomainEventQueue(driver, event);

eventNparams = 0 should only be done if event != NULL

And I'm blind, virDomainEventTunableNewFromDom is explicitly written to
free parameters even in case of failure. So no change needed here :-)

Jirka


Thanks, I'll split the bug-fix into separate patch and push it.

Pavel


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