* [PULL 0/3] xen queue for 5.0
@ 2020-04-07 15:22 Anthony PERARD
2020-04-07 15:22 ` [PULL 1/3] hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete() Anthony PERARD
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Anthony PERARD @ 2020-04-07 15:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, xen-devel
The following changes since commit 8f0d25c464a1989d606f7b988d07b1147dfcde33:
Merge remote-tracking branch 'remotes/philmd-gitlab/tags/acceptance-fixes-20200407' into staging (2020-04-07 15:10:11 +0100)
are available in the Git repository at:
https://xenbits.xen.org/git-http/people/aperard/qemu-dm.git tags/pull-xen-20200407
for you to fetch changes up to 758af9cfabfb000eb00e42b9738e655b18fdd812:
MAINTAINERS: Add xen-usb.c to Xen section (2020-04-07 16:13:26 +0100)
----------------------------------------------------------------
Xen queue for QEMU 5.0
- Fix for xen-block.
- A fix for a Coverity false positive in xen-usb.
- Update MAINTAINERS to add xen-usb.c to Xen section.
----------------------------------------------------------------
Anthony PERARD (2):
xen-block: Fix uninitialized variable
MAINTAINERS: Add xen-usb.c to Xen section
Peter Maydell (1):
hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete()
MAINTAINERS | 1 +
hw/block/xen-block.c | 2 +-
hw/usb/xen-usb.c | 10 ++++------
3 files changed, 6 insertions(+), 7 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PULL 1/3] hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete()
2020-04-07 15:22 [PULL 0/3] xen queue for 5.0 Anthony PERARD
@ 2020-04-07 15:22 ` Anthony PERARD
2020-04-07 15:22 ` [PULL 2/3] xen-block: Fix uninitialized variable Anthony PERARD
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Anthony PERARD @ 2020-04-07 15:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, xen-devel
From: Peter Maydell <peter.maydell@linaro.org>
The function usbback_packet_complete() currently takes a USBPacket*,
which must be a pointer to the packet field within a struct
usbback_req; the function uses container_of() to get the struct
usbback_req* given the USBPacket*.
This is unnecessarily confusing (and in particular it confuses the
Coverity Scan analysis, resulting in the false positive CID 1421919
where it thinks that we write off the end of the structure). Since
both callsites already have the pointer to the struct usbback_req,
just pass that in directly.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20200323164318.26567-1-peter.maydell@linaro.org>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
hw/usb/xen-usb.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 1fc2f32ce93d..961190d0f78c 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -347,13 +347,11 @@ static int32_t usbback_xlat_status(int status)
return -ESHUTDOWN;
}
-static void usbback_packet_complete(USBPacket *packet)
+static void usbback_packet_complete(struct usbback_req *usbback_req)
{
- struct usbback_req *usbback_req;
+ USBPacket *packet = &usbback_req->packet;
int32_t status;
- usbback_req = container_of(packet, struct usbback_req, packet);
-
QTAILQ_REMOVE(&usbback_req->stub->submit_q, usbback_req, q);
status = usbback_xlat_status(packet->status);
@@ -566,7 +564,7 @@ static void usbback_dispatch(struct usbback_req *usbback_req)
usb_handle_packet(usbback_req->stub->dev, &usbback_req->packet);
if (usbback_req->packet.status != USB_RET_ASYNC) {
- usbback_packet_complete(&usbback_req->packet);
+ usbback_packet_complete(usbback_req);
}
return;
@@ -993,7 +991,7 @@ static void xen_bus_complete(USBPort *port, USBPacket *packet)
usbif = usbback_req->usbif;
TR_REQ(&usbif->xendev, "\n");
- usbback_packet_complete(packet);
+ usbback_packet_complete(usbback_req);
}
static USBPortOps xen_usb_port_ops = {
--
Anthony PERARD
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PULL 2/3] xen-block: Fix uninitialized variable
2020-04-07 15:22 [PULL 0/3] xen queue for 5.0 Anthony PERARD
2020-04-07 15:22 ` [PULL 1/3] hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete() Anthony PERARD
@ 2020-04-07 15:22 ` Anthony PERARD
2020-04-07 15:22 ` [PULL 3/3] MAINTAINERS: Add xen-usb.c to Xen section Anthony PERARD
2020-04-07 21:11 ` [PULL 0/3] xen queue for 5.0 Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Anthony PERARD @ 2020-04-07 15:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, xen-devel
Since 7f5d9b206d1e ("object-add: don't create return value if
failed"), qmp_object_add() don't write any value in 'ret_data', thus
has random data. Then qobject_unref() fails and abort().
Fix by initialising 'ret_data' properly.
Fixes: 5f07c4d60d09 ("qapi: Flatten object-add")
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200406164207.1446817-1-anthony.perard@citrix.com>
---
hw/block/xen-block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 07bb32e22b51..99cb4c67cb09 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -860,7 +860,7 @@ static XenBlockIOThread *xen_block_iothread_create(const char *id,
XenBlockIOThread *iothread = g_new(XenBlockIOThread, 1);
Error *local_err = NULL;
QDict *opts;
- QObject *ret_data;
+ QObject *ret_data = NULL;
iothread->id = g_strdup(id);
--
Anthony PERARD
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PULL 3/3] MAINTAINERS: Add xen-usb.c to Xen section
2020-04-07 15:22 [PULL 0/3] xen queue for 5.0 Anthony PERARD
2020-04-07 15:22 ` [PULL 1/3] hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete() Anthony PERARD
2020-04-07 15:22 ` [PULL 2/3] xen-block: Fix uninitialized variable Anthony PERARD
@ 2020-04-07 15:22 ` Anthony PERARD
2020-04-07 21:11 ` [PULL 0/3] xen queue for 5.0 Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Anthony PERARD @ 2020-04-07 15:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, xen-devel
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Paul Durrant <paul@xen.org>
Message-Id: <20200406165043.1447837-1-anthony.perard@citrix.com>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 9d156d73b31e..839959f7e4ac 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -440,6 +440,7 @@ F: hw/9pfs/xen-9p*
F: hw/char/xen_console.c
F: hw/display/xenfb.c
F: hw/net/xen_nic.c
+F: hw/usb/xen-usb.c
F: hw/block/xen*
F: hw/block/dataplane/xen*
F: hw/xen/
--
Anthony PERARD
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PULL 0/3] xen queue for 5.0
2020-04-07 15:22 [PULL 0/3] xen queue for 5.0 Anthony PERARD
` (2 preceding siblings ...)
2020-04-07 15:22 ` [PULL 3/3] MAINTAINERS: Add xen-usb.c to Xen section Anthony PERARD
@ 2020-04-07 21:11 ` Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2020-04-07 21:11 UTC (permalink / raw)
To: Anthony PERARD; +Cc: open list:X86, QEMU Developers
On Tue, 7 Apr 2020 at 16:22, Anthony PERARD <anthony.perard@citrix.com> wrote:
>
> The following changes since commit 8f0d25c464a1989d606f7b988d07b1147dfcde33:
>
> Merge remote-tracking branch 'remotes/philmd-gitlab/tags/acceptance-fixes-20200407' into staging (2020-04-07 15:10:11 +0100)
>
> are available in the Git repository at:
>
> https://xenbits.xen.org/git-http/people/aperard/qemu-dm.git tags/pull-xen-20200407
>
> for you to fetch changes up to 758af9cfabfb000eb00e42b9738e655b18fdd812:
>
> MAINTAINERS: Add xen-usb.c to Xen section (2020-04-07 16:13:26 +0100)
>
> ----------------------------------------------------------------
> Xen queue for QEMU 5.0
>
> - Fix for xen-block.
> - A fix for a Coverity false positive in xen-usb.
> - Update MAINTAINERS to add xen-usb.c to Xen section.
>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-04-07 21:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-07 15:22 [PULL 0/3] xen queue for 5.0 Anthony PERARD
2020-04-07 15:22 ` [PULL 1/3] hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete() Anthony PERARD
2020-04-07 15:22 ` [PULL 2/3] xen-block: Fix uninitialized variable Anthony PERARD
2020-04-07 15:22 ` [PULL 3/3] MAINTAINERS: Add xen-usb.c to Xen section Anthony PERARD
2020-04-07 21:11 ` [PULL 0/3] xen queue for 5.0 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).