From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, Fam Zheng <famz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 25/56] block: Drop bdrv_ioctl_bh_cb
Date: Mon, 8 Aug 2016 16:03:56 -0500 [thread overview]
Message-ID: <1470690267-31454-26-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1470690267-31454-1-git-send-email-mdroth@linux.vnet.ibm.com>
From: Fam Zheng <famz@redhat.com>
Similar to the "!drv || !drv->bdrv_aio_ioctl" case above, here it is
okay to set co.ret and return. As pointed out by Paolo, a BH will be
created as necessary by the caller (bdrv_co_maybe_schedule_bh).
Besides, as pointed out by Kevin, "data" was leaked before.
Reported-by: Kevin Wolf <kwolf@redhat.com>
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20160601015223.19277-1-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit c8a9fd80719e63615dac12e3625223fb54aa8430)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/io.c | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/block/io.c b/block/io.c
index a7dbf85..d02e0d5 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2595,19 +2595,6 @@ int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors)
return rwco.ret;
}
-typedef struct {
- CoroutineIOCompletion *co;
- QEMUBH *bh;
-} BdrvIoctlCompletionData;
-
-static void bdrv_ioctl_bh_cb(void *opaque)
-{
- BdrvIoctlCompletionData *data = opaque;
-
- bdrv_co_io_em_complete(data->co, -ENOTSUP);
- qemu_bh_delete(data->bh);
-}
-
static int bdrv_co_do_ioctl(BlockDriverState *bs, int req, void *buf)
{
BlockDriver *drv = bs->drv;
@@ -2625,11 +2612,8 @@ static int bdrv_co_do_ioctl(BlockDriverState *bs, int req, void *buf)
acb = drv->bdrv_aio_ioctl(bs, req, buf, bdrv_co_io_em_complete, &co);
if (!acb) {
- BdrvIoctlCompletionData *data = g_new(BdrvIoctlCompletionData, 1);
- data->bh = aio_bh_new(bdrv_get_aio_context(bs),
- bdrv_ioctl_bh_cb, data);
- data->co = &co;
- qemu_bh_schedule(data->bh);
+ co.ret = -ENOTSUP;
+ goto out;
}
qemu_coroutine_yield();
out:
--
1.9.1
next prev parent reply other threads:[~2016-08-08 21:05 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 21:03 [Qemu-devel] [PATCH 00/56] Patch Round-up for stable 2.6.1, freeze on 2016-08-12 Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 01/56] i386: kvmvapic: initialise imm32 variable Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 02/56] spice/gl: add & use qemu_spice_gl_monitor_config Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 03/56] vl: change runstate only if new state is different from current state Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 04/56] tools: kvm_stat: Powerpc related fixes Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 05/56] exec.c: Ensure right alignment also for file backed ram Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 06/56] usb:xhci: no DMA on HC reset Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 07/56] target-mips: fix call to memset in soft reset code Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 08/56] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2 Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 09/56] configure: Allow builds with extra warnings Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 10/56] migration: regain control of images when migration fails to complete Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 11/56] json-streamer: Don't leak tokens on incomplete parse Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 12/56] json-streamer: fix double-free on exiting during a parse Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 13/56] esp: check command buffer length before write(CVE-2016-4439) Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 14/56] esp: check dma length before reading scsi command(CVE-2016-4441) Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 15/56] block/nfs: refuse readahead if cache.direct is on Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 16/56] usb/ohci: Fix crash with when specifying too many num-ports Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 17/56] vga: add sr_vbe register set Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 18/56] vfio: Fix broken EEH Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 19/56] block/iscsi: avoid potential overflow of acb->task->cdb Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 20/56] nbd: Don't trim unrequested bytes Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 21/56] savevm: fail if migration blockers are present Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 22/56] Fix configure test for PBKDF2 in nettle Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 23/56] scsi: pvscsi: check command descriptor ring buffer size (CVE-2016-4952) Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 24/56] scsi: mptsas: infinite loop while fetching requests Michael Roth
2016-08-08 21:03 ` Michael Roth [this message]
2016-08-08 21:03 ` [Qemu-devel] [PATCH 26/56] vmsvga: move fifo sanity checks to vmsvga_fifo_length Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 27/56] vmsvga: add more fifo checks Michael Roth
2016-08-08 21:03 ` [Qemu-devel] [PATCH 28/56] vmsvga: shadow fifo registers Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 29/56] vmsvga: don't process more than 1024 fifo commands at once Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 30/56] io: remove mistaken call to object_ref on QTask Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 31/56] ui: fix regression in printing VNC host/port on startup Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 32/56] net: fix qemu_announce_self not emitting packets Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 33/56] backup: Don't leak BackupBlockJob in error path Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 34/56] qcow2: Avoid making the L1 table too big Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 35/56] qapi: Fix crash on missing alternate member of QAPI struct Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 36/56] pci-assign: Move "Invalid ROM" error message to pci-assign-load-rom.c Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 37/56] vfio/pci: Fix VGA quirks Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 38/56] nbd: Allow larger requests Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 39/56] scsi-generic: Merge block max xfer len in INQUIRY response Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 40/56] scsi: Advertise limits by blocksize, not 512 Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 41/56] target-sparc: fix register corruption in ldstub if there is no write permission Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 42/56] virtio: set low features early on load Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 43/56] Revert "virtio-net: unbreak self announcement and guest offloads after migration" Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 44/56] s390x/ipl: fix reboots for migration from different bios Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 45/56] blockdev: Fix regression with the default naming of throttling groups Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 46/56] qemu-iotests: Test " Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 47/56] util: Fix MIN_NON_ZERO Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 48/56] block/iscsi: fix rounding in iscsi_allocationmap_set Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 49/56] Fix some typos found by codespell Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 50/56] nbd: More debug typo fixes, use correct formats Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 51/56] nbd: Don't use *_to_cpup() functions Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 52/56] nbd: Limit nbdflags to 16 bits Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 53/56] pcie: fix link active status bit migration Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 54/56] target-i386: fix typo in xsetbv implementation Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 55/56] virtio: error out if guest exceeds virtqueue size Michael Roth
2016-08-08 21:04 ` [Qemu-devel] [PATCH 56/56] ide: fix halted IO segfault at reset Michael Roth
2016-08-09 18:34 ` John Snow
2016-08-08 23:40 ` [Qemu-devel] [Qemu-stable] [PATCH 00/56] Patch Round-up for stable 2.6.1, freeze on 2016-08-12 Cole Robinson
2016-08-09 20:04 ` Michael Roth
2016-08-13 1:43 ` Gonglei
2016-08-09 20:12 ` [Qemu-devel] " Bruce Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470690267-31454-26-git-send-email-mdroth@linux.vnet.ibm.com \
--to=mdroth@linux.vnet.ibm.com \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).