[Libvirt-cim] [PATCH] (#2) When saving out the infostore, clear any previous data

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Aug 7 00:04:05 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1217613773 25200
# Node ID ca56c48f31038a8dc718e09ef8bf68a8917408fa
# Parent  9f2f9b117797907bfa2b89a499b4eb5bb62cd458
(#2) When saving out the infostore, clear any previous data.

Updates:

  -Replace additional open call with ftruncate()

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 9f2f9b117797 -r ca56c48f3103 libxkutil/infostore.c
--- a/libxkutil/infostore.c	Mon Aug 04 11:57:27 2008 -0700
+++ b/libxkutil/infostore.c	Fri Aug 01 11:02:53 2008 -0700
@@ -150,6 +150,9 @@
         long size = 0;
 
         lseek(ctx->fd, 0, SEEK_SET);
+
+        if (ftruncate(ctx->fd, 0) != 0)
+                CU_DEBUG("Unable to truncate infostore");
 
         save = xmlSaveToFd(ctx->fd, NULL, 0);
         if (save == NULL) {




More information about the Libvirt-cim mailing list