Skip to contentSkip to conversation

virtio, acpi: fixes

GIT PULL Applied Michael S. Tsirkin 2 participants 5 messages Nov 20, 2019 – Nov 21, 2019

lore
Share & tools
lore
#0 lore raw

The following changes since commit 39e2821077e6dcf788b7c2a9ef50970ec7995437:

Update version for v4.2.0-rc2 release (2019-11-19 19:34:10 +0000)

are available in the Git repository at:

git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to 6c77aa909e0eec6531e2398d0e9e60ec6a9339c6:

tests: acpi: always retain dumped ACPI tables in case of error (2019-11-20 04:57:22 -0500)

----------------------------------------------------------------
virtio, acpi: fixes

A couple of bugfixes.

----------------------------------------------------------------
Igor Mammedov (1):
tests: acpi: always retain dumped ACPI tables in case of error

Stefan Hajnoczi (1):
vhost-user-input: use free(elem) instead of g_free(elem)

Xie Yongji (1):
libvhost-user: Zero memory allocated for VuVirtqInflightDesc

 contrib/libvhost-user/libvhost-user.c | 2 +-
 contrib/vhost-user-input/main.c       | 4 ++--
 tests/bios-tables-test.c              | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
#1 lore raw

[PULL 3/3] tests: acpi: always retain dumped ACPI tables in case of error

From: Igor Mammedov <[email protected]>

If IASL wasn't able to parse expected file, test will just print warning
"Warning! iasl couldn't parse the expected aml\n"
and remove temporary table dumped from guest.

Typically expected tables are always valid, with an exception when patchset introduces new tables.
Make sure dumped tables are retained even if expected files are not valid, so one could have a chance to manualy check new tables.

Message-Id: <[email protected]>

---
 tests/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/bios-tables-test.c +1 -1
index 0b33fb265f..79f5da092f 100644
@@ -437,11 +437,11 @@ static void test_acpi_asl(test_data *data)
         g_assert(!err || exp_err);
 
         if (g_strcmp0(asl->str, exp_asl->str)) {
+            sdt->tmp_files_retain = true;
             if (exp_err) {
                 fprintf(stderr,
                         "Warning! iasl couldn't parse the expected aml\n");
             } else {
-                sdt->tmp_files_retain = true;
                 exp_sdt->tmp_files_retain = true;
                 fprintf(stderr,
                         "acpi-test: Warning! %.4s mismatch. "
Signature · 1 line
MST
#2 lore raw

[PULL 1/3] libvhost-user: Zero memory allocated for VuVirtqInflightDesc

In reply to Michael S. Tsirkin

From: Xie Yongji <[email protected]>

Use a zero-initialized VuVirtqInflightDesc struct to avoid that scan-build reports that vq->resubmit_list[0].counter may be garbage value in vu_check_queue_inflights().

Fixes 5f9ff1eff ("libvhost-user: Support tracking inflight I/O in

shared memory")

Message-Id: <[email protected]>

---
 contrib/libvhost-user/libvhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/libvhost-user/libvhost-user.c +1 -1
index 68c27136ae..ec27b78ff1 100644
@@ -992,7 +992,7 @@ vu_check_queue_inflights(VuDev *dev, VuVirtq *vq)
     vq->shadow_avail_idx = vq->last_avail_idx = vq->inuse + vq->used_idx;
 
     if (vq->inuse) {
-        vq->resubmit_list = malloc(sizeof(VuVirtqInflightDesc) * vq->inuse);
+        vq->resubmit_list = calloc(vq->inuse, sizeof(VuVirtqInflightDesc));
         if (!vq->resubmit_list) {
             return -1;
         }
Signature · 1 line
MST
#3 lore raw

[PULL 2/3] vhost-user-input: use free(elem) instead of g_free(elem)

In reply to Michael S. Tsirkin

From: Stefan Hajnoczi <[email protected]>

The virtqueue element returned by vu_queue_pop() is allocated using malloc(3) by virtqueue_alloc_element(). Use the matching free(3) function instead of glib's g_free().

Message-Id: <[email protected]>

---
 contrib/vhost-user-input/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
contrib/vhost-user-input/main.c +2 -2
index 449fd2171a..ef4b7769f2 100644
@@ -77,7 +77,7 @@ static void vi_input_send(VuInput *vi, struct virtio_input_event *event)
         len = iov_from_buf(elem->in_sg, elem->in_num,
                            0, &vi->queue[i].event, sizeof(virtio_input_event));
         vu_queue_push(dev, vq, elem, len);
-        g_free(elem);
+        free(elem);
     }
 
     vu_queue_notify(&vi->dev.parent, vq);
@@ -153,7 +153,7 @@ static void vi_handle_sts(VuDev *dev, int qidx)
                          0, &event, sizeof(event));
         vi_handle_status(vi, &event);
         vu_queue_push(dev, vq, elem, len);
-        g_free(elem);
+        free(elem);
     }
 
     vu_queue_notify(&vi->dev.parent, vq);
Signature · 1 line
MST
#4 lore raw
In reply to Michael S. Tsirkin
Quoted 24 lines · Michael S. Tsirkin

The following changes since commit 39e2821077e6dcf788b7c2a9ef50970ec7995437:

Update version for v4.2.0-rc2 release (2019-11-19 19:34:10 +0000)

are available in the Git repository at:

git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to 6c77aa909e0eec6531e2398d0e9e60ec6a9339c6:

tests: acpi: always retain dumped ACPI tables in case of error (2019-11-20 04:57:22 -0500)

----------------------------------------------------------------
virtio, acpi: fixes

A couple of bugfixes.

----------------------------------------------------------------
Igor Mammedov (1):
tests: acpi: always retain dumped ACPI tables in case of error

Quoted 5 lines

Stefan Hajnoczi (1):
vhost-user-input: use free(elem) instead of g_free(elem)

Xie Yongji (1):
libvhost-user: Zero memory allocated for VuVirtqInflightDesc

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.

-- PMM