Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging
Pull request
# gpg: Signature made Fri 27 Mar 2020 20:14:10 GMT
# gpg: using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full]
# Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB
# Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E
* remotes/jnsnow/tags/ide-pull-request:
cmd646-ide: use qdev gpio rather than qemu_allocate_irqs()
via-ide: use qdev gpio rather than qemu_allocate_irqs()
via-ide: don't use PCI level for legacy IRQs
hw/ide/sii3112: Use qdev gpio rather than qemu_allocate_irqs()
fdc/i8257: implement verify transfer mode
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
diff --git a/.travis.yml b/.travis.yml
index 5672d12..e0c7221 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -525,6 +525,48 @@
$(exit $BUILD_RC);
fi
+ - name: "[s390x] GCC check (KVM)"
+ arch: s390x
+ dist: bionic
+ addons:
+ apt_packages:
+ - libaio-dev
+ - libattr1-dev
+ - libbrlapi-dev
+ - libcap-ng-dev
+ - libgcrypt20-dev
+ - libgnutls28-dev
+ - libgtk-3-dev
+ - libiscsi-dev
+ - liblttng-ust-dev
+ - libncurses5-dev
+ - libnfs-dev
+ - libnss3-dev
+ - libpixman-1-dev
+ - libpng-dev
+ - librados-dev
+ - libsdl2-dev
+ - libseccomp-dev
+ - liburcu-dev
+ - libusb-1.0-0-dev
+ - libvdeplug-dev
+ - libvte-2.91-dev
+ # Tests dependencies
+ - genisoimage
+ env:
+ - TEST_CMD="make check-unit"
+ - CONFIG="--disable-containers --disable-tcg --enable-kvm --disable-tools"
+ script:
+ - ( cd ${SRC_DIR} ; git submodule update --init roms/SLOF )
+ - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
+ - |
+ if [ "$BUILD_RC" -eq 0 ] ; then
+ mv pc-bios/s390-ccw/*.img pc-bios/ ;
+ ${TEST_CMD} ;
+ else
+ $(exit $BUILD_RC);
+ fi
+
# Release builds
# The make-release script expect a QEMU version, so our tag must start with a 'v'.
# This is the case when release candidate tags are created.
diff --git a/block.c b/block.c
index af3faf6..2e3905c 100644
--- a/block.c
+++ b/block.c
@@ -2617,6 +2617,7 @@
error_propagate(errp, local_err);
g_free(child);
bdrv_abort_perm_update(child_bs);
+ bdrv_unref(child_bs);
return NULL;
}
}
diff --git a/block/iscsi.c b/block/iscsi.c
index 14680a4..4e216bd 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -2002,7 +2002,7 @@
iscsilun->cluster_size = iscsilun->bl.opt_unmap_gran *
iscsilun->block_size;
if (iscsilun->lbprz) {
- ret = iscsi_allocmap_init(iscsilun, bs->open_flags);
+ ret = iscsi_allocmap_init(iscsilun, flags);
}
}
diff --git a/block/mirror.c b/block/mirror.c
index 6203e59..c26fd92 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -102,6 +102,7 @@
bool is_pseudo_op;
bool is_active_write;
+ bool is_in_flight;
CoQueue waiting_requests;
Coroutine *co;
@@ -283,20 +284,19 @@
}
static inline void coroutine_fn
-mirror_wait_for_any_operation(MirrorBlockJob *s, MirrorOp *self, bool active)
+mirror_wait_for_any_operation(MirrorBlockJob *s, bool active)
{
MirrorOp *op;
QTAILQ_FOREACH(op, &s->ops_in_flight, next) {
- if (self == op) {
- continue;
- }
/* Do not wait on pseudo ops, because it may in turn wait on
* some other operation to start, which may in fact be the
* caller of this function. Since there is only one pseudo op
* at any given time, we will always find some real operation
* to wait on. */
- if (!op->is_pseudo_op && op->is_active_write == active) {
+ if (!op->is_pseudo_op && op->is_in_flight &&
+ op->is_active_write == active)
+ {
qemu_co_queue_wait(&op->waiting_requests, NULL);
return;
}
@@ -305,10 +305,10 @@
}
static inline void coroutine_fn
-mirror_wait_for_free_in_flight_slot(MirrorBlockJob *s, MirrorOp *self)
+mirror_wait_for_free_in_flight_slot(MirrorBlockJob *s)
{
/* Only non-active operations use up in-flight slots */
- mirror_wait_for_any_operation(s, self, false);
+ mirror_wait_for_any_operation(s, false);
}
/* Perform a mirror copy operation.
@@ -351,7 +351,7 @@
while (s->buf_free_count < nb_chunks) {
trace_mirror_yield_in_flight(s, op->offset, s->in_flight);
- mirror_wait_for_free_in_flight_slot(s, op);
+ mirror_wait_for_free_in_flight_slot(s);
}
/* Now make a QEMUIOVector taking enough granularity-sized chunks
@@ -370,6 +370,7 @@
/* Copy the dirty cluster. */
s->in_flight++;
s->bytes_in_flight += op->bytes;
+ op->is_in_flight = true;
trace_mirror_one_iteration(s, op->offset, op->bytes);
ret = bdrv_co_preadv(s->mirror_top_bs->backing, op->offset, op->bytes,
@@ -385,6 +386,7 @@
op->s->in_flight++;
op->s->bytes_in_flight += op->bytes;
*op->bytes_handled = op->bytes;
+ op->is_in_flight = true;
ret = blk_co_pwrite_zeroes(op->s->target, op->offset, op->bytes,
op->s->unmap ? BDRV_REQ_MAY_UNMAP : 0);
@@ -399,6 +401,7 @@
op->s->in_flight++;
op->s->bytes_in_flight += op->bytes;
*op->bytes_handled = op->bytes;
+ op->is_in_flight = true;
ret = blk_co_pdiscard(op->s->target, op->offset, op->bytes);
mirror_write_complete(op, ret);
@@ -558,7 +561,7 @@
while (s->in_flight >= MAX_IN_FLIGHT) {
trace_mirror_yield_in_flight(s, offset, s->in_flight);
- mirror_wait_for_free_in_flight_slot(s, pseudo_op);
+ mirror_wait_for_free_in_flight_slot(s);
}
if (s->ret < 0) {
@@ -612,7 +615,7 @@
static void coroutine_fn mirror_wait_for_all_io(MirrorBlockJob *s)
{
while (s->in_flight > 0) {
- mirror_wait_for_free_in_flight_slot(s, NULL);
+ mirror_wait_for_free_in_flight_slot(s);
}
}
@@ -810,7 +813,7 @@
if (s->in_flight >= MAX_IN_FLIGHT) {
trace_mirror_yield(s, UINT64_MAX, s->buf_free_count,
s->in_flight);
- mirror_wait_for_free_in_flight_slot(s, NULL);
+ mirror_wait_for_free_in_flight_slot(s);
continue;
}
@@ -963,7 +966,7 @@
/* Do not start passive operations while there are active
* writes in progress */
while (s->in_active_write_counter) {
- mirror_wait_for_any_operation(s, NULL, true);
+ mirror_wait_for_any_operation(s, true);
}
if (s->ret < 0) {
@@ -989,7 +992,7 @@
if (s->in_flight >= MAX_IN_FLIGHT || s->buf_free_count == 0 ||
(cnt == 0 && s->in_flight > 0)) {
trace_mirror_yield(s, cnt, s->buf_free_count, s->in_flight);
- mirror_wait_for_free_in_flight_slot(s, NULL);
+ mirror_wait_for_free_in_flight_slot(s);
continue;
} else if (cnt != 0) {
delay_ns = mirror_iteration(s);
@@ -1322,6 +1325,7 @@
.offset = offset,
.bytes = bytes,
.is_active_write = true,
+ .is_in_flight = true,
};
qemu_co_queue_init(&op->waiting_requests);
QTAILQ_INSERT_TAIL(&s->ops_in_flight, op, next);
diff --git a/block/qcow2.h b/block/qcow2.h
index 0942126..f4de0a2 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -301,9 +301,6 @@
QEMUTimer *cache_clean_timer;
unsigned cache_clean_interval;
- uint8_t *cluster_cache;
- uint8_t *cluster_data;
- uint64_t cluster_cache_offset;
QLIST_HEAD(, QCowL2Meta) cluster_allocs;
uint64_t *refcount_table;
diff --git a/configure b/configure
index 89fe881..e225a1e 100755
--- a/configure
+++ b/configure
@@ -7887,7 +7887,7 @@
TARGET_SYSTBL_ABI=n32
;;
mips64|mips64el)
- mttcg="yes"
+ mttcg="no"
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
diff --git a/hw/block/trace-events b/hw/block/trace-events
index f78939f..bf6d11b 100644
--- a/hw/block/trace-events
+++ b/hw/block/trace-events
@@ -37,7 +37,7 @@
nvme_create_sq(uint64_t addr, uint16_t sqid, uint16_t cqid, uint16_t qsize, uint16_t qflags) "create submission queue, addr=0x%"PRIx64", sqid=%"PRIu16", cqid=%"PRIu16", qsize=%"PRIu16", qflags=%"PRIu16""
nvme_create_cq(uint64_t addr, uint16_t cqid, uint16_t vector, uint16_t size, uint16_t qflags, int ien) "create completion queue, addr=0x%"PRIx64", cqid=%"PRIu16", vector=%"PRIu16", qsize=%"PRIu16", qflags=%"PRIu16", ien=%d"
nvme_del_sq(uint16_t qid) "deleting submission queue sqid=%"PRIu16""
-nvme_del_cq(uint16_t cqid) "deleted completion queue, sqid=%"PRIu16""
+nvme_del_cq(uint16_t cqid) "deleted completion queue, cqid=%"PRIu16""
nvme_identify_ctrl(void) "identify controller"
nvme_identify_ns(uint16_t ns) "identify namespace, nsid=%"PRIu16""
nvme_identify_nslist(uint16_t ns) "identify namespace list, nsid=%"PRIu16""
diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h
index f9cd24c..ff72db5 100644
--- a/include/qemu/atomic.h
+++ b/include/qemu/atomic.h
@@ -208,11 +208,14 @@
/* Provide shorter names for GCC atomic builtins, return old value */
#define atomic_fetch_inc(ptr) __atomic_fetch_add(ptr, 1, __ATOMIC_SEQ_CST)
#define atomic_fetch_dec(ptr) __atomic_fetch_sub(ptr, 1, __ATOMIC_SEQ_CST)
+
+#ifndef atomic_fetch_add
#define atomic_fetch_add(ptr, n) __atomic_fetch_add(ptr, n, __ATOMIC_SEQ_CST)
#define atomic_fetch_sub(ptr, n) __atomic_fetch_sub(ptr, n, __ATOMIC_SEQ_CST)
#define atomic_fetch_and(ptr, n) __atomic_fetch_and(ptr, n, __ATOMIC_SEQ_CST)
#define atomic_fetch_or(ptr, n) __atomic_fetch_or(ptr, n, __ATOMIC_SEQ_CST)
#define atomic_fetch_xor(ptr, n) __atomic_fetch_xor(ptr, n, __ATOMIC_SEQ_CST)
+#endif
#define atomic_inc_fetch(ptr) __atomic_add_fetch(ptr, 1, __ATOMIC_SEQ_CST)
#define atomic_dec_fetch(ptr) __atomic_sub_fetch(ptr, 1, __ATOMIC_SEQ_CST)
@@ -392,11 +395,14 @@
/* Provide shorter names for GCC atomic builtins. */
#define atomic_fetch_inc(ptr) __sync_fetch_and_add(ptr, 1)
#define atomic_fetch_dec(ptr) __sync_fetch_and_add(ptr, -1)
+
+#ifndef atomic_fetch_add
#define atomic_fetch_add(ptr, n) __sync_fetch_and_add(ptr, n)
#define atomic_fetch_sub(ptr, n) __sync_fetch_and_sub(ptr, n)
#define atomic_fetch_and(ptr, n) __sync_fetch_and_and(ptr, n)
#define atomic_fetch_or(ptr, n) __sync_fetch_and_or(ptr, n)
#define atomic_fetch_xor(ptr, n) __sync_fetch_and_xor(ptr, n)
+#endif
#define atomic_inc_fetch(ptr) __sync_add_and_fetch(ptr, 1)
#define atomic_dec_fetch(ptr) __sync_add_and_fetch(ptr, -1)
diff --git a/tests/docker/dockerfiles/centos7.docker b/tests/docker/dockerfiles/centos7.docker
index cdd72de..9a2a2e5 100644
--- a/tests/docker/dockerfiles/centos7.docker
+++ b/tests/docker/dockerfiles/centos7.docker
@@ -2,6 +2,8 @@
RUN yum install -y epel-release centos-release-xen-48
RUN yum -y update
+
+# Please keep this list sorted alphabetically
ENV PACKAGES \
bison \
bzip2 \
@@ -19,6 +21,7 @@
libepoxy-devel \
libfdt-devel \
librdmacm-devel \
+ libzstd-devel \
lzo-devel \
make \
mesa-libEGL-devel \
@@ -33,7 +36,6 @@
tar \
vte-devel \
xen-devel \
- zlib-devel \
- libzstd-devel
+ zlib-devel
RUN yum install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt
diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker
index d4849f5..957f0bc 100644
--- a/tests/docker/dockerfiles/debian-amd64.docker
+++ b/tests/docker/dockerfiles/debian-amd64.docker
@@ -16,6 +16,7 @@
apt install -y --no-install-recommends \
libbz2-dev \
liblzo2-dev \
+ libgcrypt20-dev \
librdmacm-dev \
libsasl2-dev \
libsnappy-dev \
diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index a652222..4bd2c95 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -1,4 +1,6 @@
FROM fedora:30
+
+# Please keep this list sorted alphabetically
ENV PACKAGES \
bc \
bison \
@@ -27,6 +29,7 @@
libblockdev-mpath-devel \
libcap-ng-devel \
libcurl-devel \
+ libepoxy-devel \
libfdt-devel \
libiscsi-devel \
libjpeg-devel \
@@ -36,8 +39,10 @@
libseccomp-devel \
libssh-devel \
libubsan \
+ libudev-devel \
libusbx-devel \
libxml2-devel \
+ libzstd-devel \
llvm \
lzo-devel \
make \
@@ -76,8 +81,8 @@
perl-Test-Harness \
pixman-devel \
python3 \
+ python3-PyYAML \
python3-sphinx \
- PyYAML \
rdma-core-devel \
SDL2-devel \
snappy-devel \
@@ -92,8 +97,7 @@
vte291-devel \
which \
xen-devel \
- zlib-devel \
- libzstd-devel
+ zlib-devel
ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3
RUN dnf install -y $PACKAGES
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 8400b0e..756ccf7 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -179,7 +179,6 @@
def boot(self, img, extra_args=[]):
args = self._args + [
- "-device", "VGA",
"-drive", "file=%s,if=none,id=drive0,cache=writeback" % img,
"-device", "virtio-blk,drive=drive0,bootindex=0"]
args += self._data_args + extra_args
@@ -213,6 +212,9 @@
def console_init(self, timeout = 120):
vm = self._guest
vm.console_socket.settimeout(timeout)
+ self.console_raw_path = os.path.join(vm._temp_dir,
+ vm._name + "-console.raw")
+ self.console_raw_file = open(self.console_raw_path, 'wb')
def console_log(self, text):
for line in re.split("[\r\n]", text):
@@ -234,6 +236,9 @@
while True:
try:
chars = vm.console_socket.recv(1)
+ if self.console_raw_file:
+ self.console_raw_file.write(chars)
+ self.console_raw_file.flush()
except socket.timeout:
sys.stderr.write("console: *** read timeout ***\n")
sys.stderr.write("console: waiting for: '%s'\n" % expect)
@@ -353,23 +358,23 @@
"local-hostname: {}-guest\n".format(name)])
mdata.close()
udata = open(os.path.join(cidir, "user-data"), "w")
- print("guest user:pw {}:{}".format(self._config['guest_user'],
- self._config['guest_pass']))
+ print("guest user:pw {}:{}".format(self.GUEST_USER,
+ self.GUEST_PASS))
udata.writelines(["#cloud-config\n",
"chpasswd:\n",
" list: |\n",
- " root:%s\n" % self._config['root_pass'],
- " %s:%s\n" % (self._config['guest_user'],
- self._config['guest_pass']),
+ " root:%s\n" % self.ROOT_PASS,
+ " %s:%s\n" % (self.GUEST_USER,
+ self.GUEST_PASS),
" expire: False\n",
"users:\n",
- " - name: %s\n" % self._config['guest_user'],
+ " - name: %s\n" % self.GUEST_USER,
" sudo: ALL=(ALL) NOPASSWD:ALL\n",
" ssh-authorized-keys:\n",
- " - %s\n" % self._config['ssh_pub_key'],
+ " - %s\n" % SSH_PUB_KEY,
" - name: root\n",
" ssh-authorized-keys:\n",
- " - %s\n" % self._config['ssh_pub_key'],
+ " - %s\n" % SSH_PUB_KEY,
"locale: en_US.UTF-8\n"])
proxy = os.environ.get("http_proxy")
if not proxy is None:
diff --git a/tests/vm/fedora b/tests/vm/fedora
index 4843b41..bd9c6cf 100755
--- a/tests/vm/fedora
+++ b/tests/vm/fedora
@@ -82,6 +82,7 @@
self.boot(img_tmp, extra_args = [
"-bios", "pc-bios/bios-256k.bin",
"-machine", "graphics=off",
+ "-device", "VGA",
"-cdrom", iso
])
self.console_init(300)
diff --git a/tests/vm/freebsd b/tests/vm/freebsd
index 8677087..298967f 100755
--- a/tests/vm/freebsd
+++ b/tests/vm/freebsd
@@ -24,8 +24,8 @@
name = "freebsd"
arch = "x86_64"
- link = "https://download.freebsd.org/ftp/releases/ISO-IMAGES/12.0/FreeBSD-12.0-RELEASE-amd64-disc1.iso.xz"
- csum = "1d40015bea89d05b8bd13e2ed80c40b522a9ec1abd8e7c8b80954fb485fb99db"
+ link = "https://download.freebsd.org/ftp/releases/ISO-IMAGES/12.1/FreeBSD-12.1-RELEASE-amd64-disc1.iso.xz"
+ csum = "7394c3f60a1e236e7bd3a05809cf43ae39a3b8e5d42d782004cf2f26b1cfcd88"
size = "20G"
pkgs = [
# build tools
@@ -92,6 +92,7 @@
self.boot(img_tmp, extra_args = [
"-bios", "pc-bios/bios-256k.bin",
"-machine", "graphics=off",
+ "-device", "VGA",
"-cdrom", iso
])
self.console_init()
diff --git a/tests/vm/netbsd b/tests/vm/netbsd
index 55590f4..b10c9d4 100755
--- a/tests/vm/netbsd
+++ b/tests/vm/netbsd
@@ -22,8 +22,8 @@
name = "netbsd"
arch = "x86_64"
- link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.1/images/NetBSD-8.1-amd64.iso"
- csum = "718f275b7e0879599bdac95630c5e3f2184700032fdb6cdebf3bdd63687898c48ff3f08f57b89f4437a86cdd8ea07c01a39d432dbb37e1e4b008f4985f98da3f"
+ link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.0/images/NetBSD-9.0-amd64.iso"
+ csum = "34da4882ee61bdbf69f241195a8933dc800949d30b43fc6988da853d57fc2b8cac50cf97a0d2adaf93250b4e329d189c1a8b83c33bd515226f37745d50c33369"
size = "20G"
pkgs = [
# tools
@@ -89,38 +89,28 @@
"-cdrom", iso
])
self.console_init()
- self.console_wait("Primary Bootstrap")
-
- # serial console boot menu output doesn't work for some
- # reason, so we have to fly blind ...
- for char in list("5consdev com0\n"):
- time.sleep(0.2)
- self.console_send(char)
- self.console_consume()
+ self.console_wait_send("3. Drop to boot prompt", "3")
+ self.console_wait_send("> ", "consdev com0\n")
self.console_wait_send("> ", "boot\n")
self.console_wait_send("Terminal type", "xterm\n")
self.console_wait_send("a: Installation messages", "a\n")
- self.console_wait_send("b: US-English", "b\n")
self.console_wait_send("a: Install NetBSD", "a\n")
self.console_wait("Shall we continue?")
self.console_wait_send("b: Yes", "b\n")
self.console_wait_send("a: ld0", "a\n")
+ self.console_wait_send("a: Guid Partition Table", "a\n")
self.console_wait_send("a: This is the correct", "a\n")
- self.console_wait_send("b: Use the entire disk", "b\n")
- self.console_wait("NetBSD bootcode")
- self.console_wait_send("a: Yes", "a\n")
- self.console_wait_send("b: Use existing part", "b\n")
+ self.console_wait_send("b: Use default part", "b\n")
self.console_wait_send("x: Partition sizes ok", "x\n")
- self.console_wait_send("for your NetBSD disk", "\n")
self.console_wait("Shall we continue?")
self.console_wait_send("b: Yes", "b\n")
self.console_wait_send("b: Use serial port com0", "b\n")
self.console_wait_send("f: Set serial baud rate", "f\n")
self.console_wait_send("a: 9600", "a\n")
- self.console_wait_send("x: Exit", "x\n")
+ self.console_wait_send("x: Continue", "x\n")
self.console_wait_send("a: Full installation", "a\n")
self.console_wait_send("a: CD-ROM", "a\n")
diff --git a/tests/vm/openbsd b/tests/vm/openbsd
index ab6abbe..0b705f4 100755
--- a/tests/vm/openbsd
+++ b/tests/vm/openbsd
@@ -82,6 +82,7 @@
self.boot(img_tmp, extra_args = [
"-bios", "pc-bios/bios-256k.bin",
"-machine", "graphics=off",
+ "-device", "VGA",
"-cdrom", iso
])
self.console_init()
diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386
index 3266038..1570775 100755
--- a/tests/vm/ubuntu.i386
+++ b/tests/vm/ubuntu.i386
@@ -36,7 +36,10 @@
img_tmp = img + ".tmp"
subprocess.check_call(["cp", "-f", cimg, img_tmp])
self.exec_qemu_img("resize", img_tmp, "50G")
- self.boot(img_tmp, extra_args = ["-cdrom", self.gen_cloud_init_iso()])
+ self.boot(img_tmp, extra_args = [
+ "-device", "VGA",
+ "-cdrom", self.gen_cloud_init_iso()
+ ])
self.wait_ssh()
self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
self.ssh_root_check("apt-get update")