From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: [patch 10/10] Support transparant gunzipping in the readnotes utility. Date: Mon, 04 Dec 2006 11:58:34 +0100 Message-ID: <20061204105849.712624000@suse.de> References: <20061204105824.942096000@suse.de> Return-path: Content-Disposition: inline; filename=tools-readnotes-gunzip.diff List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Signed-off-by: Gerd Hoffmann --- 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 #include +#include /* gunzip bits */ #include @@ -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); --