All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@suse.de>
To: xen-devel@lists.xensource.com
Subject: [patch 10/10] Support transparant gunzipping in the readnotes utility.
Date: Mon, 04 Dec 2006 11:58:34 +0100	[thread overview]
Message-ID: <20061204105849.712624000@suse.de> (raw)
In-Reply-To: 20061204105824.942096000@suse.de

[-- Attachment #1: tools-readnotes-gunzip.diff --]
[-- Type: text/plain, Size: 1150 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:[~2006-12-04 10:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04 10:58 [patch 00/10] libelf and the new domain builder Gerd Hoffmann
2006-12-04 10:58 ` [patch 01/10] Generate headers with arch-specific structs Gerd Hoffmann
2006-12-04 16:28   ` Hollis Blanchard
2006-12-04 17:04     ` Gerd Hoffmann
2006-12-04 20:12       ` Hollis Blanchard
2006-12-05  8:45         ` Gerd Hoffmann
2006-12-05 13:52           ` Hollis Blanchard
2006-12-04 10:58 ` [patch 02/10] add libelf: an ELF binary parser library Gerd Hoffmann
2006-12-04 10:58 ` [patch 03/10] libelf: use for x86 dom0 builder Gerd Hoffmann
2006-12-04 10:58 ` [patch 04/10] libelf: add to libxc Gerd Hoffmann
2006-12-04 10:58 ` [patch 05/10] libelf: use for hvm builder Gerd Hoffmann
2006-12-04 10:58 ` [patch 06/10] libelf: use for readnotes utility Gerd Hoffmann
2006-12-04 10:58 ` [patch 07/10] libxc header fixups Gerd Hoffmann
2006-12-04 10:58 ` [patch 08/10] libxc domain builder rewrite, core bits Gerd Hoffmann
2006-12-04 10:58 ` [patch 09/10] libxc domain builder rewrite, linux builder Gerd Hoffmann
2006-12-04 10:58 ` Gerd Hoffmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-12-01 15:02 [patch 00/10] libelf and the new domain builder Gerd Hoffmann
2006-12-01 15:02 ` [patch 10/10] Support transparant gunzipping in the readnotes utility 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=20061204105849.712624000@suse.de \
    --to=kraxel@suse.de \
    --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.