Re: [Qemu-block] [PATCH] blockdev: warn about aio=native if libaio is unavailable

2015-07-17 Thread Stefan Hajnoczi
On Fri, Jul 17, 2015 at 12:56:15PM +0200, Kevin Wolf wrote: Am 17.07.2015 um 11:59 hat Stefan Hajnoczi geschrieben: QEMU silently ignores aio=native if libaio is unavailable. It is confusing when aio=native performance is identical to aio=threads because the binary was accidentally built

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-13 Thread Stefan Hajnoczi
On Fri, Jul 10, 2015 at 08:46:44AM +0800, Fam Zheng wrote: On Wed, 07/08 11:58, Stefan Hajnoczi wrote: On Wed, Jul 08, 2015 at 09:01:27AM +0800, Fam Zheng wrote: On Tue, 07/07 16:08, Stefan Hajnoczi wrote: +#define EPOLL_BATCH 128 +static bool aio_poll_epoll(AioContext *ctx, bool

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] blockjob: Introduce block_job_relax_cpu

2015-07-14 Thread Stefan Hajnoczi
On Fri, Jul 10, 2015 at 05:42:48AM +0200, Alexandre DERUMIER wrote: By the way, why did you choose 10 milliseconds? That is quite long. If this function is called once per 10 ms disk I/O operations then we lose 50% utilization. 1 ms or less would be reasonable. From my tests, 1ms is not

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] mirror: Speed up bitmap initial scanning

2015-07-14 Thread Stefan Hajnoczi
On Thu, Jul 09, 2015 at 11:47:58AM +0800, Fam Zheng wrote: Limiting to sectors_per_chunk for each bdrv_is_allocated_above is slow, because the underlying protocol driver would issue much more queries than necessary. We should coalesce the query. Signed-off-by: Fam Zheng f...@redhat.com ---

Re: [Qemu-block] [PATCH] raw-posix.c: Make physical devices usable in QEMU

2015-07-16 Thread Stefan Hajnoczi
On Thu, Jul 16, 2015 at 6:26 PM, Programmingkid programmingk...@gmail.com wrote: On Jul 16, 2015, at 9:19 AM, Stefan Hajnoczi wrote: On Thu, Jul 09, 2015 at 10:02:26AM -0400, Programmingkid wrote: On Jul 9, 2015, at 6:52 AM, Stefan Hajnoczi wrote: On Tue, Jul 07, 2015 at 01:33:23PM -0400

[Qemu-block] [PATCH] blockdev: warn about aio=native if libaio is unavailable

2015-07-17 Thread Stefan Hajnoczi
=native who would be inconvenienced if QEMU suddenly refused to start their guests. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- blockdev.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 62a4586..f30828a 100644 --- a/blockdev.c

Re: [Qemu-block] [PATCH v2] raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-07-20 Thread Stefan Hajnoczi
On Fri, Jul 17, 2015 at 03:24:34PM -0400, Programmingkid wrote: On Jul 17, 2015, at 9:41 AM, Stefan Hajnoczi wrote: On Thu, Jul 16, 2015 at 04:46:07PM -0400, Programmingkid wrote: @@ -2014,7 +2015,9 @@ kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex ma

[Qemu-block] [PATCH] virtio-blk: use blk_io_plug/unplug for Linux AIO batching

2015-07-20 Thread Stefan Hajnoczi
Surisetty psuri...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- hw/block/virtio-blk.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 6aefda4..a2137c8 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -600,6

Re: [Qemu-block] [PATCH v7 05/10] block: Introduce "drained begin/end" API

2015-10-23 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 11:08:09AM +0800, Fam Zheng wrote: > +void bdrv_drained_begin(BlockDriverState *bs) > +{ > +if (!bs->quiesce_counter++) { > +aio_disable_external(bdrv_get_aio_context(bs)); > +} > +bdrv_drain(bs); > +} > + > +void bdrv_drained_end(BlockDriverState *bs) >

Re: [Qemu-block] [PATCH v3 09/21] block: Add average I/O queue depth to BlockDeviceTimedStats

2015-10-23 Thread Stefan Hajnoczi
On Thu, Oct 22, 2015 at 11:11:19AM +0300, Alberto Garcia wrote: > +/* Get the sum of all accounted values > + * @ta: the TimedAverage structure > + * @elapsed: if non-NULL, the elapsed time (in ns) will be stored here > + * @ret: the sum of all accounted values > + */ > +uint64_t

Re: [Qemu-block] [PATCH v3 08/21] block: Compute minimum, maximum and average I/O latencies

2015-10-23 Thread Stefan Hajnoczi
On Thu, Oct 22, 2015 at 11:11:18AM +0300, Alberto Garcia wrote: > +struct BlockAcctTimedStats { > +TimedAverage latency[BLOCK_MAX_IOTYPE]; > +unsigned interval_length; /* in seconds */ would be nice here so the units are clear. Or even interval_length_secs.

Re: [Qemu-block] [PATCH v3 00/21] Extended I/O accounting

2015-10-23 Thread Stefan Hajnoczi
On Thu, Oct 22, 2015 at 11:11:10AM +0300, Alberto Garcia wrote: > Here's a new version of the extended I/O accounting patches. > > This one is rebased on top of the current master, has a few minor > documentation fixes and drops the 'supports_stats' field completely. Looks good overall. I

Re: [Qemu-block] [Qemu-devel] [RFC] transactions: add transaction-wide property

2015-10-22 Thread Stefan Hajnoczi
Thanks for summarizing the discussion! If you are taking over Fam's series, please squash in your patches to make review easier. Maybe the names can be improved: "allow-partial" is not self-explanatory. "sync-cancel" is misleading since successful completion is affected too, not just

Re: [Qemu-block] [PATCH] block/nfs: add support for setting debug level

2015-10-26 Thread Stefan Hajnoczi
On Thu, Oct 22, 2015 at 08:37:19AM +0200, Peter Lieven wrote: > Am 22.09.2015 um 08:13 schrieb Peter Lieven: > >Am 25.06.2015 um 15:18 schrieb Stefan Hajnoczi: > >>On Tue, Jun 23, 2015 at 10:12:15AM +0200, Peter Lieven wrote: > >>>upcoming libnfs versions will suppo

Re: [Qemu-block] [PATCH 0/2] blkverify: Fix BDS leak in .bdrv_open error path

2015-10-26 Thread Stefan Hajnoczi
rtions(+), 1 deletion(-) > > -- > 1.8.3.1 > > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [PATCH V2 0/4] ide: avoid main-loop hang on CDROM/NFS failure

2015-10-26 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 02:27:21PM +0200, Peter Lieven wrote: > This series aims at avoiding a hanging main-loop if a vserver has a > CDROM image mounted from a NFS share and that NFS share goes down. > Typical situation is that users mount an CDROM ISO to install something > and then forget to

Re: [Qemu-block] [PATCH 3/4] ide: add support for cancelable read requests

2015-10-28 Thread Stefan Hajnoczi
On Tue, Oct 27, 2015 at 11:58:55AM +0100, Peter Lieven wrote: > Am 26.10.2015 um 11:39 schrieb Stefan Hajnoczi: > >On Mon, Oct 12, 2015 at 02:27:24PM +0200, Peter Lieven wrote: > >>+BlockAIOCB *ide_readv_cancelable(IDEState *s, int64_t sector_num, > >>+

Re: [Qemu-block] [PATCH v3 0/2] aio: Use epoll in aio_poll()

2015-10-29 Thread Stefan Hajnoczi
On Mon, Oct 26, 2015 at 02:39:40PM +0800, Fam Zheng wrote: > v3: Remove the redundant check in aio_epoll_try_enable. [Stefan] > > v2: Merge aio-epoll.c into aio-posix.c. [Paolo] > Capture some benchmark data in commit log. > > This series adds the ability to use epoll in aio_poll() on Linux.

Re: [Qemu-block] [PATCH v3 0/2] aio: Use epoll in aio_poll()

2015-10-29 Thread Stefan Hajnoczi
On Mon, Oct 26, 2015 at 02:39:40PM +0800, Fam Zheng wrote: > v3: Remove the redundant check in aio_epoll_try_enable. [Stefan] > > v2: Merge aio-epoll.c into aio-posix.c. [Paolo] > Capture some benchmark data in commit log. > > This series adds the ability to use epoll in aio_poll() on Linux.

Re: [Qemu-block] [PATCH] ide: remove hardcoded 2GiB transactional limit

2015-10-27 Thread Stefan Hajnoczi
| 30 ++ > hw/ide/internal.h | 2 +- > hw/ide/pci.c | 7 --- > 3 files changed, 15 insertions(+), 24 deletions(-) Acked-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [PATCH v7 05/10] block: Introduce "drained begin/end" API

2015-10-23 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 11:08:09AM +0800, Fam Zheng wrote: > +/** > + * bdrv_drained_begin: > + * > + * Begin a quiesced section for exclusive access to the BDS, by disabling > + * external request sources including NBD server and device model. Note that > + * this doesn't block timers or

Re: [Qemu-block] [PATCH v7 00/10] block: Protect nested event loop with bdrv_drained_begin and bdrv_drained_end

2015-10-23 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 11:08:04AM +0800, Fam Zheng wrote: > v7: Exclude bdrv_drain and bdrv_qed_drain patches, they'll follow the > bdrv_drain fix for bdrv_aio_flush. > Fix internal snapshot clean. > > v6: Add Kevin's rev-by in patches 1-3, 6-8, 10, 12. > Add Jeff's rev-by in patches

Re: [Qemu-block] [PATCH 1/4] ide/atapi: make PIO read requests async

2015-10-22 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 02:27:22PM +0200, Peter Lieven wrote: > @@ -129,9 +134,71 @@ static int cd_read_sector(IDEState *s, int lba, uint8_t > *buf, int sector_size) > ret = -EIO; > break; > } > + > +if (!ret) { > +s->lba++; This function probably shouldn't

Re: [Qemu-block] [PATCH v3] virtio-blk: trivial code optimization

2015-11-09 Thread Stefan Hajnoczi
On Mon, Nov 09, 2015 at 05:03:30PM +0800, arei.gong...@huawei.com wrote: > From: Gonglei > > 1. avoid possible superflous checking > 2. make code more robustness > > Signed-off-by: Gonglei > Reviewed-by: Fam Zheng > --- > v3:

Re: [Qemu-block] [PULL v2 39/40] iotests: Add tests for the x-blockdev-del command

2015-11-10 Thread Stefan Hajnoczi
On Tue, Nov 10, 2015 at 2:09 PM, Kevin Wolf wrote: > From: Alberto Garcia > > Signed-off-by: Alberto Garcia > Message-id: > 57c3b0d4d0c73ddadd19e5bded9492c359cc4568.1446475331.git.be...@igalia.com > Reviewed-by: Max Reitz

Re: [Qemu-block] [PATCH v4 00/21] Extended I/O accounting

2015-11-10 Thread Stefan Hajnoczi
On Wed, Oct 28, 2015 at 05:32:57PM +0200, Alberto Garcia wrote: > Here's v4 of the series that implements extended I/O accounting for > block devices. > > Since part of Max's BlockBackend series has already been merged, this > series can now be applied cleanly on top of the master branch without

Re: [Qemu-block] [PATCH v4 0/9] block: Fixes for bdrv_drain

2015-11-09 Thread Stefan Hajnoczi
On Mon, Nov 09, 2015 at 06:16:45PM +0800, Fam Zheng wrote: > v4: Don't miss children's children. [Paolo] > > v3: Don't reuse coroutine in bdrv_aio_ioctl. [Stefan] > Recursely call .bdrv_drain callback only. [Stefan, Paolo] > Added Kevin's reviewed-by in other patches. > > v2: Add Kevin's

Re: [Qemu-block] [PATCH v3] virtio-blk: trivial code optimization

2015-11-10 Thread Stefan Hajnoczi
On Tue, Nov 10, 2015 at 02:35:19PM +0800, Gonglei wrote: > On 2015/11/9 21:57, Stefan Hajnoczi wrote: > > On Mon, Nov 09, 2015 at 05:03:30PM +0800, arei.gong...@huawei.com wrote: > >> From: Gonglei <arei.gong...@huawei.com> > >> > >> 1. avoid possible

Re: [Qemu-block] [PATCH v6 0/4] qapi: child add/delete support

2015-11-13 Thread Stefan Hajnoczi
On Fri, Nov 13, 2015 at 5:37 PM, Wen Congyang <we...@cn.fujitsu.com> wrote: > On 11/13/2015 05:28 PM, Stefan Hajnoczi wrote: >> On Fri, Oct 30, 2015 at 02:11:30PM +0800, Wen Congyang wrote: >>> Ping... >> >> Tips for faster code review: >> >

Re: [Qemu-block] [PATCH v6 0/4] qapi: child add/delete support

2015-11-13 Thread Stefan Hajnoczi
On Fri, Oct 30, 2015 at 02:11:30PM +0800, Wen Congyang wrote: > Ping... Tips for faster code review: It helps to mention the specific person you are expecting review from when the CC list is long. For example, "Kevin: ping". Keeping the CC list short can result in faster code review than a

Re: [Qemu-block] [PATCH V5] block/nfs: add support for setting debug level

2015-11-13 Thread Stefan Hajnoczi
On Mon, Nov 09, 2015 at 08:09:33AM +0100, Peter Lieven wrote: > recent libnfs versions support logging debug messages. Add > support for it in qemu through an URL parameter. > > Example: > qemu -cdrom nfs://127.0.0.1/iso/my.iso?debug=2 > > Signed-off-by: Peter Lieven > --- >

Re: [Qemu-block] [PULL v3 00/43] Block layer patches (Stefan's tree)

2015-11-12 Thread Stefan Hajnoczi
On Thu, Nov 12, 2015 at 05:26:43PM +0100, Alberto Garcia wrote: > On Thu, Nov 12, 2015 at 04:37:08PM +0100, Kevin Wolf wrote: > > The following changes since commit 17e50a72a3aade0eddfebc012a5d7bdd40a03573: > > > > Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' > > into

Re: [Qemu-block] [PULL v3 00/43] Block layer patches (Stefan's tree)

2015-11-12 Thread Stefan Hajnoczi
On Thu, Nov 12, 2015 at 04:37:08PM +0100, Kevin Wolf wrote: > The following changes since commit 17e50a72a3aade0eddfebc012a5d7bdd40a03573: > > Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into > staging (2015-11-12 14:15:32 +) > > are available in the git

Re: [Qemu-block] [PATCH V5] block/nfs: add support for setting debug level

2015-11-16 Thread Stefan Hajnoczi
On Fri, Nov 13, 2015 at 01:19:55PM -0500, Jeff Cody wrote: > On Fri, Nov 13, 2015 at 05:45:09PM +0800, Stefan Hajnoczi wrote: > > On Mon, Nov 09, 2015 at 08:09:33AM +0100, Peter Lieven wrote: > > > recent libnfs versions support logging debug messages. Add > > > sup

Re: [Qemu-block] [PATCH] block: make 'stats-intervals' a list of integers

2015-11-16 Thread Stefan Hajnoczi
On Fri, Nov 13, 2015 at 11:50:03AM +0100, Alberto Garcia wrote: > On Fri 13 Nov 2015 11:15:52 AM CET, Stefan Hajnoczi <stefa...@gmail.com> > wrote: > > blockdev.c: In function ‘blockdev_init’: > > blockdev.c:636:17: error: ‘length’ may be used uninitialized in this >

Re: [Qemu-block] [PATCH] block: make 'stats-intervals' a list of integers

2015-11-16 Thread Stefan Hajnoczi
On Wed, Nov 11, 2015 at 03:17:12PM +0200, Alberto Garcia wrote: > @@ -583,32 +592,48 @@ static BlockBackend *blockdev_init(const char *file, > QDict *bs_opts, > > block_acct_init(blk_get_stats(blk), account_invalid, account_failed); > > -if (stats_intervals) { > -

Re: [Qemu-block] [PATCH] docs: update bitmaps.md

2015-11-16 Thread Stefan Hajnoczi
On Tue, Nov 10, 2015 at 06:00:17PM -0500, John Snow wrote: > Include new error handling scenarios for 2.5. > > Signed-off-by: John Snow > --- > docs/bitmaps.md | 157 > > 1 file changed, 157 insertions(+) Thanks,

Re: [Qemu-block] [PATCH V5] block/nfs: add support for setting debug level

2015-11-16 Thread Stefan Hajnoczi
On Fri, Nov 13, 2015 at 10:52:49AM +0100, Peter Lieven wrote: > Am 13.11.2015 um 10:45 schrieb Stefan Hajnoczi: > > On Mon, Nov 09, 2015 at 08:09:33AM +0100, Peter Lieven wrote: > >> recent libnfs versions support logging debug messages. Add > >> support for it in qe

Re: [Qemu-block] [PATCH] aio-epoll: Fix use-after-free of node

2015-11-16 Thread Stefan Hajnoczi
On Mon, Nov 16, 2015 at 02:32:14PM +0800, Fam Zheng wrote: > aio_epoll_update needs the fields in node, so delay the free. > > Reported-by: Paolo Bonzini > Signed-off-by: Fam Zheng > --- > aio-posix.c | 6 +- > 1 file changed, 5 insertions(+), 1

Re: [Qemu-block] [PATCH for-2.5 v2 0/1] block: make 'stats-interval' an array of ints instead of a string

2015-11-16 Thread Stefan Hajnoczi
On Mon, Nov 16, 2015 at 11:28:37AM +0200, Alberto Garcia wrote: > Second version of the patch, following all suggestions by Stefan. > > v2: > - The code that parses the intervals has been moved to a separate > function > - Due to the previous change, the loop has been modified a bit and the >

Re: [Qemu-block] [PATCH v3] virtio-blk: Fix double completion for werror=stop

2015-11-17 Thread Stefan Hajnoczi
On Tue, Nov 17, 2015 at 06:20:11PM +0800, Fam Zheng wrote: > When a request R is absorbed by request M, it is appended to the > "mr_next" queue led by M, and is completed together with the completion > of M, in virtio_blk_rw_complete. > > During DMA restart in virtio_blk_dma_restart_bh, requests

Re: [Qemu-block] [PATCH v11 00/14] block: incremental backup transactions using BlockJobTxn

2015-11-10 Thread Stefan Hajnoczi
you will receive > an error for your troubles. > > Version 10 primarily changed V7's patches 10-11 and replaced them > with patches 10-12 that are cut a little differently. > > This is based on top of the work by Stefan Hajnoczi and Fam Zheng. > > Recap: motivation for

Re: [Qemu-block] [PATCH v3 0/9] block: Fixes for bdrv_drain

2015-11-09 Thread Stefan Hajnoczi
On Mon, Nov 09, 2015 at 10:56:39AM +0800, Fam Zheng wrote: > v3: Don't reuse coroutine in bdrv_aio_ioctl. [Stefan] > Recursely call .bdrv_drain callback only. [Stefan, Paolo] I don't understand this change. I thought you want .bdrv_drain() to be called on the whole tree, but the latest code

Re: [Qemu-block] [Qemu-devel] [PATCH] blockdev: acquire AioContext in hmp_commit()

2015-11-02 Thread Stefan Hajnoczi
On Sun, Nov 01, 2015 at 08:50:36PM +0300, Denis V. Lunev wrote: > On 10/30/2015 06:57 PM, Stefan Hajnoczi wrote: > >This one slipped through. Although we acquire AioContext when > >committing all devices we don't for just a single device. > > > >AioContext must be ac

Re: [Qemu-block] [PATCH v4 3/3] aio: Introduce aio-epoll.c

2015-11-02 Thread Stefan Hajnoczi
On Mon, Nov 02, 2015 at 10:32:54AM +0800, Fam Zheng wrote: > On Fri, 10/30 10:07, Stefan Hajnoczi wrote: > > On Fri, Oct 30, 2015 at 12:06:29PM +0800, Fam Zheng wrote: > > > To comply with aio_{disable,enable}_external, we always use ppoll when > > > aio_external_disab

Re: [Qemu-block] [PATCH 1/2] dataplane: simplify indirect descriptor read

2015-11-02 Thread Stefan Hajnoczi
On Wed, Oct 28, 2015 at 05:48:02PM +0200, Michael S. Tsirkin wrote: > Use address_space_read to make sure we handle the case of an indirect > descriptor crossing DIMM boundary correctly. > > Signed-off-by: Michael S. Tsirkin > --- > > Warning: compile-tested only. Test (with

Re: [Qemu-block] [PATCH 1/2] dataplane: simplify indirect descriptor read

2015-11-02 Thread Stefan Hajnoczi
On Wed, Oct 28, 2015 at 05:48:02PM +0200, Michael S. Tsirkin wrote: > Use address_space_read to make sure we handle the case of an indirect > descriptor crossing DIMM boundary correctly. > > Signed-off-by: Michael S. Tsirkin > --- > > Warning: compile-tested only. > >

Re: [Qemu-block] [PATCH v10 12/14] block: add transactional properties

2015-11-03 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 07:56:50PM -0400, John Snow wrote: > @@ -1732,6 +1757,10 @@ static void > block_dirty_bitmap_add_prepare(BlkActionState *common, > BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState, > common, common); > > +

Re: [Qemu-block] [PATCH v4 0/3] aio: Use epoll in aio_poll()

2015-11-03 Thread Stefan Hajnoczi
On Fri, Oct 30, 2015 at 12:06:26PM +0800, Fam Zheng wrote: > v4: Rebase onto master (with aio_disable_external): > Don't use epoll if aio_external_disabled(ctx); > Change assert on epoll_ctl return code to disable epoll; > Rerun benchmark; > > v3: Remove the redundant check in

Re: [Qemu-block] [PATCH v4 3/3] aio: Introduce aio-epoll.c

2015-10-30 Thread Stefan Hajnoczi
On Fri, Oct 30, 2015 at 12:06:29PM +0800, Fam Zheng wrote: > To comply with aio_{disable,enable}_external, we always use ppoll when > aio_external_disabled() is true. All file descriptors are added to the epoll fd. Does that mean epoll will report the same fds again after we come out of

Re: [Qemu-block] [Qemu-devel] [PATCH v10 12/14] block: add transactional properties

2015-11-05 Thread Stefan Hajnoczi
On Tue, Nov 03, 2015 at 12:27:19PM -0500, John Snow wrote: > > > On 11/03/2015 10:17 AM, Stefan Hajnoczi wrote: > > On Fri, Oct 23, 2015 at 07:56:50PM -0400, John Snow wrote: > >> @@ -1732,6 +1757,10 @@ static void > >> block_dirty_bitmap_a

Re: [Qemu-block] [PATCH v2 6/9] block: Emulate bdrv_ioctl with bdrv_aio_ioctl and track both

2015-11-05 Thread Stefan Hajnoczi
On Thu, Oct 29, 2015 at 10:14:23AM +0800, Fam Zheng wrote: > BlockAIOCB *bdrv_aio_ioctl(BlockDriverState *bs, > unsigned long int req, void *buf, > BlockCompletionFunc *cb, void *opaque) > { > -BlockDriver *drv = bs->drv; > +BlockAIOCBCoroutine *acb =

Re: [Qemu-block] [PATCH v2 8/9] block: Introduce BlockDriver.bdrv_drain callback

2015-11-05 Thread Stefan Hajnoczi
On Thu, Oct 29, 2015 at 10:14:25AM +0800, Fam Zheng wrote: > void bdrv_drain(BlockDriverState *bs) > { > +BdrvChild *child; > bool busy = true; > > +if (bs->drv && bs->drv->bdrv_drain) { > +bs->drv->bdrv_drain(bs); > +} > +QLIST_FOREACH(child, >children, next) { >

[Qemu-block] [PATCH] blockdev: acquire AioContext in hmp_commit()

2015-10-30 Thread Stefan Hajnoczi
This one slipped through. Although we acquire AioContext when committing all devices we don't for just a single device. AioContext must be acquired before calling bdrv_*() functions to synchronize access with other threads that may be using the AioContext. Signed-off-by: Stefan Hajnoczi <st

Re: [Qemu-block] [PATCH] virtio-blk: trivial code optimization

2015-11-06 Thread Stefan Hajnoczi
On Fri, Nov 06, 2015 at 09:04:57AM +0800, arei.gong...@huawei.com wrote: > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c > index 093e475..752586d 100644 > --- a/hw/block/virtio-blk.c > +++ b/hw/block/virtio-blk.c > @@ -409,18 +409,20 @@ void virtio_blk_submit_multireq(BlockBackend

Re: [Qemu-block] [Qemu-devel] [PATCH v10 12/14] block: add transactional properties

2015-11-06 Thread Stefan Hajnoczi
On Fri, Nov 06, 2015 at 09:32:19AM +0100, Kevin Wolf wrote: > Am 05.11.2015 um 19:52 hat John Snow geschrieben: > > > > > > On 11/05/2015 05:47 AM, Stefan Hajnoczi wrote: > > > On Tue, Nov 03, 2015 at 12:27:19PM -0500, John Snow wrote: > > >> > > &

Re: [Qemu-block] [PATCH V4] block/nfs: add support for setting debug level

2015-11-06 Thread Stefan Hajnoczi
On Thu, Nov 05, 2015 at 11:25:34PM +0100, Peter Lieven wrote: > recent libnfs versions support logging debug messages. Add > support for it in qemu through an URL parameter. > > Example: > qemu -cdrom nfs://127.0.0.1/iso/my.iso?debug=2 > --- > v3->v4: revert to the initial version, but limit max

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] dataplane: simplify indirect descriptor read

2015-10-30 Thread Stefan Hajnoczi
On Thu, Oct 29, 2015 at 11:28:05AM +0100, Igor Mammedov wrote: > On Wed, 28 Oct 2015 17:48:02 +0200 > "Michael S. Tsirkin" wrote: > > -struct vring_desc *desc_ptr; > > -MemoryRegion *mr; > > - > > /* Translate indirect descriptor */ > > -desc_ptr

Re: [Qemu-block] [PATCH 1/2] dataplane: simplify indirect descriptor read

2015-10-30 Thread Stefan Hajnoczi
mpile-tested only. > > hw/virtio/dataplane/vring.c | 28 ++-- > 1 file changed, 18 insertions(+), 10 deletions(-) Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> I will test and merge (together with your fixup patch squashed in) on Monday. Stefan signature.asc Description: PGP signature

Re: [Qemu-block] [PATCH v10 08/14] blockjob: Simplify block_job_finish_sync

2015-11-03 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 07:56:46PM -0400, John Snow wrote: > +block_job_ref(job); > finish(job, _err); > if (local_err) { > error_propagate(errp, local_err); > return -EBUSY; Refcount leak, missing block_job_unref(job). signature.asc Description: PGP signature

Re: [Qemu-block] [PATCH v4 3/3] aio: Introduce aio-epoll.c

2015-11-03 Thread Stefan Hajnoczi
On Mon, Nov 02, 2015 at 09:33:19PM +0800, Fam Zheng wrote: > On Mon, 11/02 13:19, Stefan Hajnoczi wrote: > > On Mon, Nov 02, 2015 at 10:32:54AM +0800, Fam Zheng wrote: > > > On Fri, 10/30 10:07, Stefan Hajnoczi wrote: > > > > On Fri, Oct 30, 2015 at 12:

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-14 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 05:08:17PM +0800, Wen Congyang wrote: > On 10/13/2015 12:27 AM, Stefan Hajnoczi wrote: > > On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > >> +/* start backup job now */ > >> +bdrv_op_unblock(s->hidden_dis

[Qemu-block] [PATCH] block: fix memory leak in early exit

2015-10-15 Thread Stefan Hajnoczi
ere block_job_completed() may be called safely. This is very subtle so it's nice to eliminate the assumption by unifying the early exit with the normal exit code path. Cc: Fam Zheng <f...@redhat.com> Cc: Jeff Cody <jc...@redhat.com> Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> ---

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-15 Thread Stefan Hajnoczi
On Thu, Oct 15, 2015 at 10:19:17AM +0800, Wen Congyang wrote: > On 10/14/2015 10:27 PM, Stefan Hajnoczi wrote: > > On Tue, Oct 13, 2015 at 05:08:17PM +0800, Wen Congyang wrote: > >> On 10/13/2015 12:27 AM, Stefan Hajnoczi wrote: > >>> On Fri, Sep 25, 2015 at 02:17:

Re: [Qemu-block] [Qemu-devel] [PATCH] Revert "blockdev: add note that block_job_cb() must be thread-safe"

2015-10-15 Thread Stefan Hajnoczi
On Wed, Oct 14, 2015 at 10:51:27PM -0400, Fam Zheng wrote: > > > - Original Message - > > On Tue, Oct 13, 2015 at 06:16:15PM +0800, Fam Zheng wrote: > > > This reverts commit 723c5d93c51bdb3adbc238ce90195c0864aa6cd5. > > > > > > block_job_cb is called by block_job_completed, which is

Re: [Qemu-block] [Qemu-devel] [PATCH] block: switch from g_slice allocator to malloc

2015-10-08 Thread Stefan Hajnoczi
On Thu, Oct 01, 2015 at 01:04:39PM +0200, Paolo Bonzini wrote: > Simplify memory allocation by sticking with a single API. GSlice > is not that fast anyway (tcmalloc/jemalloc are better). > > Signed-off-by: Paolo Bonzini > --- > block/io.c| 4 ++-- >

Re: [Qemu-block] [PATCH v8 03/11] block: never cancel a streaming job without running stream_complete()

2015-10-16 Thread Stefan Hajnoczi
ill become more important as we introduce support for streaming to > any intermediate node. > > Signed-off-by: Alberto Garcia <be...@igalia.com> > Reviewed-by: Max Reitz <mre...@redhat.com> > --- > block/stream.c | 11 ++- > 1 file changed, 6 insertions(+), 5 d

Re: [Qemu-block] [PATCH v2 2/2] aio: Introduce aio-epoll.c

2015-10-16 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 07:10:55PM +0800, Fam Zheng wrote: > +static bool aio_epoll_try_enable(AioContext *ctx) > +{ > +AioHandler *node; > +struct epoll_event event; > +if (!ctx->epoll_available) { > +return false; > +} Why check this here since aio_epoll_check_poll()

Re: [Qemu-block] [PATCH] block: fix memory leak in early exit

2015-10-16 Thread Stefan Hajnoczi
On Fri, Oct 16, 2015 at 08:58:12AM +0200, Alberto Garcia wrote: > On Thu 15 Oct 2015 05:54:27 PM CEST, Stefan Hajnoczi <stefa...@redhat.com> > wrote: > > The stream block job has two early exit code paths. They do not free > > s->backing_file_str. > > > >

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-16 Thread Stefan Hajnoczi
On Fri, Oct 16, 2015 at 10:22:05AM +0800, Wen Congyang wrote: > On 10/15/2015 10:55 PM, Stefan Hajnoczi wrote: > > On Thu, Oct 15, 2015 at 10:19:17AM +0800, Wen Congyang wrote: > >> On 10/14/2015 10:27 PM, Stefan Hajnoczi wrote: > >>> On Tue, Oct 13, 2015 at 05:08:

Re: [Qemu-block] [Qemu-devel] [RFC] transactions: add transaction-wide property

2015-10-16 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 12:50:20PM -0400, John Snow wrote: > Ping -- any consensus on how we should implement the "do-or-die" > argument for transactions that start block jobs? :) > > This patch may look a little hokey in how it boxes arguments, but I can > re-do it on top of Eric Blake's very

Re: [Qemu-block] [PATCH] Revert "blockdev: add note that block_job_cb() must be thread-safe"

2015-10-14 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 06:16:15PM +0800, Fam Zheng wrote: > This reverts commit 723c5d93c51bdb3adbc238ce90195c0864aa6cd5. > > block_job_cb is called by block_job_completed, which is always called in > a main loop bottom half in existing block jobs. So we don't need to > worry about thread-safety

Re: [Qemu-block] [PATCH v10 02/10] Backup: clear all bitmap when doing block checkpoint

2015-10-14 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 05:13:14PM +0800, Wen Congyang wrote: > On 10/12/2015 09:45 PM, Stefan Hajnoczi wrote: > > On Fri, Sep 25, 2015 at 02:17:30PM +0800, Wen Congyang wrote: > >> Signed-off-by: Wen Congyang <we...@cn.fujitsu.com> > >> Signed-off-by: zhanghailian

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > +/* start backup job now */ > +bdrv_op_unblock(s->hidden_disk, BLOCK_OP_TYPE_BACKUP_TARGET, > +s->active_disk->backing_blocker); > +bdrv_op_unblock(s->secondary_disk,

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > +static void backup_job_completed(void *opaque, int ret) > +{ > +BDRVReplicationState *s = opaque; > + > +if (s->replication_state != BLOCK_REPLICATION_DONE) { > +/* The backup job is cancelled unexpectedly */ > +

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > +static void replication_start(BlockDriverState *bs, ReplicationMode mode, > + Error **errp) > +{ > +BDRVReplicationState *s = bs->opaque; > +int64_t active_length, hidden_length, disk_length; > +

Re: [Qemu-block] [PATCH v10 02/10] Backup: clear all bitmap when doing block checkpoint

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:30PM +0800, Wen Congyang wrote: > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Reviewed-by: Jeff Cody > --- > block/backup.c

Re: [Qemu-block] [PATCH] gluster: allocate GlusterAIOCBs on the stack

2015-10-06 Thread Stefan Hajnoczi
On Thu, Oct 01, 2015 at 01:04:38PM +0200, Paolo Bonzini wrote: > This is simpler now that the driver has been converted to coroutines. > > Signed-off-by: Paolo Bonzini > --- > block/gluster.c | 86 > ++--- > 1 file

Re: [Qemu-block] [PATCH] nbd: switch from g_slice allocator to malloc

2015-10-06 Thread Stefan Hajnoczi
+-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH] scsi: switch from g_slice allocator to malloc

2015-10-06 Thread Stefan Hajnoczi
-bus.c | 4 ++-- > hw/scsi/virtio-scsi-dataplane.c | 10 +- > hw/scsi/virtio-scsi.c | 12 +--- > 3 files changed, 12 insertions(+), 14 deletions(-) Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [PATCH v3 00/16] block: Get rid of bdrv_swap()

2015-10-13 Thread Stefan Hajnoczi
--- > block/vpc.c | 34 ++-- > block/vvfat.c | 19 +- > blockdev.c | 6 +- > blockjob.c| 15 +- > include/block/block.h | 15 +- > include/block/block_int.h | 20 +- > include/block/blockjob.h | 8 + > include/qemu/queue.h | 6 - > qemu-img.c| 20 +- > 36 files changed, 754 insertions(+), 835 deletions(-) > > -- > 1.8.3.1 > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [PATCH v2 02/22] ide: Account for write operations correctly

2015-10-13 Thread Stefan Hajnoczi
On Fri, Oct 02, 2015 at 05:26:12PM +0300, Alberto Garcia wrote: > Signed-off-by: Alberto Garcia <be...@igalia.com> > --- > hw/ide/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [PATCH v2 01/22] xen_disk: Account for flush operations

2015-10-13 Thread Stefan Hajnoczi
changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [PATCH v2 03/22] block: define 'clock_type' for the accounting code

2015-10-13 Thread Stefan Hajnoczi
om> > --- > block/accounting.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [PATCH v2 05/22] block: Add idle_time_ns to BlockDeviceStats

2015-10-13 Thread Stefan Hajnoczi
On Fri, Oct 02, 2015 at 05:26:15PM +0300, Alberto Garcia wrote: > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 5f12af7..a529e2f 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -448,6 +448,10 @@ > # @wr_merged: Number of write requests that have been

Re: [Qemu-block] [PATCH v2 04/22] util: Infrastructure for computing recent averages

2015-10-13 Thread Stefan Hajnoczi
On Fri, Oct 02, 2015 at 05:26:14PM +0300, Alberto Garcia wrote: > +int64_t cpu_get_clock(void) > +{ > +return my_clock_value; > +} Please add a comment here explaining that this is the clock for QEMU_CLOCK_VIRTUAL. > +/* Account a value > + * > + * @ta:the TimedAverage structure > + *

Re: [Qemu-block] [PATCH v2 07/22] block: Add statistics for failed and invalid I/O operations

2015-10-13 Thread Stefan Hajnoczi
On Fri, Oct 02, 2015 at 05:26:17PM +0300, Alberto Garcia wrote: > +void block_acct_failed(BlockAcctStats *stats, BlockAcctCookie *cookie) > +{ > +int64_t time_ns = qemu_clock_get_ns(clock_type); > + > +assert(cookie->type < BLOCK_MAX_IOTYPE); > + > +stats->failed_ops[cookie->type]++; >

Re: [Qemu-block] [PATCH v2 08/22] block: Allow configuring whether to account failed and invalid ops

2015-10-13 Thread Stefan Hajnoczi
/accounting.h | 5 + > qapi/block-core.json | 17 - > qmp-commands.hx| 25 - > 6 files changed, 79 insertions(+), 11 deletions(-) Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [PATCH v10 00/10] Block replication for continuous checkpoints

2015-10-09 Thread Stefan Hajnoczi
On Wed, Oct 07, 2015 at 02:39:51PM +0800, Wen Congyang wrote: > Ping... Added to my todo list. Will review on Monday. Stefan

Re: [Qemu-block] [PATCH v2 13/16] block: Implement bdrv_append() without bdrv_swap()

2015-10-09 Thread Stefan Hajnoczi
On Thu, Oct 01, 2015 at 03:13:31PM +0200, Kevin Wolf wrote: > +static void change_parent_backing_link(BlockDriverState *from, > + BlockDriverState *to) > +{ > +BdrvChild *c, *next; > + > +QLIST_FOREACH_SAFE(c, >parents, next_parent, next) { I find the

Re: [Qemu-block] [PATCH v2 00/16] block: Get rid of bdrv_swap()

2015-10-09 Thread Stefan Hajnoczi
| 19 +- > blockdev.c| 6 +- > blockjob.c| 15 +- > include/block/block.h | 15 +- > include/block/block_int.h | 20 +- > include/block/blockjob.h | 8 + > include/qemu/queue.h | 6 - > qemu-img.c| 20 +- > 36 files changed, 762 insertions(+), 809 deletions(-) Modulo review comments: Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-08 Thread Stefan Hajnoczi
On Wed, Jul 08, 2015 at 09:01:27AM +0800, Fam Zheng wrote: On Tue, 07/07 16:08, Stefan Hajnoczi wrote: +#define EPOLL_BATCH 128 +static bool aio_poll_epoll(AioContext *ctx, bool blocking) +{ +AioHandler *node; +bool was_dispatching; +int i, ret; +bool progress

Re: [Qemu-block] [PATCH RFC 3/4] aio: Introduce aio_context_setup

2015-07-08 Thread Stefan Hajnoczi
On Wed, Jul 08, 2015 at 09:15:57AM +0800, Fam Zheng wrote: On Tue, 07/07 15:35, Stefan Hajnoczi wrote: On Tue, Jun 30, 2015 at 09:19:44PM +0800, Fam Zheng wrote: diff --git a/async.c b/async.c index 06971f4..1d70cfd 100644 --- a/async.c +++ b/async.c @@ -290,12 +290,17

[Qemu-block] [PATCH for-2.5 2/4] block-backend: add blk_get_max_iov()

2015-07-08 Thread Stefan Hajnoczi
Add a function to query BlockLimits.max_iov. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/block-backend.c | 5 + include/sysemu/block-backend.h | 1 + 2 files changed, 6 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index aee8a12..5108aec

[Qemu-block] [PATCH for-2.5 1/4] block: add BlockLimits.max_iov field

2015-07-08 Thread Stefan Hajnoczi
...@kamp.de Suggested-by: Kevin Wolf kw...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- Peter Lieven: I think the SCSI LUN level does not have a maximum scatter-gather segments constraint. That is probably only at the HBA level. CCed you anyway in case you think block/iscsi.c should

[Qemu-block] [PATCH for-2.5 4/4] block/mirror: replace IOV_MAX with blk_get_max_iov()

2015-07-08 Thread Stefan Hajnoczi
Use blk_get_max_iov() instead of hardcoding IOV_MAX, which may not apply to all BlockDrivers. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/mirror.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 985ad00..0f4445c

[Qemu-block] [PATCH for-2.5 3/4] block: replace IOV_MAX with BlockLimits.max_iov

2015-07-08 Thread Stefan Hajnoczi
Request merging must not result in a huge request that exceeds the maximum number of iovec elements. Use BlockLimits.max_iov instead of hardcoding IOV_MAX. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/io.c| 3 ++- hw/block/virtio-blk.c | 2 +- 2 files changed, 3

Re: [Qemu-block] [PATCH RFC 4/4] aio-posix: Use epoll in aio_poll

2015-07-07 Thread Stefan Hajnoczi
On Tue, Jun 30, 2015 at 09:19:45PM +0800, Fam Zheng wrote: = # of scsi-disks |master | epoll | rd wrrandrw | rdwrrandrw

Re: [Qemu-block] [PATCH v2 01/13] block: Use bdrv_drain to replace uncessary bdrv_drain_all

2015-07-07 Thread Stefan Hajnoczi
On Tue, Jun 16, 2015 at 05:01:04PM +0100, Stefan Hajnoczi wrote: On Tue, Jun 02, 2015 at 11:21:50AM +0800, Fam Zheng wrote: There callers work on a single BlockDriverState subtree, where using bdrv_drain() is more accurate. Signed-off-by: Fam Zheng f...@redhat.com Reviewed-by: Paolo

Re: [Qemu-block] [PATCH] block/raw-posix: Don't think /dev/fd/NN is a floppy drive.

2015-07-07 Thread Stefan Hajnoczi
On Wed, Jul 01, 2015 at 03:40:14PM +0100, Richard W.M. Jones wrote: In libguestfs we use /dev/fd/NN to pass pre-opened file descriptors to qemu-img. Lately I've discovered that although this works, qemu believes that these are floppy disk images. That in itself isn't much of a problem, but

<    1   2   3   4   5   6   7   8   9   10   >