aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-03-01 10:14:32 +0000
committerPeter Maydell <peter.maydell@linaro.org>2024-03-01 10:14:32 +0000
commite1007b6bab5cf97705bf4f2aaec1f607787355b8 (patch)
tree3bbbfdc0baeabae83c55dacd22516e9909952fa0 /tests
parentb21d5fd180c202bea162b5ed8b862be2302a2cda (diff)
parent462945cd22d2bcd233401ed3aa167d83a8e35b05 (diff)
downloadqemu-e1007b6bab5cf97705bf4f2aaec1f607787355b8.zip
qemu-e1007b6bab5cf97705bf4f2aaec1f607787355b8.tar.gz
qemu-e1007b6bab5cf97705bf4f2aaec1f607787355b8.tar.bz2
Merge tag 'pull-request-2024-03-01' of https://gitlab.com/thuth/qemu into staging
* Fix some bugs in the vring setup of libqos * Fix GIC settings when using --without-default-devices * Fix USB PCAP streams on Windows * Remove temporary files from test-util-sockets * Fix TLS io channels sending too much data to the backend # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmXhjBcRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbWzZw/+OTSsKg6JTX0z3fjL6If+Ns/EnFiniHHI # y1jR7fPub3ybFokgHIWrRVG+9ol+1tJuPlO5Bsx1SKFzNC8++l1iyK7E25xnmp2P # Ry/Z0ZSWp3JWCtLm6km5pKl3wWI9p0XwfUOJbCWYM5dOsd2a4C4DSvjcwNXR7pTB # 4AxXFj5G5UwXuffgPnBzeerm5baNweSqa/uczUY6Od+iJwmHpaSk0SJ4NIlIYvnS # z3BH81trQAoKYZyywp0aF+jH9w3YNwD1XDp2Bcf3qSWDdokN55V13yyiSllTfUwX # Lq3fotoLqFJL0A4m8a3TdCKMP8ReoJATSriPHJmGMgqWGTnvtRBIsx1pmMpYRB6U # EltaKW0WXeQAad0ZYGl4odx7kQUQjdc8HTQRTevQD9g3XpZZN0o9MfTPdM2eR5h6 # xaS8UEc61YJAcmD27Ir92JGGGMLBTYz4OGLx3Rj7l7S759GQ67qih9TGcE9nqSj+ # +wAHfiOjUZnSWnp7Hq4M/TIjNh0BuyBW4oRBASaikjjQ82Hih5bPTdRu1J8lYuXC # PhN8dLwdk0NMrnnHuFDKq/sXjDeXF3Hg0AmtVvOGiB2z2OeVSPtMxl/YgniGVTbj # CHXDqDrBAa7i6WxAo+TtUgE20iVz5uYzGqHmxTNpq6FzIRb1uvHksbjFlin79Pkw # eF0Dj80zxAY= # =9JAI # -----END PGP SIGNATURE----- # gpg: Signature made Fri 01 Mar 2024 08:04:39 GMT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2024-03-01' of https://gitlab.com/thuth/qemu: chardev/char-socket: Fix TLS io channels sending too much data to the backend tests/unit/test-util-sockets: Remove temporary file after test hw/usb/bus.c: PCAP adding 0xA in Windows version hw/intc/Kconfig: Fix GIC settings when using "--without-default-devices" libqos/virtio.c: fix 'avail_event' offset in qvring_init() libqos/virtio.c: init all elems in qvring_indirect_desc_setup() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/libqos/virtio.c27
-rw-r--r--tests/unit/test-util-sockets.c1
2 files changed, 21 insertions, 7 deletions
diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c
index 4105132..82a6e12 100644
--- a/tests/qtest/libqos/virtio.c
+++ b/tests/qtest/libqos/virtio.c
@@ -265,7 +265,7 @@ void qvring_init(QTestState *qts, const QGuestAllocator *alloc, QVirtQueue *vq,
/* vq->used->idx */
qvirtio_writew(vq->vdev, qts, vq->used + 2, 0);
/* vq->used->avail_event */
- qvirtio_writew(vq->vdev, qts, vq->used + 2 +
+ qvirtio_writew(vq->vdev, qts, vq->used + 4 +
sizeof(struct vring_used_elem) * vq->size, 0);
}
@@ -280,14 +280,27 @@ QVRingIndirectDesc *qvring_indirect_desc_setup(QTestState *qs, QVirtioDevice *d,
indirect->elem = elem;
indirect->desc = guest_alloc(alloc, sizeof(struct vring_desc) * elem);
- for (i = 0; i < elem - 1; ++i) {
+ for (i = 0; i < elem; ++i) {
/* indirect->desc[i].addr */
qvirtio_writeq(d, qs, indirect->desc + (16 * i), 0);
- /* indirect->desc[i].flags */
- qvirtio_writew(d, qs, indirect->desc + (16 * i) + 12,
- VRING_DESC_F_NEXT);
- /* indirect->desc[i].next */
- qvirtio_writew(d, qs, indirect->desc + (16 * i) + 14, i + 1);
+
+ /*
+ * If it's not the last element of the ring, set
+ * the chain (VRING_DESC_F_NEXT) flag and
+ * desc->next. Clear the last element - there's
+ * no guarantee that guest_alloc() will do it.
+ */
+ if (i != elem - 1) {
+ /* indirect->desc[i].flags */
+ qvirtio_writew(d, qs, indirect->desc + (16 * i) + 12,
+ VRING_DESC_F_NEXT);
+
+ /* indirect->desc[i].next */
+ qvirtio_writew(d, qs, indirect->desc + (16 * i) + 14, i + 1);
+ } else {
+ qvirtio_writew(d, qs, indirect->desc + (16 * i) + 12, 0);
+ qvirtio_writew(d, qs, indirect->desc + (16 * i) + 14, 0);
+ }
}
return indirect;
diff --git a/tests/unit/test-util-sockets.c b/tests/unit/test-util-sockets.c
index 63909cc..4c9dd0b 100644
--- a/tests/unit/test-util-sockets.c
+++ b/tests/unit/test-util-sockets.c
@@ -326,6 +326,7 @@ static void test_socket_unix_abstract(void)
test_socket_unix_abstract_row(&matrix[i]);
}
+ unlink(addr.u.q_unix.path);
g_free(addr.u.q_unix.path);
}