[PATCH] hw/rtc: fix crash caused by lost_clock >= 0 assertion

2022-12-05 Thread Yaowei Bai
dle this crash situation to just reset the next_periodic_time. Signed-off-by: Yaowei Bai --- hw/rtc/mc146818rtc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index 1ebb412..a397949 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/

[PATCH 0/4 V2] SCSI COMPARE_AND_WRITE command support

2019-11-08 Thread Yaowei Bai
/examples/sg_compare_and_write.txt v1->v2: fix checkpatch script complaints and cleanup Yaowei Bai (4): block: add SCSI COMPARE_AND_WRITE support block/rbd: implement bdrv_aio_compare_and_write interface hw/scsi: add SCSI COMPARE_AND_WRITE support scsi-disk: add FUA support for COMPARE_AND_WR

[PATCH 2/4 V2] block/rbd: implement bdrv_aio_compare_and_write interface

2019-11-08 Thread Yaowei Bai
and will be fixed accordingly in the future. Signed-off-by: Yaowei Bai --- block/raw-format.c | 3 ++- block/rbd.c| 45 +++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/block/raw-format.c b/block/raw-format.c index 3a76ec7..e87cd44

[PATCH 3/4 V2] hw/scsi: add SCSI COMPARE_AND_WRITE support

2019-11-08 Thread Yaowei Bai
uch the least code. Signed-off-by: Yaowei Bai --- hw/scsi/emulation.c | 1 + hw/scsi/scsi-bus.c | 4 +++ hw/scsi/scsi-disk.c | 88 + hw/scsi/trace-events| 1 + include/hw/scsi/emulation.h | 3 ++ include/scsi/util

[PATCH 1/4 V2] block: add SCSI COMPARE_AND_WRITE support

2019-11-08 Thread Yaowei Bai
request. In this way we could easily extend to other SCSI commands support like WRITE_SAME in the future. Signed-off-by: Yaowei Bai --- block/io.c| 20 include/block/block.h | 5 +++-- include/block/block_int.h | 3 +++ 3 files changed, 26 insertions

[PATCH 4/4 V2] scsi-disk: add FUA support for COMPARE_AND_WRITE

2019-11-08 Thread Yaowei Bai
It is implemented in the blk_aio_pwritev's callback function in a way similar to its emulation in scsi_write_do_fua function Signed-off-by: Yaowei Bai --- hw/scsi/scsi-disk.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index f9a0267

Re: [PATCH 3/4] hw/scsi: add SCSI COMPARE_AND_WRITE support

2019-10-25 Thread Yaowei Bai
On Fri, Oct 25, 2019 at 05:36:01PM +0800, Yaowei Bai wrote: > > diff --git a/include/tcmu/tcmu.h b/include/tcmu/tcmu.h > new file mode 100644 > index 000..656a545 > --- /dev/null > +++ b/include/tcmu/tcmu.h > @@ -0,0 +1,14 @@ > +#ifndef QEMU_TCMU_H > +#define

[PATCH 2/4] block/rbd: implement bdrv_aio_compare_and_write interface

2019-10-25 Thread Yaowei Bai
and will be fixed accordingly in the future. Signed-off-by: Yaowei Bai --- block/raw-format.c | 3 ++- block/rbd.c| 41 +++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/block/raw-format.c b/block/raw-format.c index 42c28cc..3d8f201

[PATCH 1/4] block: add SCSI COMPARE_AND_WRITE support

2019-10-25 Thread Yaowei Bai
request. In this way we could easily extend to other SCSI commands support like WRITE_SAME in the future. Signed-off-by: Yaowei Bai --- block/io.c| 20 include/block/block.h | 5 +++-- include/block/block_int.h | 3 +++ 3 files changed, 26 insertions

[PATCH 3/4] hw/scsi: add SCSI COMPARE_AND_WRITE support

2019-10-25 Thread Yaowei Bai
uch the least code. Signed-off-by: Yaowei Bai --- hw/scsi/emulation.c | 1 + hw/scsi/scsi-bus.c | 4 +++ hw/scsi/scsi-disk.c | 88 + hw/scsi/trace-events| 1 + include/hw/scsi/emulation.h | 3 ++ include/scsi/util

[PATCH 0/4] SCSI COMPARE_AND_WRITE support

2019-10-25 Thread Yaowei Bai
/examples/sg_compare_and_write.txt Yaowei Bai (4): block: add SCSI COMPARE_AND_WRITE support block/rbd: implement bdrv_aio_compare_and_write interface hw/scsi: add SCSI COMPARE_AND_WRITE support scsi-disk: add FUA support for COMPARE_AND_WRITE block/io.c | 20 + block/raw

[PATCH 4/4] scsi-disk: add FUA support for COMPARE_AND_WRITE

2019-10-25 Thread Yaowei Bai
It is implemented in the blk_aio_pwritev's callback function in a way similar to its emulation in scsi_write_do_fua function Signed-off-by: Yaowei Bai --- hw/scsi/scsi-disk.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 4bff862

Re: COMPARE_AND_WRITE support for rbd driver

2019-09-20 Thread Yaowei Bai
On Fri, Sep 20, 2019 at 01:22:02PM +0200, Paolo Bonzini wrote: > On 19/09/19 07:36, Yaowei Bai wrote: > > > > Hey guys, > > > > I noticed that COMPARE_AND_WRITE had been supported by CEPH/librbd since > > v12.1.1. And in my company, we use this COMP

[Qemu-devel] COMPARE_AND_WRITE support for rbd driver

2019-09-18 Thread Yaowei Bai
baiyao...@cmss.chinamobile.com Bcc: Subject: COMPARE_AND_WRITE support for rbd driver Reply-To: baiyao...@cmss.chinamobile.com Hey guys, I noticed that COMPARE_AND_WRITE had been supported by CEPH/librbd since v12.1.1. And in my company, we use this COMPARE_AND_WRITE support in CEPH with the

Re: [Qemu-devel] [Qemu-block] [PATCH] tcmu: Introduce qemu-tcmu utility

2019-03-08 Thread Yaowei Bai
> > I'm not sure what check you mean. Case 2 would need to find an existing > export with the given name, of course, and would return an error if no > such export exists yet. > > But for care 1, isn't the image explicitly opened when the target is > configured? And if it can't be opened, -1 is

Re: [Qemu-devel] [Qemu-block] [PATCH] tcmu: Introduce qemu-tcmu utility

2019-03-07 Thread Yaowei Bai
> > > * The first priority should be adding an in-process iscsi target that > > > can be managed with QMP, similar to the built-in NBD server. > > > > Well, people used to manage iscsi targets through targetcli, a command > > line utility. Our intention is, with targetcli and qemu-tcmu, user

Re: [Qemu-devel] [Qemu-block] [PATCH] tcmu: Introduce qemu-tcmu utility

2019-03-07 Thread Yaowei Bai
Add Fam. On Wed, Mar 06, 2019 at 10:56:33PM +0100, Kevin Wolf wrote: > Am 21.12.2018 um 11:16 hat Yaowei Bai geschrieben: > > This patch introduces a new utility, qemu-tcmu. Apart from the > > underlaying protocol it interacts with the world much like > > qemu-nbd. This

Re: [Qemu-devel] [Qemu-block] [PATCH] tcmu: Introduce qemu-tcmu utility

2019-03-07 Thread Yaowei Bai
On Wed, Mar 06, 2019 at 10:56:33PM +0100, Kevin Wolf wrote: > Am 21.12.2018 um 11:16 hat Yaowei Bai geschrieben: > > This patch introduces a new utility, qemu-tcmu. Apart from the > > underlaying protocol it interacts with the world much like > > qemu-nbd. This patch b

[Qemu-devel] (no subject)

2019-01-01 Thread Yaowei Bai
baiyao...@cmss.chinamobile.com Bcc: Subject: Re: [Qemu-devel] [PATCH] tcmu: Introduce qemu-tcmu utility Reply-To: baiyao...@cmss.chinamobile.com In-Reply-To: <20190102015321.GA26514@byw> Add Xiubo. On Wed, Jan 02, 2019 at 09:53:21AM +0800, Yaowei Bai wrote: > Ping. > > BTW, it s

Re: [Qemu-devel] [PATCH] tcmu: Introduce qemu-tcmu utility

2019-01-01 Thread Yaowei Bai
Ping. BTW, it should be update docker image to install glib to fix this. On Wed, Dec 26, 2018 at 12:19:48AM -0800, no-re...@patchew.org wrote: > Patchew URL: > https://patchew.org/QEMU/1545387387-9613-1-git-send-email-baiyao...@cmss.chinamobile.com/ > > > > Hi, > > This series seems to have

[Qemu-devel] [PATCH] tcmu: Introduce qemu-tcmu utility

2018-12-21 Thread Yaowei Bai
Signed-off-by: Fam Zheng Signed-off-by: Yaowei Bai Signed-off-by: Xiubo Li --- Makefile| 1 + Makefile.objs | 3 +- configure | 45 docs/tcmu.txt | 91 +++ include/tcmu/tcmu.h | 14 + qemu-tcmu.c | 214 +++ tcmu/Makefile.objs

Re: [Qemu-devel] [PATCH] virtio-blk: fix comment for virtio_blk_rw_complete

2018-07-30 Thread Yaowei Bai
Oh, sorry, this patch should go into trivial mail list. On Sat, Jul 28, 2018 at 01:18:44PM +0800, Yaowei Bai wrote: > Here should be submit_requests, there is no submit_merged_requests > function. > > Signed-off-by: Yaowei Bai > --- > hw/block/virtio-blk.c | 4 ++-- &g

[Qemu-devel] [PATCH] virtio-blk: fix comment for virtio_blk_rw_complete

2018-07-27 Thread Yaowei Bai
Here should be submit_requests, there is no submit_merged_requests function. Signed-off-by: Yaowei Bai --- hw/block/virtio-blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 50b5c86..91cbede 100644 --- a/hw/block

[Qemu-devel] [PATCH v2] tracing: Use double-dash spelling for trace option

2018-07-03 Thread Yaowei Bai
://wiki.qemu.org/BiteSizedTasks#Consistent_option_usage_in_documentation . Signed-off-by: Yaowei Bai Reviewed-by: Eric Blake --- docs/devel/tracing.txt | 6 +++--- trace/control.c| 4 ++-- trace/control.h| 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/devel

Re: [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option

2018-06-13 Thread Yaowei Bai
On Wed, Jun 13, 2018 at 06:27:49AM -0500, Eric Blake wrote: > On 06/12/2018 10:50 PM, Emilio G. Cota wrote: > >On Tue, Jun 12, 2018 at 23:15:49 -0400, Yaowei Bai wrote: > >>Signed-off-by: Yaowei Bai > >>--- > >> docs/devel/tracing.txt | 2 +- > >>

Re: [Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option

2018-06-13 Thread Yaowei Bai
On Tue, Jun 12, 2018 at 11:50:30PM -0400, Emilio G. Cota wrote: > On Tue, Jun 12, 2018 at 23:15:49 -0400, Yaowei Bai wrote: > > Signed-off-by: Yaowei Bai > > --- > > docs/devel/tracing.txt | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > >

[Qemu-devel] [PATCH] tracing.txt: add missing '-' for trace option

2018-06-12 Thread Yaowei Bai
Signed-off-by: Yaowei Bai --- docs/devel/tracing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt index 07abbb3..6ab32cc 100644 --- a/docs/devel/tracing.txt +++ b/docs/devel/tracing.txt @@ -18,7 +18,7 @@ for debugging

Re: [Qemu-devel] [PATCH] gitignore: Ignore qapi/qapi-*-job.[ch]

2018-06-07 Thread Yaowei Bai
On Thu, Jun 07, 2018 at 11:05:58AM -0400, Jeff Cody wrote: > On Thu, Jun 07, 2018 at 10:43:59AM -0400, Yaowei Bai wrote: > > They were introduced by commit bf42508f24ee(job: Introduce > > qapi/job.json) but forgot to ignore them in .gitignore. > > > > Signed-off-by:

[Qemu-devel] [PATCH] gitignore: Ignore qapi/qapi-*-job.[ch]

2018-06-07 Thread Yaowei Bai
They were introduced by commit bf42508f24ee(job: Introduce qapi/job.json) but forgot to ignore them in .gitignore. Signed-off-by: Yaowei Bai --- .gitignore | 4 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index a178e4c..e4bacc6 100644 --- a/.gitignore +++ b

Re: [Qemu-devel] [PATCH 1/3] timer: fix misleading comment in timer.h

2016-12-04 Thread Yaowei Bai
On Thu, Dec 01, 2016 at 04:23:17PM +0100, Paolo Bonzini wrote: > > > On 01/12/2016 14:50, Stefan Hajnoczi wrote: > > On Wed, Nov 30, 2016 at 11:30:38PM -0500, Yaowei Bai wrote: > >> It's timer to expire, not clock. > >> > >> Signed-off-by:

[Qemu-devel] [PATCH 3/3] block: drop remaining legacy aio functions in comment

2016-11-30 Thread Yaowei Bai
Commit 87f68d318222563822b5c6b28192215fc4b4e441 (block: drop aio functions that operate on the main AioContext) drops qemu_aio_wait function references mostly while leaves these behind, clean up them. Signed-off-by: Yaowei Bai <baiyao...@cmss.chinamobile.com> --- include/block/aio.h | 4 +

[Qemu-devel] [PATCH 1/3] timer: fix misleading comment in timer.h

2016-11-30 Thread Yaowei Bai
It's timer to expire, not clock. Signed-off-by: Yaowei Bai <baiyao...@cmss.chinamobile.com> --- include/qemu/timer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 309f3d0..c89ed2a 100644 --- a/include/qemu/timer.h

[Qemu-devel] [PATCH 2/3] main-loop: update comment for qemu_mutex_lock/unlock_iothread

2016-11-30 Thread Yaowei Bai
Commit 49cf57281b7 (vl: delay thread initialization after daemonization) makes the global mutex is taken after daemonization instead before daemonization by qemu_init_main_loop(). Signed-off-by: Yaowei Bai <baiyao...@cmss.chinamobile.com> --- include/qemu/main-loop.h | 4 ++-- 1 file chan

Re: [Qemu-devel] [PATCH 2/2] aio: improve aio_poll performance by checking epoll only once

2016-09-17 Thread Yaowei Bai
On Wed, Sep 14, 2016 at 05:40:17PM +0100, Stefan Hajnoczi wrote: > On Wed, Sep 14, 2016 at 07:03:39AM -0400, Yaowei Bai wrote: > > As epoll whether enabled or not is a global setting, we can just > > check it only once rather than checking it with every node iteration. > >

[Qemu-devel] [PATCH 0/2] improve aio_poll performance

2016-09-14 Thread Yaowei Bai
This patchset change to check epoll's enablement first before nodes iteration to improve aio_poll()'s performance. Also fix a wrong comment of mirror_start(). Yaowei Bai (2): block: mirror: fix wrong comment of mirror_start aio: improve aio_poll performance by checking epoll only once aio

[Qemu-devel] [PATCH 2/2] aio: improve aio_poll performance by checking epoll only once

2016-09-14 Thread Yaowei Bai
As epoll whether enabled or not is a global setting, we can just check it only once rather than checking it with every node iteration. Through this we can avoid a lot of checks when epoll is not enabled. Signed-off-by: Yaowei Bai <baiyao...@cmss.chinamobile.com> Reviewed-by: Xiubo Li

[Qemu-devel] [PATCH 1/2] block: mirror: fix wrong comment of mirror_start

2016-09-14 Thread Yaowei Bai
Obviously, we should write to '@target'. Signed-off-by: Yaowei Bai <baiyao...@cmss.chinamobile.com> Reviewed-by: Xiubo Li <lixi...@cmss.chinamobile.com> --- include/block/block_int.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/block/block_int.h b/i