qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/3] virtio, acpi: fixes
@ 2019-11-20  9:59 Michael S. Tsirkin
  2019-11-20  9:59 ` [PULL 1/3] libvhost-user: Zero memory allocated for VuVirtqInflightDesc Michael S. Tsirkin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2019-11-20  9:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

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.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
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(-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PULL 1/3] libvhost-user: Zero memory allocated for VuVirtqInflightDesc
  2019-11-20  9:59 [PULL 0/3] virtio, acpi: fixes Michael S. Tsirkin
@ 2019-11-20  9:59 ` Michael S. Tsirkin
  2019-11-20  9:59 ` [PULL 2/3] vhost-user-input: use free(elem) instead of g_free(elem) Michael S. Tsirkin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2019-11-20  9:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Xie Yongji, Zhang Yu, Gerd Hoffmann,
	Marc-André Lureau

From: Xie Yongji <xieyongji@baidu.com>

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")
Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Xie Yongji <xieyongji@baidu.com>
Message-Id: <20191119075759.4334-1-xieyongji@baidu.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 contrib/libvhost-user/libvhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index 68c27136ae..ec27b78ff1 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -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;
         }
-- 
MST



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PULL 2/3] vhost-user-input: use free(elem) instead of g_free(elem)
  2019-11-20  9:59 [PULL 0/3] virtio, acpi: fixes Michael S. Tsirkin
  2019-11-20  9:59 ` [PULL 1/3] libvhost-user: Zero memory allocated for VuVirtqInflightDesc Michael S. Tsirkin
@ 2019-11-20  9:59 ` Michael S. Tsirkin
  2019-11-20  9:59 ` [PULL 3/3] tests: acpi: always retain dumped ACPI tables in case of error Michael S. Tsirkin
  2019-11-21 11:27 ` [PULL 0/3] virtio, acpi: fixes Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2019-11-20  9:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Philippe Mathieu-Daudé,
	Gerd Hoffmann, Stefan Hajnoczi

From: Stefan Hajnoczi <stefanha@redhat.com>

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().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20191119111626.112206-1-stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 contrib/vhost-user-input/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
index 449fd2171a..ef4b7769f2 100644
--- a/contrib/vhost-user-input/main.c
+++ b/contrib/vhost-user-input/main.c
@@ -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);
-- 
MST



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PULL 3/3] tests: acpi: always retain dumped ACPI tables in case of error
  2019-11-20  9:59 [PULL 0/3] virtio, acpi: fixes Michael S. Tsirkin
  2019-11-20  9:59 ` [PULL 1/3] libvhost-user: Zero memory allocated for VuVirtqInflightDesc Michael S. Tsirkin
  2019-11-20  9:59 ` [PULL 2/3] vhost-user-input: use free(elem) instead of g_free(elem) Michael S. Tsirkin
@ 2019-11-20  9:59 ` Michael S. Tsirkin
  2019-11-21 11:27 ` [PULL 0/3] virtio, acpi: fixes Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2019-11-20  9:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Peter Maydell, Thomas Huth, Paolo Bonzini, Igor Mammedov

From: Igor Mammedov <imammedo@redhat.com>

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.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1574240560-12538-1-git-send-email-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 0b33fb265f..79f5da092f 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -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. "
-- 
MST



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PULL 0/3] virtio, acpi: fixes
  2019-11-20  9:59 [PULL 0/3] virtio, acpi: fixes Michael S. Tsirkin
                   ` (2 preceding siblings ...)
  2019-11-20  9:59 ` [PULL 3/3] tests: acpi: always retain dumped ACPI tables in case of error Michael S. Tsirkin
@ 2019-11-21 11:27 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2019-11-21 11:27 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: QEMU Developers

On Wed, 20 Nov 2019 at 09:59, Michael S. Tsirkin <mst@redhat.com> wrote:
>
> 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.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> ----------------------------------------------------------------
> 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


Applied, thanks.

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

-- PMM


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-21 11:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20  9:59 [PULL 0/3] virtio, acpi: fixes Michael S. Tsirkin
2019-11-20  9:59 ` [PULL 1/3] libvhost-user: Zero memory allocated for VuVirtqInflightDesc Michael S. Tsirkin
2019-11-20  9:59 ` [PULL 2/3] vhost-user-input: use free(elem) instead of g_free(elem) Michael S. Tsirkin
2019-11-20  9:59 ` [PULL 3/3] tests: acpi: always retain dumped ACPI tables in case of error Michael S. Tsirkin
2019-11-21 11:27 ` [PULL 0/3] virtio, acpi: fixes Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).