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

[libvirt] [PATCH] Small fixes for qemu save compression.



Fix up a small memory leak pointed out by DanB; I was forgetting
to release memory allocated to driver->saveImageFormat.
Also add the "save_image_format" and "security" entries to
the augeas lens.

Signed-off-by: Chris Lalancette <clalance redhat com>
---
 qemud/libvirtd_qemu.aug      |    2 ++
 qemud/test_libvirtd_qemu.aug |   10 +++++++++-
 src/qemu_driver.c            |    1 +
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/qemud/libvirtd_qemu.aug b/qemud/libvirtd_qemu.aug
index 8b8aab2..2175e14 100644
--- a/qemud/libvirtd_qemu.aug
+++ b/qemud/libvirtd_qemu.aug
@@ -29,10 +29,12 @@ module Libvirtd_qemu =
                  | str_entry "vnc_password"
                  | bool_entry "vnc_sasl"
                  | str_entry "vnc_sasl_dir"
+                 | str_entry "security_driver"
                  | str_entry "user"
                  | str_entry "group"
                  | str_array_entry "cgroup_controllers"
                  | str_array_entry "cgroup_device_acl"
+                 | str_entry "save_image_format"
 
    (* Each enty in the config is one of the following three ... *)
    let entry = vnc_entry
diff --git a/qemud/test_libvirtd_qemu.aug b/qemud/test_libvirtd_qemu.aug
index 274c89d..72f2227 100644
--- a/qemud/test_libvirtd_qemu.aug
+++ b/qemud/test_libvirtd_qemu.aug
@@ -80,6 +80,8 @@ vnc_sasl = 1
 #
 vnc_sasl_dir = \"/some/directory/sasl2\"
 
+security_driver = \"selinux\"
+
 user = \"root\"
 
 group = \"root\"
@@ -87,6 +89,8 @@ group = \"root\"
 cgroup_controllers = [ \"cpu\", \"devices\" ]
 
 cgroup_device_acl = [ \"/dev/null\", \"/dev/full\", \"/dev/zero\" ]
+
+save_image_format = \"gzip\"
 "
 
    test Libvirtd_qemu.lns get conf =
@@ -170,7 +174,9 @@ cgroup_device_acl = [ \"/dev/null\", \"/dev/full\", \"/dev/zero\" ]
 { "#comment" = "" }
 { "vnc_sasl_dir" = "/some/directory/sasl2" }
 { "#empty" }
-{ "user"= "root" }
+{ "security_driver" = "selinux" }
+{ "#empty" }
+{ "user" = "root" }
 { "#empty" }
 { "group" = "root" }
 { "#empty" }
@@ -184,3 +190,5 @@ cgroup_device_acl = [ \"/dev/null\", \"/dev/full\", \"/dev/zero\" ]
     { "2" = "/dev/full" }
     { "3" = "/dev/zero" }
 }
+{ "#empty" }
+{ "save_image_format" = "gzip" }
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 86a33f8..ffe9c16 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -666,6 +666,7 @@ qemudShutdown(void)
     VIR_FREE(qemu_driver->vncListen);
     VIR_FREE(qemu_driver->vncPassword);
     VIR_FREE(qemu_driver->vncSASLdir);
+    VIR_FREE(qemu_driver->saveImageFormat);
 
     /* Free domain callback list */
     virDomainEventCallbackListFree(qemu_driver->domainEventCallbacks);
-- 
1.6.0.6


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