[Qemu-block] [PATCH v2] migration/block: Avoid invoking blk_drain too frequently

2017-03-14 Thread Lidong Chen
Increase bmds->cur_dirty after submit io, so reduce the frequency involve into blk_drain, and improve the performance obviously when block migration. The performance test result of this patch: During the block dirty save phase, this patch improve guest os IOPS from 4.0K to 9.5K. and improve the m

Re: [Qemu-block] [Qemu-devel] [PATCH] migration/block: Avoid involve into blk_drain too frequently

2017-03-14 Thread 858585 jemmy
On Wed, Mar 15, 2017 at 10:57 AM, Fam Zheng wrote: > On Wed, 03/15 10:28, 858585 jemmy wrote: >> On Tue, Mar 14, 2017 at 11:12 PM, Eric Blake wrote: >> > On 03/14/2017 02:57 AM, jemmy858...@gmail.com wrote: >> >> From: Lidong Chen >> >> >> >> Increase bmds->cur_dirty after submit io, so reduce t

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-14 Thread Fam Zheng
On Tue, 03/14 08:28, Eric Blake wrote: > On 03/13/2017 09:30 PM, Fam Zheng wrote: > > bdrv_child_set_perm alone is not very usable because the caller must > > call bdrv_child_check_perm first. This is already encapsulated > > conveniently in bdrv_child_try_set_perm, so remove the other prototypes >

Re: [Qemu-block] [Qemu-devel] [PATCH] migration/block: Avoid involve into blk_drain too frequently

2017-03-14 Thread Fam Zheng
On Wed, 03/15 10:28, 858585 jemmy wrote: > On Tue, Mar 14, 2017 at 11:12 PM, Eric Blake wrote: > > On 03/14/2017 02:57 AM, jemmy858...@gmail.com wrote: > >> From: Lidong Chen > >> > >> Increase bmds->cur_dirty after submit io, so reduce the frequency involve > >> into blk_drain, and improve the

Re: [Qemu-block] [Qemu-devel] [PATCH] migration/block: Avoid involve into blk_drain too frequently

2017-03-14 Thread 858585 jemmy
On Tue, Mar 14, 2017 at 11:15 PM, Eric Blake wrote: > > On 03/14/2017 10:12 AM, Eric Blake wrote: > > On 03/14/2017 02:57 AM, jemmy858...@gmail.com wrote: > >> From: Lidong Chen > >> > >> Increase bmds->cur_dirty after submit io, so reduce the frequency involve > >> into blk_drain, and improve t

Re: [Qemu-block] [Qemu-devel] [PATCH] migration/block: Avoid involve into blk_drain too frequently

2017-03-14 Thread 858585 jemmy
On Tue, Mar 14, 2017 at 11:12 PM, Eric Blake wrote: > On 03/14/2017 02:57 AM, jemmy858...@gmail.com wrote: >> From: Lidong Chen >> >> Increase bmds->cur_dirty after submit io, so reduce the frequency involve >> into blk_drain, and improve the performance obviously when block migration. > > Long

Re: [Qemu-block] [Qemu-devel] [PATCH v1 1/1] vmstate: fix failed iotests case 68 and 91

2017-03-14 Thread QingFeng Hao
在 2017/3/14 22:13, Dr. David Alan Gilbert 写道: * QingFeng Hao (ha...@linux.vnet.ibm.com) wrote: This problem affects s390x only if we are running without KVM. Basically, S390CPU.irqstate is unused if we do not use KVM, and thus no buffer is allocated. This causes size=0, first_elem=NULL and n_e

Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: Remove unnecessary includes

2017-03-14 Thread Eric Blake
On 03/14/2017 11:03 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/file-posix.c | 2 -- > 1 file changed, 2 deletions(-) Reviewed-by: Eric Blake > > diff --git a/block/file-posix.c b/block/file-posix.c > index 2cb2f64..a03a3e1 100644 > --- a/block/file-posix.c > +++ b/block/f

Re: [Qemu-block] [Qemu-devel] [PATCH] file-win32: Remove unnecessary include

2017-03-14 Thread Eric Blake
On 03/14/2017 11:04 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/file-win32.c | 1 - > 1 file changed, 1 deletion(-) Reviewed-by: Eric Blake > > diff --git a/block/file-win32.c b/block/file-win32.c > index 800fabd..e132ba1 100644 > --- a/block/file-win32.c > +++ b/block/fil

Re: [Qemu-block] [Qemu-devel] [PATCH v2] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Eric Blake
On 03/14/2017 11:28 AM, Kevin Wolf wrote: > Am 14.03.2017 um 17:20 hat Eric Blake geschrieben: >> On 03/14/2017 11:12 AM, Fam Zheng wrote: >>> Signed-off-by: Fam Zheng >>> --- >>> block/file-posix.c | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/block/file-posix.c b/block/file-

[Qemu-block] [PATCH] blk: fix aio context loss on media change

2017-03-14 Thread Vladimir Sementsov-Ogievskiy
If we have separate iothread for cdrom, we lose connection to it on qmp_blockdev_change_medium, as aio_context is on bds which is dropped and switched with new one. As an example result, after such media change we have crash on virtio_scsi_ctx_check: Assertion `blk_get_aio_context(d->conf.blk) ==

Re: [Qemu-block] [Qemu-devel] [PATCH v2] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Kevin Wolf
Am 14.03.2017 um 17:20 hat Eric Blake geschrieben: > On 03/14/2017 11:12 AM, Fam Zheng wrote: > > Signed-off-by: Fam Zheng > > --- > > block/file-posix.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/block/file-posix.c b/block/file-posix.c > > index c4c0663..d670be3 100644 >

Re: [Qemu-block] [Qemu-devel] [PATCH v2] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Eric Blake
On 03/14/2017 11:12 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > block/file-posix.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/block/file-posix.c b/block/file-posix.c > index c4c0663..d670be3 100644 > --- a/block/file-posix.c > +++ b/block/file-posix.c > @@ -703,6 +70

Re: [Qemu-block] [PATCH v2] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Kevin Wolf
Am 14.03.2017 um 17:12 hat Fam Zheng geschrieben: > Signed-off-by: Fam Zheng Thanks, applied to the block branch. Kevin

Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Eric Blake
On 03/14/2017 11:14 AM, Eric Blake wrote: > On 03/14/2017 11:11 AM, Eric Blake wrote: >> On 03/14/2017 10:43 AM, Fam Zheng wrote: >>> Signed-off-by: Fam Zheng >>> --- >>> block/file-posix.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/block/file-posix.c b/block/file-posix.c >>>

Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Kevin Wolf
Am 14.03.2017 um 17:11 hat Eric Blake geschrieben: > On 03/14/2017 10:43 AM, Fam Zheng wrote: > > Signed-off-by: Fam Zheng > > --- > > block/file-posix.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/block/file-posix.c b/block/file-posix.c > > index c4c0663..e6170f4 100644 > > -

[Qemu-block] [PATCH v2] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/file-posix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index c4c0663..d670be3 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -703,6 +703,9 @@ static int hdev_get_max_segments(const struct stat *st

Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Eric Blake
On 03/14/2017 11:11 AM, Eric Blake wrote: > On 03/14/2017 10:43 AM, Fam Zheng wrote: >> Signed-off-by: Fam Zheng >> --- >> block/file-posix.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/block/file-posix.c b/block/file-posix.c >> index c4c0663..e6170f4 100644 >> --- a/block/file-po

Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Eric Blake
On 03/14/2017 10:43 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > block/file-posix.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/block/file-posix.c b/block/file-posix.c > index c4c0663..e6170f4 100644 > --- a/block/file-posix.c > +++ b/block/file-posix.c > @@ -703,6 +703,7

Re: [Qemu-block] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Fam Zheng
On Tue, 03/14 16:50, Kevin Wolf wrote: > Am 14.03.2017 um 16:43 hat Fam Zheng geschrieben: > > Signed-off-by: Fam Zheng > > --- > > block/file-posix.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/block/file-posix.c b/block/file-posix.c > > index c4c0663..e6170f4 100644 > > ---

[Qemu-block] [PATCH] file-win32: Remove unnecessary include

2017-03-14 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block/file-win32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/file-win32.c b/block/file-win32.c index 800fabd..e132ba1 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -24,7 +24,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include

[Qemu-block] [PATCH] file-posix: Remove unnecessary includes

2017-03-14 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block/file-posix.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 2cb2f64..a03a3e1 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -25,8 +25,6 @@ #include "qapi/error.h" #include "qemu/cutils.h" #incl

Re: [Qemu-block] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Kevin Wolf
Am 14.03.2017 um 16:43 hat Fam Zheng geschrieben: > Signed-off-by: Fam Zheng > --- > block/file-posix.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/block/file-posix.c b/block/file-posix.c > index c4c0663..e6170f4 100644 > --- a/block/file-posix.c > +++ b/block/file-posix.c > @@ -703

[Qemu-block] [PATCH] file-posix: Don't leak fd in hdev_get_max_segments

2017-03-14 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/file-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/file-posix.c b/block/file-posix.c index c4c0663..e6170f4 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -703,6 +703,7 @@ static int hdev_get_max_segments(const struct stat *st)

Re: [Qemu-block] [Qemu-devel] [PATCH] migration/block: Avoid involve into blk_drain too frequently

2017-03-14 Thread Eric Blake
On 03/14/2017 10:12 AM, Eric Blake wrote: > On 03/14/2017 02:57 AM, jemmy858...@gmail.com wrote: >> From: Lidong Chen >> >> Increase bmds->cur_dirty after submit io, so reduce the frequency involve >> into blk_drain, and improve the performance obviously when block migration. > > Long line; plea

Re: [Qemu-block] [Qemu-devel] [PATCH] migration/block: Avoid involve into blk_drain too frequently

2017-03-14 Thread Eric Blake
On 03/14/2017 02:57 AM, jemmy858...@gmail.com wrote: > From: Lidong Chen > > Increase bmds->cur_dirty after submit io, so reduce the frequency involve > into blk_drain, and improve the performance obviously when block migration. Long line; please wrap your commit messages, preferably around 70

[Qemu-block] [PATCH] migration/block: Avoid involve into blk_drain too frequently

2017-03-14 Thread jemmy858585
From: Lidong Chen Increase bmds->cur_dirty after submit io, so reduce the frequency involve into blk_drain, and improve the performance obviously when block migration. Signed-off-by: Lidong Chen --- migration/block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/block.c b/mi

Re: [Qemu-block] [Qemu-devel] [PATCH] nbd-client: fix handling of hungup connections

2017-03-14 Thread Eric Blake
On 03/14/2017 06:11 AM, Paolo Bonzini wrote: > After the switch to reading replies in a coroutine, nothing is > reentering pending receive coroutines if the connection hangs. > Move nbd_recv_coroutines_enter_all to the reply read coroutine, > which is the place where hangups are detected. nbd_tear

Re: [Qemu-block] [Qemu-devel] [PATCH] block: quiesce AioContext when detaching from it

2017-03-14 Thread Eric Blake
On 03/14/2017 06:11 AM, Paolo Bonzini wrote: > While it is true that bdrv_set_aio_context only works on a single > BlockDriverState subtree (see commit message for 53ec73e, "block: Use > bdrv_drain to replace uncessary bdrv_drain_all", 2015-07-07), it works I was about to correct the typo, but see

Re: [Qemu-block] [Qemu-devel] [PATCH v1 1/1] vmstate: fix failed iotests case 68 and 91

2017-03-14 Thread Dr. David Alan Gilbert
* QingFeng Hao (ha...@linux.vnet.ibm.com) wrote: > This problem affects s390x only if we are running without KVM. > Basically, S390CPU.irqstate is unused if we do not use KVM, > and thus no buffer is allocated. > This causes size=0, first_elem=NULL and n_elems=1 in > vmstate_load_state and vmstate_

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Always call bdrv_child_check_perm first

2017-03-14 Thread Eric Blake
On 03/13/2017 09:30 PM, Fam Zheng wrote: > bdrv_child_set_perm alone is not very usable because the caller must > call bdrv_child_check_perm first. This is already encapsulated > conveniently in bdrv_child_try_set_perm, so remove the other prototypes > from the header and fix the one wrong caller,

[Qemu-block] follow file modifications made by guest os with qemu

2017-03-14 Thread Pascal
hi everybody, how could I (easily) follow file modifications made by guest os (Windows) with qemu ? could I exploit the growing overlay image based on an original Windows image ? regards, lacsaP.

Re: [Qemu-block] [PATCH V1] replication: clarify permissions

2017-03-14 Thread Kevin Wolf
Am 14.03.2017 um 12:46 hat Changlong Xie geschrieben: > Even if hidden_disk, secondary_disk are backing files, they all need > write permissions in replication scenario. Otherwise we will encouter > below exceptions on secondary side during adding nbd server: > > {'execute': 'nbd-server-add', 'arg

[Qemu-block] [PATCH V1] replication: clarify permissions

2017-03-14 Thread Changlong Xie
Even if hidden_disk, secondary_disk are backing files, they all need write permissions in replication scenario. Otherwise we will encouter below exceptions on secondary side during adding nbd server: {'execute': 'nbd-server-add', 'arguments': {'device': 'colo-disk', 'writable': true } } {"error":

[Qemu-block] [PATCH] block: quiesce AioContext when detaching from it

2017-03-14 Thread Paolo Bonzini
While it is true that bdrv_set_aio_context only works on a single BlockDriverState subtree (see commit message for 53ec73e, "block: Use bdrv_drain to replace uncessary bdrv_drain_all", 2015-07-07), it works at the AioContext level rather than the BlockDriverState level. Therefore, it is also neces

[Qemu-block] [PATCH] nbd-client: fix handling of hungup connections

2017-03-14 Thread Paolo Bonzini
After the switch to reading replies in a coroutine, nothing is reentering pending receive coroutines if the connection hangs. Move nbd_recv_coroutines_enter_all to the reply read coroutine, which is the place where hangups are detected. nbd_teardown_connection can simply wait for the reply read co

Re: [Qemu-block] [Qemu-devel] [PULL 00/12] Block layer fixes for 2.9.0-rc1

2017-03-14 Thread Peter Maydell
On 14 March 2017 at 10:29, Kevin Wolf wrote: > Am 13.03.2017 um 19:05 hat Peter Maydell geschrieben: >> On 13 March 2017 at 15:54, Kevin Wolf wrote: >> > The following changes since commit >> > dd4d2578215cd380f40a38028a9904e15b135ef3: >> > >> > Merge remote-tracking branch 'remotes/kraxel/tag

Re: [Qemu-block] [PATCH] file-posix: clean up max_segments buffer termination

2017-03-14 Thread Fam Zheng
On Tue, 03/14 17:09, Stefan Hajnoczi wrote: > The following pattern is unsafe: > > char buf[32]; > ret = read(fd, buf, sizeof(buf)); > ... > buf[ret] = 0; > > If read(2) returns 32 then a byte beyond the end of the buffer is > zeroed. > > In practice this buffer overflow does not occur b

Re: [Qemu-block] [Qemu-devel] [PULL 00/12] Block layer fixes for 2.9.0-rc1

2017-03-14 Thread Kevin Wolf
Am 13.03.2017 um 19:05 hat Peter Maydell geschrieben: > On 13 March 2017 at 15:54, Kevin Wolf wrote: > > The following changes since commit dd4d2578215cd380f40a38028a9904e15b135ef3: > > > > Merge remote-tracking branch 'remotes/kraxel/tags/pull-fixes-20170309-1' > > into staging (2017-03-09 13:

Re: [Qemu-block] [PATCH] file-posix: clean up max_segments buffer termination

2017-03-14 Thread Kevin Wolf
Am 14.03.2017 um 10:09 hat Stefan Hajnoczi geschrieben: > The following pattern is unsafe: > > char buf[32]; > ret = read(fd, buf, sizeof(buf)); > ... > buf[ret] = 0; > > If read(2) returns 32 then a byte beyond the end of the buffer is > zeroed. > > In practice this buffer overflow does

[Qemu-block] [PATCH] file-posix: clean up max_segments buffer termination

2017-03-14 Thread Stefan Hajnoczi
The following pattern is unsafe: char buf[32]; ret = read(fd, buf, sizeof(buf)); ... buf[ret] = 0; If read(2) returns 32 then a byte beyond the end of the buffer is zeroed. In practice this buffer overflow does not occur because the sysfs max_segments file only contains an unsigned short