Accepting request 337299 from home:a_faerber:branches:Virtualization
Fix endianness issues in DictZip block driver (bsc#937572, bsc#945778) OBS-URL: https://build.opensuse.org/request/show/337299 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=273
This commit is contained in:
parent
222fb42c22
commit
8692514bef
@ -1,4 +1,4 @@
|
|||||||
From 22e3f94ab2885d9618711a9eac9d751fb2543028 Mon Sep 17 00:00:00 2001
|
From 3058cb28a3852a02ef20cb5fa6e17f89880bd2cb Mon Sep 17 00:00:00 2001
|
||||||
From: Alexander Graf <agraf@suse.de>
|
From: Alexander Graf <agraf@suse.de>
|
||||||
Date: Wed, 5 Aug 2009 09:49:37 +0200
|
Date: Wed, 5 Aug 2009 09:49:37 +0200
|
||||||
Subject: [PATCH] block: Add support for DictZip enabled gzip files
|
Subject: [PATCH] block: Add support for DictZip enabled gzip files
|
||||||
@ -33,31 +33,32 @@ Signed-off-by: Tim Hardeck <thardeck@suse.de>
|
|||||||
BlockDriverCompletionFunc -> BlockCompletionFunc,
|
BlockDriverCompletionFunc -> BlockCompletionFunc,
|
||||||
qemu_aio_release() -> qemu_aio_unref(),
|
qemu_aio_release() -> qemu_aio_unref(),
|
||||||
drop dictzip_aio_cancel()]
|
drop dictzip_aio_cancel()]
|
||||||
|
[AF: common-obj-y -> block-obj-y, drop probe hook (bsc#945778)]
|
||||||
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
||||||
---
|
---
|
||||||
block/Makefile.objs | 1 +
|
block/Makefile.objs | 1 +
|
||||||
block/dictzip.c | 591 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
block/dictzip.c | 578 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
2 files changed, 592 insertions(+)
|
2 files changed, 579 insertions(+)
|
||||||
create mode 100644 block/dictzip.c
|
create mode 100644 block/dictzip.c
|
||||||
|
|
||||||
diff --git a/block/Makefile.objs b/block/Makefile.objs
|
diff --git a/block/Makefile.objs b/block/Makefile.objs
|
||||||
index 58ef2ef..246f167 100644
|
index 58ef2ef..c7b9294 100644
|
||||||
--- a/block/Makefile.objs
|
--- a/block/Makefile.objs
|
||||||
+++ b/block/Makefile.objs
|
+++ b/block/Makefile.objs
|
||||||
@@ -26,6 +26,7 @@ block-obj-y += write-threshold.o
|
@@ -20,6 +20,7 @@ block-obj-$(CONFIG_RBD) += rbd.o
|
||||||
common-obj-y += stream.o
|
block-obj-$(CONFIG_GLUSTERFS) += gluster.o
|
||||||
common-obj-y += commit.o
|
block-obj-$(CONFIG_ARCHIPELAGO) += archipelago.o
|
||||||
common-obj-y += backup.o
|
block-obj-$(CONFIG_LIBSSH2) += ssh.o
|
||||||
+common-obj-y += dictzip.o
|
+block-obj-y += dictzip.o
|
||||||
|
block-obj-y += accounting.o
|
||||||
|
block-obj-y += write-threshold.o
|
||||||
|
|
||||||
iscsi.o-cflags := $(LIBISCSI_CFLAGS)
|
|
||||||
iscsi.o-libs := $(LIBISCSI_LIBS)
|
|
||||||
diff --git a/block/dictzip.c b/block/dictzip.c
|
diff --git a/block/dictzip.c b/block/dictzip.c
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..8e6855a
|
index 0000000..1824971
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/block/dictzip.c
|
+++ b/block/dictzip.c
|
||||||
@@ -0,0 +1,591 @@
|
@@ -0,0 +1,578 @@
|
||||||
+/*
|
+/*
|
||||||
+ * DictZip Block driver for dictzip enabled gzip files
|
+ * DictZip Block driver for dictzip enabled gzip files
|
||||||
+ *
|
+ *
|
||||||
@ -179,18 +180,6 @@ index 0000000..8e6855a
|
|||||||
+ int64_t file_len;
|
+ int64_t file_len;
|
||||||
+} BDRVDictZipState;
|
+} BDRVDictZipState;
|
||||||
+
|
+
|
||||||
+static int dictzip_probe(const uint8_t *buf, int buf_size, const char *filename)
|
|
||||||
+{
|
|
||||||
+ if (buf_size < 2)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ /* We match on every gzip file */
|
|
||||||
+ if ((buf[0] == GZ_MAGIC1) && (buf[1] == GZ_MAGIC2))
|
|
||||||
+ return 100;
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int start_zStream(z_stream *zStream)
|
+static int start_zStream(z_stream *zStream)
|
||||||
+{
|
+{
|
||||||
+ zStream->zalloc = NULL;
|
+ zStream->zalloc = NULL;
|
||||||
@ -638,7 +627,6 @@ index 0000000..8e6855a
|
|||||||
+ .bdrv_file_open = dictzip_open,
|
+ .bdrv_file_open = dictzip_open,
|
||||||
+ .bdrv_close = dictzip_close,
|
+ .bdrv_close = dictzip_close,
|
||||||
+ .bdrv_getlength = dictzip_getlength,
|
+ .bdrv_getlength = dictzip_getlength,
|
||||||
+ .bdrv_probe = dictzip_probe,
|
|
||||||
+
|
+
|
||||||
+ .bdrv_aio_readv = dictzip_aio_readv,
|
+ .bdrv_aio_readv = dictzip_aio_readv,
|
||||||
+};
|
+};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From be6c4a9c1ee466c5b6d6f0e7e78eab322f722232 Mon Sep 17 00:00:00 2001
|
From 6492e67a4633bac8d339a8dd171a4560d9b0db6d Mon Sep 17 00:00:00 2001
|
||||||
From: Alexander Graf <agraf@suse.de>
|
From: Alexander Graf <agraf@suse.de>
|
||||||
Date: Wed, 5 Aug 2009 17:28:38 +0200
|
Date: Wed, 5 Aug 2009 17:28:38 +0200
|
||||||
Subject: [PATCH] block: Add tar container format
|
Subject: [PATCH] block: Add tar container format
|
||||||
@ -34,31 +34,32 @@ Signed-off-by: Tim Hardeck <thardeck@suse.de>
|
|||||||
BlockDriverCompletionFunc -> BlockCompletionFunc,
|
BlockDriverCompletionFunc -> BlockCompletionFunc,
|
||||||
qemu_aio_release() -> qemu_aio_unref(),
|
qemu_aio_release() -> qemu_aio_unref(),
|
||||||
drop tar_aio_cancel()]
|
drop tar_aio_cancel()]
|
||||||
|
[AF: common-obj-y -> block-obj-y, drop probe hook (bsc#945778)]
|
||||||
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
||||||
---
|
---
|
||||||
block/Makefile.objs | 1 +
|
block/Makefile.objs | 1 +
|
||||||
block/tar.c | 381 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
block/tar.c | 368 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
2 files changed, 382 insertions(+)
|
2 files changed, 369 insertions(+)
|
||||||
create mode 100644 block/tar.c
|
create mode 100644 block/tar.c
|
||||||
|
|
||||||
diff --git a/block/Makefile.objs b/block/Makefile.objs
|
diff --git a/block/Makefile.objs b/block/Makefile.objs
|
||||||
index 246f167..a757960 100644
|
index c7b9294..0a4b697 100644
|
||||||
--- a/block/Makefile.objs
|
--- a/block/Makefile.objs
|
||||||
+++ b/block/Makefile.objs
|
+++ b/block/Makefile.objs
|
||||||
@@ -27,6 +27,7 @@ common-obj-y += stream.o
|
@@ -21,6 +21,7 @@ block-obj-$(CONFIG_GLUSTERFS) += gluster.o
|
||||||
common-obj-y += commit.o
|
block-obj-$(CONFIG_ARCHIPELAGO) += archipelago.o
|
||||||
common-obj-y += backup.o
|
block-obj-$(CONFIG_LIBSSH2) += ssh.o
|
||||||
common-obj-y += dictzip.o
|
block-obj-y += dictzip.o
|
||||||
+common-obj-y += tar.o
|
+block-obj-y += tar.o
|
||||||
|
block-obj-y += accounting.o
|
||||||
|
block-obj-y += write-threshold.o
|
||||||
|
|
||||||
iscsi.o-cflags := $(LIBISCSI_CFLAGS)
|
|
||||||
iscsi.o-libs := $(LIBISCSI_LIBS)
|
|
||||||
diff --git a/block/tar.c b/block/tar.c
|
diff --git a/block/tar.c b/block/tar.c
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..d8218a3
|
index 0000000..e612db3
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/block/tar.c
|
+++ b/block/tar.c
|
||||||
@@ -0,0 +1,381 @@
|
@@ -0,0 +1,368 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Tar block driver
|
+ * Tar block driver
|
||||||
+ *
|
+ *
|
||||||
@ -121,18 +122,6 @@ index 0000000..d8218a3
|
|||||||
+ char longfile[2048];
|
+ char longfile[2048];
|
||||||
+} BDRVTarState;
|
+} BDRVTarState;
|
||||||
+
|
+
|
||||||
+static int tar_probe(const uint8_t *buf, int buf_size, const char *filename)
|
|
||||||
+{
|
|
||||||
+ if (buf_size < OFFS_MAGIC + 5)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ /* we only support newer tar */
|
|
||||||
+ if (!strncmp((char*)buf + OFFS_MAGIC, POSIX_TAR_MAGIC, 5))
|
|
||||||
+ return 100;
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int str_ends(char *str, const char *end)
|
+static int str_ends(char *str, const char *end)
|
||||||
+{
|
+{
|
||||||
+ int end_len = strlen(end);
|
+ int end_len = strlen(end);
|
||||||
@ -429,7 +418,6 @@ index 0000000..d8218a3
|
|||||||
+ .bdrv_file_open = tar_open,
|
+ .bdrv_file_open = tar_open,
|
||||||
+ .bdrv_close = tar_close,
|
+ .bdrv_close = tar_close,
|
||||||
+ .bdrv_getlength = tar_getlength,
|
+ .bdrv_getlength = tar_getlength,
|
||||||
+ .bdrv_probe = tar_probe,
|
|
||||||
+
|
+
|
||||||
+ .bdrv_aio_readv = tar_aio_readv,
|
+ .bdrv_aio_readv = tar_aio_readv,
|
||||||
+};
|
+};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 1d5befaff3c2b4dfdc3b23589f2f92f2d288dcf1 Mon Sep 17 00:00:00 2001
|
From d893ae81b781a53bac6ee988bed2f32453dec3a7 Mon Sep 17 00:00:00 2001
|
||||||
From: Alexander Graf <agraf@suse.de>
|
From: Alexander Graf <agraf@suse.de>
|
||||||
Date: Wed, 12 Dec 2012 19:11:30 +0100
|
Date: Wed, 12 Dec 2012 19:11:30 +0100
|
||||||
Subject: [PATCH] Legacy Patch kvm-qemu-preXX-dictzip3.patch
|
Subject: [PATCH] Legacy Patch kvm-qemu-preXX-dictzip3.patch
|
||||||
@ -8,10 +8,10 @@ Subject: [PATCH] Legacy Patch kvm-qemu-preXX-dictzip3.patch
|
|||||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/block/tar.c b/block/tar.c
|
diff --git a/block/tar.c b/block/tar.c
|
||||||
index d8218a3..522ddd3 100644
|
index e612db3..654fcf7 100644
|
||||||
--- a/block/tar.c
|
--- a/block/tar.c
|
||||||
+++ b/block/tar.c
|
+++ b/block/tar.c
|
||||||
@@ -83,7 +83,8 @@ static int str_ends(char *str, const char *end)
|
@@ -71,7 +71,8 @@ static int str_ends(char *str, const char *end)
|
||||||
return !strncmp(str + str_len - end_len, end, end_len);
|
return !strncmp(str + str_len - end_len, end, end_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ index d8218a3..522ddd3 100644
|
|||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
@@ -99,10 +100,17 @@ static int is_target_file(BlockDriverState *bs, char *filename)
|
@@ -87,10 +88,17 @@ static int is_target_file(BlockDriverState *bs, char *filename)
|
||||||
if (str_ends(filename, ".vmdk"))
|
if (str_ends(filename, ".vmdk"))
|
||||||
retval = 1;
|
retval = 1;
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ index d8218a3..522ddd3 100644
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,12 +237,13 @@ static int tar_open(BlockDriverState *bs, QDict *options, int flags, Error **err
|
@@ -217,12 +225,13 @@ static int tar_open(BlockDriverState *bs, QDict *options, int flags, Error **err
|
||||||
bdrv_pread(s->hd, header_offs - s->file_len, s->longfile,
|
bdrv_pread(s->hd, header_offs - s->file_len, s->longfile,
|
||||||
sizeof(s->longfile));
|
sizeof(s->longfile));
|
||||||
s->longfile[sizeof(s->longfile)-1] = '\0';
|
s->longfile[sizeof(s->longfile)-1] = '\0';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 602e012b10d06c4d25212a452d3066f087350289 Mon Sep 17 00:00:00 2001
|
From 9ff792a6d58e3966c94dc22167d956df1756aa14 Mon Sep 17 00:00:00 2001
|
||||||
From: Alexander Graf <agraf@suse.de>
|
From: Alexander Graf <agraf@suse.de>
|
||||||
Date: Mon, 6 Jun 2011 06:53:52 +0200
|
Date: Mon, 6 Jun 2011 06:53:52 +0200
|
||||||
Subject: [PATCH] console: add question-mark escape operator
|
Subject: [PATCH] console: add question-mark escape operator
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 8035717a00918d5c84c7c1fa326c6409431ece9e Mon Sep 17 00:00:00 2001
|
From 3de38631531f91c85e910e961978a77bd1ef842f Mon Sep 17 00:00:00 2001
|
||||||
From: Alexander Graf <agraf@suse.de>
|
From: Alexander Graf <agraf@suse.de>
|
||||||
Date: Thu, 1 Apr 2010 17:36:23 +0200
|
Date: Thu, 1 Apr 2010 17:36:23 +0200
|
||||||
Subject: [PATCH] Make char muxer more robust wrt small FIFOs
|
Subject: [PATCH] Make char muxer more robust wrt small FIFOs
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From fee765c70a2e52b093a529fc78c7d2838c95fab5 Mon Sep 17 00:00:00 2001
|
From c42944366a1ce036e7baab2ee14b71e2d38754d1 Mon Sep 17 00:00:00 2001
|
||||||
From: Alexander Graf <agraf@suse.de>
|
From: Alexander Graf <agraf@suse.de>
|
||||||
Date: Thu, 13 Dec 2012 14:29:22 +0100
|
Date: Thu, 13 Dec 2012 14:29:22 +0100
|
||||||
Subject: [PATCH] linux-user: lseek: explicitly cast non-set offsets to signed
|
Subject: [PATCH] linux-user: lseek: explicitly cast non-set offsets to signed
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 059de120405eea44ff389bed7a94aca9f32f4591 Mon Sep 17 00:00:00 2001
|
From cd1a94f80e21ef2b5fa584514c032b34c0f85aeb Mon Sep 17 00:00:00 2001
|
||||||
From: Bruce Rogers <brogers@suse.com>
|
From: Bruce Rogers <brogers@suse.com>
|
||||||
Date: Thu, 16 May 2013 12:39:10 +0200
|
Date: Thu, 16 May 2013 12:39:10 +0200
|
||||||
Subject: [PATCH] virtfs-proxy-helper: Provide __u64 for broken
|
Subject: [PATCH] virtfs-proxy-helper: Provide __u64 for broken
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 691fc4414be4b35aca29dbebca08192f91c69bf5 Mon Sep 17 00:00:00 2001
|
From c9fbb5972a05e94bbe28bc75441344830a247fe5 Mon Sep 17 00:00:00 2001
|
||||||
From: Dinar Valeev <k0da@opensuse.org>
|
From: Dinar Valeev <k0da@opensuse.org>
|
||||||
Date: Wed, 2 Oct 2013 17:56:03 +0200
|
Date: Wed, 2 Oct 2013 17:56:03 +0200
|
||||||
Subject: [PATCH] configure: Enable PIE for ppc and ppc64 hosts
|
Subject: [PATCH] configure: Enable PIE for ppc and ppc64 hosts
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From c4bd3ee614365b7343fd570907901bdd11141f49 Mon Sep 17 00:00:00 2001
|
From 39b6d2beaf481c85e836a77dede84456c25622ed Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
|
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
|
||||||
Date: Thu, 17 Apr 2014 18:39:10 +0200
|
Date: Thu, 17 Apr 2014 18:39:10 +0200
|
||||||
Subject: [PATCH] qtest: Increase socket timeout
|
Subject: [PATCH] qtest: Increase socket timeout
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 849aa878fa4bc283531d005bc2d6a5496af4cde1 Mon Sep 17 00:00:00 2001
|
From 458ee6dac3863bf420d70cd218f88b60c4de7565 Mon Sep 17 00:00:00 2001
|
||||||
From: Alexander Graf <agraf@suse.de>
|
From: Alexander Graf <agraf@suse.de>
|
||||||
Date: Wed, 14 Jan 2015 01:32:11 +0100
|
Date: Wed, 14 Jan 2015 01:32:11 +0100
|
||||||
Subject: [PATCH] AIO: Reduce number of threads for 32bit hosts
|
Subject: [PATCH] AIO: Reduce number of threads for 32bit hosts
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 5d4f5c0bb2304239ef1bc47cf5eb211c576d2342 Mon Sep 17 00:00:00 2001
|
From 1c97919295ef36ddaaca131cc412aafe9a078151 Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
|
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
|
||||||
Date: Tue, 14 Apr 2015 18:42:06 +0200
|
Date: Tue, 14 Apr 2015 18:42:06 +0200
|
||||||
Subject: [PATCH] Revert "Revert seccomp tests that allow it to be used on
|
Subject: [PATCH] Revert "Revert seccomp tests that allow it to be used on
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From df632501e0417ab9814f2a69d7e2859c22b74010 Mon Sep 17 00:00:00 2001
|
From cf25e5be2ef07247d563a0aec6edc719a1f6a5aa Mon Sep 17 00:00:00 2001
|
||||||
From: Richard Henderson <rth@twiddle.net>
|
From: Richard Henderson <rth@twiddle.net>
|
||||||
Date: Tue, 1 Sep 2015 15:58:02 -0400
|
Date: Tue, 1 Sep 2015 15:58:02 -0400
|
||||||
Subject: [PATCH] tcg/aarch64: Fix tcg_out_qemu_{ld, st} for guest_base == 0
|
Subject: [PATCH] tcg/aarch64: Fix tcg_out_qemu_{ld, st} for guest_base == 0
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From e803dc8085b04f0d78ae3443324a5e2f4650d759 Mon Sep 17 00:00:00 2001
|
From b3d605bbbebdfff36843fb785f4db3e633f96892 Mon Sep 17 00:00:00 2001
|
||||||
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
|
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
|
||||||
Date: Mon, 5 Oct 2015 12:04:20 +0100
|
Date: Mon, 5 Oct 2015 12:04:20 +0100
|
||||||
Subject: [PATCH] tests: Unique test path for /string-visitor/output
|
Subject: [PATCH] tests: Unique test path for /string-visitor/output
|
||||||
|
142
0040-dictzip-Fix-on-big-endian-systems.patch
Normal file
142
0040-dictzip-Fix-on-big-endian-systems.patch
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
From 6daa5dc051e04f528bbe15cb7231a05cf92a072c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alexander Graf <agraf@suse.de>
|
||||||
|
Date: Mon, 15 Jun 2015 17:36:32 +0200
|
||||||
|
Subject: [PATCH] dictzip: Fix on big endian systems
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
The dictzip code in SLE11 received some treatment over time to support
|
||||||
|
running on big endian hosts. Somewhere in the transition to SLE12 this
|
||||||
|
support got lost. Add it back in again from the SLE11 code base.
|
||||||
|
|
||||||
|
Furthermore while at it, fix up the debug prints to not emit warnings.
|
||||||
|
|
||||||
|
[AG: BSC#937572]
|
||||||
|
Signed-off-by: Alexander Graf <agraf@suse.de>
|
||||||
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
||||||
|
---
|
||||||
|
block/dictzip.c | 50 ++++++++++++++++++++++++++++----------------------
|
||||||
|
1 file changed, 28 insertions(+), 22 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/block/dictzip.c b/block/dictzip.c
|
||||||
|
index 1824971..71ffe7b 100644
|
||||||
|
--- a/block/dictzip.c
|
||||||
|
+++ b/block/dictzip.c
|
||||||
|
@@ -154,6 +154,7 @@ static int dictzip_open(BlockDriverState *bs, QDict *options, int flags, Error *
|
||||||
|
uint8_t header_flags;
|
||||||
|
uint16_t chunk_len16;
|
||||||
|
uint16_t chunk_cnt16;
|
||||||
|
+ uint32_t chunk_len32;
|
||||||
|
uint16_t header_ver;
|
||||||
|
uint16_t tmp_short;
|
||||||
|
uint64_t offset;
|
||||||
|
@@ -253,11 +254,11 @@ static int dictzip_open(BlockDriverState *bs, QDict *options, int flags, Error *
|
||||||
|
break;
|
||||||
|
case 99: /* Special Alex pigz version */
|
||||||
|
/* number of chunks */
|
||||||
|
- if (bdrv_pread(s->hd, GZ_99_CHUNKSIZE, &s->chunk_len, 4) != 4)
|
||||||
|
+ if (bdrv_pread(s->hd, GZ_99_CHUNKSIZE, &chunk_len32, 4) != 4)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
- dprintf("chunk len [%#x] = %d\n", GZ_99_CHUNKSIZE, s->chunk_len);
|
||||||
|
- s->chunk_len = le32_to_cpu(s->chunk_len);
|
||||||
|
+ dprintf("chunk len [%#x] = %d\n", GZ_99_CHUNKSIZE, chunk_len32);
|
||||||
|
+ s->chunk_len = le32_to_cpu(chunk_len32);
|
||||||
|
|
||||||
|
/* chunk count */
|
||||||
|
if (bdrv_pread(s->hd, GZ_99_CHUNKCNT, &s->chunk_cnt, 4) != 4)
|
||||||
|
@@ -265,7 +266,7 @@ static int dictzip_open(BlockDriverState *bs, QDict *options, int flags, Error *
|
||||||
|
|
||||||
|
s->chunk_cnt = le32_to_cpu(s->chunk_cnt);
|
||||||
|
|
||||||
|
- dprintf("chunk len | count = %d | %d\n", s->chunk_len, s->chunk_cnt);
|
||||||
|
+ dprintf("chunk len | count = %"PRId64" | %d\n", s->chunk_len, s->chunk_cnt);
|
||||||
|
|
||||||
|
/* file size */
|
||||||
|
if (bdrv_pread(s->hd, GZ_99_FILESIZE, &s->file_len, 8) != 8)
|
||||||
|
@@ -336,14 +337,14 @@ static int dictzip_open(BlockDriverState *bs, QDict *options, int flags, Error *
|
||||||
|
s->offsets[i] = offset;
|
||||||
|
switch (header_ver) {
|
||||||
|
case 1:
|
||||||
|
- offset += s->chunks[i];
|
||||||
|
+ offset += le16_to_cpu(s->chunks[i]);
|
||||||
|
break;
|
||||||
|
case 99:
|
||||||
|
- offset += s->chunks32[i];
|
||||||
|
+ offset += le32_to_cpu(s->chunks32[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
- dprintf("chunk %#x - %#x = offset %#x -> %#x\n", i * s->chunk_len, (i+1) * s->chunk_len, s->offsets[i], offset);
|
||||||
|
+ dprintf("chunk %#"PRIx64" - %#"PRIx64" = offset %#"PRIx64" -> %#"PRIx64"\n", i * s->chunk_len, (i+1) * s->chunk_len, s->offsets[i], offset);
|
||||||
|
}
|
||||||
|
qemu_opts_del(opts);
|
||||||
|
|
||||||
|
@@ -377,10 +378,26 @@ static void dictzip_read_cb(void *opaque, int ret)
|
||||||
|
struct BDRVDictZipState *s = acb->s;
|
||||||
|
uint8_t *buf;
|
||||||
|
DictCache *cache;
|
||||||
|
- int r;
|
||||||
|
+ int r, i;
|
||||||
|
|
||||||
|
buf = g_malloc(acb->chunks_len);
|
||||||
|
|
||||||
|
+ /* try to find zlib stream for decoding */
|
||||||
|
+ do {
|
||||||
|
+ for (i = 0; i < Z_STREAM_COUNT; i++) {
|
||||||
|
+ if (!(s->stream_in_use & (1 << i))) {
|
||||||
|
+ s->stream_in_use |= (1 << i);
|
||||||
|
+ acb->zStream_id = i;
|
||||||
|
+ acb->zStream = &s->zStream[i];
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ } while(!acb->zStream);
|
||||||
|
+
|
||||||
|
+ /* sure, we could handle more streams, but this callback should be single
|
||||||
|
+ threaded and when it's not, we really want to know! */
|
||||||
|
+ assert(i == 0);
|
||||||
|
+
|
||||||
|
/* uncompress the chunk */
|
||||||
|
acb->zStream->next_in = acb->gzipped;
|
||||||
|
acb->zStream->avail_in = acb->gz_len;
|
||||||
|
@@ -466,17 +483,6 @@ static BlockAIOCB *dictzip_aio_readv(BlockDriverState *bs,
|
||||||
|
}
|
||||||
|
|
||||||
|
/* No cache, so let's decode */
|
||||||
|
- do {
|
||||||
|
- for (i = 0; i < Z_STREAM_COUNT; i++) {
|
||||||
|
- if (!(s->stream_in_use & (1 << i))) {
|
||||||
|
- s->stream_in_use |= (1 << i);
|
||||||
|
- acb->zStream_id = i;
|
||||||
|
- acb->zStream = &s->zStream[i];
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- } while(!acb->zStream);
|
||||||
|
-
|
||||||
|
/* We need to read these chunks */
|
||||||
|
first_chunk = start / s->chunk_len;
|
||||||
|
first_offset = start - first_chunk * s->chunk_len;
|
||||||
|
@@ -486,9 +492,9 @@ static BlockAIOCB *dictzip_aio_readv(BlockDriverState *bs,
|
||||||
|
gz_len = 0;
|
||||||
|
for (i = first_chunk; i <= last_chunk; i++) {
|
||||||
|
if (s->chunks32)
|
||||||
|
- gz_len += s->chunks32[i];
|
||||||
|
+ gz_len += le32_to_cpu(s->chunks32[i]);
|
||||||
|
else
|
||||||
|
- gz_len += s->chunks[i];
|
||||||
|
+ gz_len += le16_to_cpu(s->chunks[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
gz_sector_num = gz_start / SECTOR_SIZE;
|
||||||
|
@@ -509,7 +515,7 @@ static BlockAIOCB *dictzip_aio_readv(BlockDriverState *bs,
|
||||||
|
iov->iov_len = gz_nb_sectors * 512;
|
||||||
|
qemu_iovec_init_external(qiov_gz, iov, 1);
|
||||||
|
|
||||||
|
- dprintf("read %d - %d => %d - %d\n", start, end, gz_start, gz_start + gz_len);
|
||||||
|
+ dprintf("read %zd - %zd => %zd - %zd\n", start, end, gz_start, gz_start + gz_len);
|
||||||
|
|
||||||
|
acb->s = s;
|
||||||
|
acb->qiov = qiov;
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Oct 8 16:29:36 UTC 2015 - afaerber@suse.de
|
||||||
|
|
||||||
|
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.4
|
||||||
|
* Patches added:
|
||||||
|
0040-dictzip-Fix-on-big-endian-systems.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Oct 8 14:35:11 UTC 2015 - afaerber@suse.de
|
Thu Oct 8 14:35:11 UTC 2015 - afaerber@suse.de
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ Patch0036: 0036-AIO-Reduce-number-of-threads-for-32.patch
|
|||||||
Patch0037: 0037-Revert-Revert-seccomp-tests-that-al.patch
|
Patch0037: 0037-Revert-Revert-seccomp-tests-that-al.patch
|
||||||
Patch0038: 0038-tcg-aarch64-Fix-tcg_out_qemu_-ld-st.patch
|
Patch0038: 0038-tcg-aarch64-Fix-tcg_out_qemu_-ld-st.patch
|
||||||
Patch0039: 0039-tests-Unique-test-path-for-string-v.patch
|
Patch0039: 0039-tests-Unique-test-path-for-string-v.patch
|
||||||
|
Patch0040: 0040-dictzip-Fix-on-big-endian-systems.patch
|
||||||
# Please do not add patches manually here, run update_git.sh.
|
# Please do not add patches manually here, run update_git.sh.
|
||||||
# this is to make lint happy
|
# this is to make lint happy
|
||||||
Source300: qemu-rpmlintrc
|
Source300: qemu-rpmlintrc
|
||||||
@ -162,6 +163,7 @@ This sub-package contains development files for the Smartcard library.
|
|||||||
%patch0037 -p1
|
%patch0037 -p1
|
||||||
%patch0038 -p1
|
%patch0038 -p1
|
||||||
%patch0039 -p1
|
%patch0039 -p1
|
||||||
|
%patch0040 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
|
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Oct 8 16:29:32 UTC 2015 - afaerber@suse.de
|
||||||
|
|
||||||
|
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.4
|
||||||
|
* Patches added:
|
||||||
|
0040-dictzip-Fix-on-big-endian-systems.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Oct 8 14:35:07 UTC 2015 - afaerber@suse.de
|
Thu Oct 8 14:35:07 UTC 2015 - afaerber@suse.de
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ Patch0036: 0036-AIO-Reduce-number-of-threads-for-32.patch
|
|||||||
Patch0037: 0037-Revert-Revert-seccomp-tests-that-al.patch
|
Patch0037: 0037-Revert-Revert-seccomp-tests-that-al.patch
|
||||||
Patch0038: 0038-tcg-aarch64-Fix-tcg_out_qemu_-ld-st.patch
|
Patch0038: 0038-tcg-aarch64-Fix-tcg_out_qemu_-ld-st.patch
|
||||||
Patch0039: 0039-tests-Unique-test-path-for-string-v.patch
|
Patch0039: 0039-tests-Unique-test-path-for-string-v.patch
|
||||||
|
Patch0040: 0040-dictzip-Fix-on-big-endian-systems.patch
|
||||||
# Please do not add patches manually here, run update_git.sh.
|
# Please do not add patches manually here, run update_git.sh.
|
||||||
# this is to make lint happy
|
# this is to make lint happy
|
||||||
Source300: qemu-rpmlintrc
|
Source300: qemu-rpmlintrc
|
||||||
@ -156,6 +157,7 @@ run cross-architecture builds.
|
|||||||
%patch0037 -p1
|
%patch0037 -p1
|
||||||
%patch0038 -p1
|
%patch0038 -p1
|
||||||
%patch0039 -p1
|
%patch0039 -p1
|
||||||
|
%patch0040 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
|
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Oct 8 16:29:28 UTC 2015 - afaerber@suse.de
|
||||||
|
|
||||||
|
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.4
|
||||||
|
* Fix endianness issues in DictZip block driver (bsc#937572, bsc#945778)
|
||||||
|
0027-block-Add-support-for-DictZip-enabl.patch
|
||||||
|
0028-block-Add-tar-container-format.patch
|
||||||
|
0040-dictzip-Fix-on-big-endian-systems.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Oct 8 14:35:03 UTC 2015 - afaerber@suse.de
|
Thu Oct 8 14:35:03 UTC 2015 - afaerber@suse.de
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ Patch0036: 0036-AIO-Reduce-number-of-threads-for-32.patch
|
|||||||
Patch0037: 0037-Revert-Revert-seccomp-tests-that-al.patch
|
Patch0037: 0037-Revert-Revert-seccomp-tests-that-al.patch
|
||||||
Patch0038: 0038-tcg-aarch64-Fix-tcg_out_qemu_-ld-st.patch
|
Patch0038: 0038-tcg-aarch64-Fix-tcg_out_qemu_-ld-st.patch
|
||||||
Patch0039: 0039-tests-Unique-test-path-for-string-v.patch
|
Patch0039: 0039-tests-Unique-test-path-for-string-v.patch
|
||||||
|
Patch0040: 0040-dictzip-Fix-on-big-endian-systems.patch
|
||||||
# Please do not add QEMU patches manually here.
|
# Please do not add QEMU patches manually here.
|
||||||
# Run update_git.sh to regenerate this queue.
|
# Run update_git.sh to regenerate this queue.
|
||||||
|
|
||||||
@ -614,6 +615,7 @@ This package provides a service file for starting and stopping KSM.
|
|||||||
%patch0037 -p1
|
%patch0037 -p1
|
||||||
%patch0038 -p1
|
%patch0038 -p1
|
||||||
%patch0039 -p1
|
%patch0039 -p1
|
||||||
|
%patch0040 -p1
|
||||||
|
|
||||||
%if %{build_x86_fw_from_source}
|
%if %{build_x86_fw_from_source}
|
||||||
pushd roms/seabios
|
pushd roms/seabios
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Oct 8 16:29:28 UTC 2015 - afaerber@suse.de
|
||||||
|
|
||||||
|
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.4
|
||||||
|
* Fix endianness issues in DictZip block driver (bsc#937572, bsc#945778)
|
||||||
|
0027-block-Add-support-for-DictZip-enabl.patch
|
||||||
|
0028-block-Add-tar-container-format.patch
|
||||||
|
0040-dictzip-Fix-on-big-endian-systems.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Oct 8 14:35:03 UTC 2015 - afaerber@suse.de
|
Thu Oct 8 14:35:03 UTC 2015 - afaerber@suse.de
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ Patch0036: 0036-AIO-Reduce-number-of-threads-for-32.patch
|
|||||||
Patch0037: 0037-Revert-Revert-seccomp-tests-that-al.patch
|
Patch0037: 0037-Revert-Revert-seccomp-tests-that-al.patch
|
||||||
Patch0038: 0038-tcg-aarch64-Fix-tcg_out_qemu_-ld-st.patch
|
Patch0038: 0038-tcg-aarch64-Fix-tcg_out_qemu_-ld-st.patch
|
||||||
Patch0039: 0039-tests-Unique-test-path-for-string-v.patch
|
Patch0039: 0039-tests-Unique-test-path-for-string-v.patch
|
||||||
|
Patch0040: 0040-dictzip-Fix-on-big-endian-systems.patch
|
||||||
# Please do not add QEMU patches manually here.
|
# Please do not add QEMU patches manually here.
|
||||||
# Run update_git.sh to regenerate this queue.
|
# Run update_git.sh to regenerate this queue.
|
||||||
|
|
||||||
@ -614,6 +615,7 @@ This package provides a service file for starting and stopping KSM.
|
|||||||
%patch0037 -p1
|
%patch0037 -p1
|
||||||
%patch0038 -p1
|
%patch0038 -p1
|
||||||
%patch0039 -p1
|
%patch0039 -p1
|
||||||
|
%patch0040 -p1
|
||||||
|
|
||||||
%if %{build_x86_fw_from_source}
|
%if %{build_x86_fw_from_source}
|
||||||
pushd roms/seabios
|
pushd roms/seabios
|
||||||
|
Loading…
Reference in New Issue
Block a user