WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libblktap: Remove trailing null byte in xs_printf

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libblktap: Remove trailing null byte in xs_printf
From: Kevin Wolf <kwolf@xxxxxxx>
Date: Thu, 02 Oct 2008 13:51:19 +0200
Delivery-date: Thu, 02 Oct 2008 04:50:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.12 (X11/20071114)
xs_printf writes the terminating null byte of the passed string to
Xenstore. When reading, the null byte is returned in the following form
which confuses tools:

sector-size = "512\000"

This patch removes the null byte from the data to write.

Signed-off-by: Kevin Wolf <kwolf@xxxxxxx>
Index: xen-unstable.hg/tools/blktap/lib/xs_api.c
===================================================================
--- xen-unstable.hg.orig/tools/blktap/lib/xs_api.c
+++ xen-unstable.hg/tools/blktap/lib/xs_api.c
@@ -132,7 +132,7 @@ int xs_printf(struct xs_handle *h, const
                return ENOMEM;
        }
 
-       ret = xs_write(h, XBT_NULL, path, buf, strlen(buf)+1);
+       ret = xs_write(h, XBT_NULL, path, buf, strlen(buf));
        
        free(buf);
        free(path);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] libblktap: Remove trailing null byte in xs_printf, Kevin Wolf <=