From 84d0984dfe336f24109a6792d06aad0e9ae5e0a6 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Tue, 27 Sep 2016 17:20:11 +0800 Subject: [PATCH 1/3] xenpv: Fix qemu_uuid compiling error 9c5ce8db2 switched the type of qemu_uuid and this should have followed. Fix it. Signed-off-by: Fam Zheng Message-Id: <1474968011-29382-1-git-send-email-famz@redhat.com> Reviewed-by: Eric Blake Acked-by: Stefano Stabellini --- hw/xenpv/xen_domainbuild.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c index b439b0ed5d..457a8976c3 100644 --- a/hw/xenpv/xen_domainbuild.c +++ b/hw/xenpv/xen_domainbuild.c @@ -232,7 +232,7 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk, unsigned long xenstore_mfn = 0, console_mfn = 0; int rc; - memcpy(uuid, qemu_uuid, sizeof(uuid)); + memcpy(uuid, &qemu_uuid, sizeof(uuid)); rc = xen_domain_create(xen_xc, ssidref, uuid, flags, &xen_domid); if (rc < 0) { fprintf(stderr, "xen: xc_domain_create() failed\n"); From 664ee76891adce2b1df42d714f4c158a1df4220b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 28 Sep 2016 18:38:10 +0400 Subject: [PATCH 2/3] smbios: fix uuid copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 9c5ce8db, the uuid is wrongly copied, as QemuUUID 'in' argument is already a pointer. Fixes ASAN complaining: hw/smbios/smbios.c:489:5: runtime error: load of address 0x7fffcdb91b00 with insufficient space for an object of type '__int128 unsigned' Signed-off-by: Marc-André Lureau Message-Id: <20160928143810.25558-1-marcandre.lureau@redhat.com> Reviewed-by: Laszlo Ersek [Warp the long error message line in commit message. - Fam] Signed-off-by: Fam Zheng --- hw/smbios/smbios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 9a6552aa60..3a96cededd 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -486,7 +486,7 @@ static void smbios_build_type_0_table(void) */ static void smbios_encode_uuid(struct smbios_uuid *uuid, QemuUUID *in) { - memcpy(uuid, &in, 16); + memcpy(uuid, in, 16); if (smbios_uuid_encoded) { uuid->time_low = bswap32(uuid->time_low); uuid->time_mid = bswap16(uuid->time_mid); From c16fe84f07a9d3a04c11ce8a139e13a092b384c2 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Wed, 28 Sep 2016 15:31:32 +0800 Subject: [PATCH 3/3] docker: Build in a clean directory Currently we configure and build under "$QEMU_SRC/tests/docker" which is dubious. Create a fixed directory (to be friendly to ccache) and change to there before calling build_qemu. Signed-off-by: Fam Zheng Message-Id: <1475047892-11955-1-git-send-email-famz@redhat.com> --- tests/docker/common.rc | 3 +++ tests/docker/test-clang | 2 ++ tests/docker/test-full | 2 ++ tests/docker/test-mingw | 2 ++ tests/docker/test-quick | 2 ++ 5 files changed, 11 insertions(+) diff --git a/tests/docker/common.rc b/tests/docker/common.rc index 510a3ad3f4..21657e87c6 100755 --- a/tests/docker/common.rc +++ b/tests/docker/common.rc @@ -11,6 +11,9 @@ # or (at your option) any later version. See the COPYING file in # the top-level directory. +BUILD_DIR=/var/tmp/qemu-build +mkdir $BUILD_DIR + requires() { for c in $@; do diff --git a/tests/docker/test-clang b/tests/docker/test-clang index 60e4e976b3..16485e6b7e 100755 --- a/tests/docker/test-clang +++ b/tests/docker/test-clang @@ -15,6 +15,8 @@ requires clang +cd "$BUILD_DIR" + OPTS="--enable-debug --cxx=clang++ --cc=clang --host-cc=clang" # -fsanitize=undefined is broken on Fedora 23, skip it for now # See also: https://bugzilla.redhat.com/show_bug.cgi?id=1263834 diff --git a/tests/docker/test-full b/tests/docker/test-full index fd9b798947..05f0d491d1 100755 --- a/tests/docker/test-full +++ b/tests/docker/test-full @@ -13,5 +13,7 @@ . common.rc +cd "$BUILD_DIR" + build_qemu make check $MAKEFLAGS diff --git a/tests/docker/test-mingw b/tests/docker/test-mingw index c03757add8..33968769f8 100755 --- a/tests/docker/test-mingw +++ b/tests/docker/test-mingw @@ -15,6 +15,8 @@ requires mingw dtc +cd "$BUILD_DIR" + for prefix in x86_64-w64-mingw32- i686-w64-mingw32-; do TARGET_LIST=x86_64-softmmu,aarch64-softmmu \ build_qemu --cross-prefix=$prefix \ diff --git a/tests/docker/test-quick b/tests/docker/test-quick index 7885dfafdb..c465dc06d8 100755 --- a/tests/docker/test-quick +++ b/tests/docker/test-quick @@ -13,6 +13,8 @@ . common.rc +cd "$BUILD_DIR" + DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu" TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \ build_qemu