[libvirt PATCH v2 21/24] qemu: rename virFirmware*Free() functions to have more accurate names

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

 



Several functions had the names virFirmware[something]Free(), but they
aren't taking a pointer to some object and freeing it. Instead, they
are making a copy of the content of an entire object, then Freeing the
objects pointed to by that content.

As a first step in a too-complicated cleanup just to eliminate a few
occurrences of VIR_FREE(), this patch renames those functions to more
accurately reflect what they do - they Free the *Content* of their
arguments.

Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/qemu/qemu_firmware.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index fe30db4f79..c22b1f1e9c 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -188,7 +188,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareOSInterface, qemuFirmwareOSInterfaceFr
 
 
 static void
-qemuFirmwareFlashFileFree(qemuFirmwareFlashFile flash)
+qemuFirmwareFlashFileFreeContent(qemuFirmwareFlashFile flash)
 {
     VIR_FREE(flash.filename);
     VIR_FREE(flash.format);
@@ -196,39 +196,39 @@ qemuFirmwareFlashFileFree(qemuFirmwareFlashFile flash)
 
 
 static void
-qemuFirmwareMappingFlashFree(qemuFirmwareMappingFlash flash)
+qemuFirmwareMappingFlashFreeContent(qemuFirmwareMappingFlash flash)
 {
-    qemuFirmwareFlashFileFree(flash.executable);
-    qemuFirmwareFlashFileFree(flash.nvram_template);
+    qemuFirmwareFlashFileFreeContent(flash.executable);
+    qemuFirmwareFlashFileFreeContent(flash.nvram_template);
 }
 
 
 static void
-qemuFirmwareMappingKernelFree(qemuFirmwareMappingKernel kernel)
+qemuFirmwareMappingKernelFreeContent(qemuFirmwareMappingKernel kernel)
 {
     VIR_FREE(kernel.filename);
 }
 
 
 static void
-qemuFirmwareMappingMemoryFree(qemuFirmwareMappingMemory memory)
+qemuFirmwareMappingMemoryFreeContent(qemuFirmwareMappingMemory memory)
 {
     VIR_FREE(memory.filename);
 }
 
 
 static void
-qemuFirmwareMappingFree(qemuFirmwareMapping mapping)
+qemuFirmwareMappingFreeContent(qemuFirmwareMapping mapping)
 {
     switch (mapping.device) {
     case QEMU_FIRMWARE_DEVICE_FLASH:
-        qemuFirmwareMappingFlashFree(mapping.data.flash);
+        qemuFirmwareMappingFlashFreeContent(mapping.data.flash);
         break;
     case QEMU_FIRMWARE_DEVICE_KERNEL:
-        qemuFirmwareMappingKernelFree(mapping.data.kernel);
+        qemuFirmwareMappingKernelFreeContent(mapping.data.kernel);
         break;
     case QEMU_FIRMWARE_DEVICE_MEMORY:
-        qemuFirmwareMappingMemoryFree(mapping.data.memory);
+        qemuFirmwareMappingMemoryFreeContent(mapping.data.memory);
         break;
     case QEMU_FIRMWARE_DEVICE_NONE:
     case QEMU_FIRMWARE_DEVICE_LAST:
@@ -271,7 +271,7 @@ qemuFirmwareFree(qemuFirmwarePtr fw)
         return;
 
     qemuFirmwareOSInterfaceFree(fw->interfaces);
-    qemuFirmwareMappingFree(fw->mapping);
+    qemuFirmwareMappingFreeContent(fw->mapping);
     for (i = 0; i < fw->ntargets; i++)
         qemuFirmwareTargetFree(fw->targets[i]);
     g_free(fw->targets);
-- 
2.29.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux