All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@suse.de>
To: xen-devel@lists.xensource.com
Cc: ack@xensource.com
Subject: [patch 6/6] Support transparant gunzipping in the readnotes utility.
Date: Thu, 25 Jan 2007 17:19:22 +0100	[thread overview]
Message-ID: <20070125161927.595846000@suse.de> (raw)
In-Reply-To: 20070125161916.736076000@suse.de

[-- Attachment #1: tools-readnotes-gunzip.diff --]
[-- Type: text/plain, Size: 1151 bytes --]

Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
---
 tools/xcutils/readnotes.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Index: build-32-unstable-12621/tools/xcutils/readnotes.c
===================================================================
--- build-32-unstable-12621.orig/tools/xcutils/readnotes.c
+++ build-32-unstable-12621/tools/xcutils/readnotes.c
@@ -11,6 +11,7 @@
 #include <sys/mman.h>
 
 #include <xg_private.h>
+#include <xc_dom.h> /* gunzip bits */
 
 #include <xen/libelf.h>
 
@@ -33,8 +34,8 @@ static void print_numeric_note(const cha
 int main(int argc, char **argv)
 {
 	const char *f;
-	int fd,h,size,count;
-	void *image;
+	int fd,h,size,usize,count;
+	void *image,*tmp;
 	struct stat st;
 	struct elf_binary elf;
 	const elf_shdr *shdr;
@@ -68,6 +69,15 @@ int main(int argc, char **argv)
 	}
 	size = st.st_size;
 
+	usize = xc_dom_check_gzip(image, st.st_size);
+	if (usize)
+	{
+		tmp = malloc(size);
+		xc_dom_do_gunzip(image, st.st_size, tmp, size);
+		image = tmp;
+		size = usize;
+	}
+
 	if (0 != elf_init(&elf, image, size))
 	{
 		fprintf(stderr, "File %s is not an ELF image\n", f);

-- 

  parent reply	other threads:[~2007-01-25 16:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-25 16:19 [patch 0/6] domain builder patches Gerd Hoffmann
2007-01-25 16:19 ` [patch 1/6] Generate headers with arch-specific structs Gerd Hoffmann
2007-01-25 16:19 ` [patch 2/6] Add more xc_error_code values Gerd Hoffmann
2007-01-25 16:19 ` [patch 3/6] libxc header fixups Gerd Hoffmann
2007-01-25 16:19 ` [patch 4/6] libxc domain builder rewrite, core bits Gerd Hoffmann
2007-01-25 16:19 ` [patch 5/6] libxc domain builder rewrite, linux builder Gerd Hoffmann
2007-01-25 16:19 ` Gerd Hoffmann [this message]
2007-02-13 14:54 ` [patch 0/6] domain builder patches Dietmar Hahn
2007-03-08 21:11 ` Hollis Blanchard
2007-03-13 10:04   ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070125161927.595846000@suse.de \
    --to=kraxel@suse.de \
    --cc=ack@xensource.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.