[Qemu-devel] [PATCH v2 1/2] memfd: fix possible usage of the uninitialized file descriptor

2018-06-13 Thread Dima Stepanov
to -1 before calling the qemu_memfd_alloc routine. Signed-off-by: Dima Stepanov --- util/memfd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/memfd.c b/util/memfd.c index d248a53..6287946 100644 --- a/util/memfd.c +++ b/util/memfd.c @@ -187,6 +187,7 @@ bool qemu_memfd_alloc_check(void

[Qemu-devel] [PATCH v2 2/2] memory: fix possible NULL pointer dereference

2018-06-13 Thread Dima Stepanov
In the memory_region_do_invalidate_mmio_ptr() routine the section variable is intialized by the memory_region_find() call. The section.mr field can be set to NULL. Add the check for NULL before trying to drop a section. Signed-off-by: Dima Stepanov --- memory.c | 2 +- 1 file changed, 1

[Qemu-devel] [PATCH v2 0/2] misc fixes found by static analyzer

2018-06-13 Thread Dima Stepanov
During the development process we used scan-build as static analyzer to check the changes. There are some issues found. The patch set below is to resolve issues found. Changes v2: - remove one patch, since it was resolved by: 7eb24009 Dima Stepanov (2): memfd: fix possible usage

[Qemu-devel] [PATCH v1] qemu-pr-helper: garbage response structure can be used to write data

2018-06-15 Thread Dima Stepanov
rh_read_request() routine. Signed-off-by: Dima Stepanov --- scsi/qemu-pr-helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index d0f8317..85878c2 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -768,6 +768,8 @@ stat

[Qemu-devel] [PATCH v1 0/3] misc fixes found by static analyzer

2018-06-09 Thread Dima Stepanov
During the development process we used scan-build as static analyzer to check the changes. There are some issues found. The patch set below is to resolve issues found. Dima Stepanov (3): memfd: fix possible usage of the uninitialized file descriptor qcow2: fix the uninitialized bitmap_table

[Qemu-devel] [PATCH v1 1/3] memfd: fix possible usage of the uninitialized file descriptor

2018-06-09 Thread Dima Stepanov
to -1 before calling the qemu_memfd_alloc routine. Signed-off-by: Dima Stepanov --- util/memfd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/memfd.c b/util/memfd.c index d248a53..6287946 100644 --- a/util/memfd.c +++ b/util/memfd.c @@ -187,6 +187,7 @@ bool qemu_memfd_alloc_check(void

[Qemu-devel] [PATCH v1 2/3] qcow2: fix the uninitialized bitmap_table variable

2018-06-09 Thread Dima Stepanov
the next instruction is return from routine. Signed-off-by: Dima Stepanov --- block/qcow2-bitmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index 60d5290..69485aa 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -254,7 +254,6

[Qemu-devel] [PATCH v1 3/3] memory: fix possible NULL pointer dereference

2018-06-09 Thread Dima Stepanov
In the memory_region_do_invalidate_mmio_ptr() routine the section variable is intialized by the memory_region_find() call. The section.mr field can be set to NULL. Add the check for NULL before trying to drop a section. Signed-off-by: Dima Stepanov --- memory.c | 2 +- 1 file changed, 1

Re: [Qemu-devel] [PATCH v1] qemu-pr-helper: garbage response structure can be used to write data

2018-07-02 Thread Dima Stepanov
Ping. On Fri, Jun 15, 2018 at 12:11:44PM +0300, Dima Stepanov wrote: > The prh_co_entry() routine handles requests. The first part is to read a > request by calling the prh_read_request() routine, if: > 1. scsi_cdb_xfer(req->cdb) call returns 0, and > 2. req->cdb[0] == PER

Re: [Qemu-devel] [PATCH v2 2/2] memory: fix possible NULL pointer dereference

2018-06-19 Thread Dima Stepanov
Ping. I believe i forgot to add the maintainer to CC. + pbonz...@redhat.com Regards, Dima. On Wed, Jun 13, 2018 at 11:19:55AM +0300, Dima Stepanov wrote: > In the memory_region_do_invalidate_mmio_ptr() routine the section > variable is intialized by the memory_region_find() call. The sect

Re: [Qemu-devel] [PATCH v1] qemu-pr-helper: garbage response structure can be used to write data

2018-07-03 Thread Dima Stepanov
On Mon, Jul 02, 2018 at 02:21:41PM +0200, Paolo Bonzini wrote: > On 02/07/2018 10:52, Dima Stepanov wrote: > > Ping. > > > > On Fri, Jun 15, 2018 at 12:11:44PM +0300, Dima Stepanov wrote: > >> The prh_co_entry() routine handles requests. The first part is to

Re: [Qemu-devel] [PATCH v2 2/2] memory: fix possible NULL pointer dereference

2018-07-11 Thread Dima Stepanov
Gentle ping. CCing Paolo Bonzini. Regards, Dima. On Tue, Jun 19, 2018 at 05:12:16PM +0300, Dima Stepanov wrote: > Ping. > > Regards, Dima. > > On Wed, Jun 13, 2018 at 11:19:55AM +0300, Dima Stepanov wrote: > > In the memory_region_do_invalidate_mmio_ptr() routine the

Re: [Qemu-devel] [PATCH v2 2/2] memory: fix possible NULL pointer dereference

2018-07-11 Thread Dima Stepanov
Hi Phil, On Wed, Jul 11, 2018 at 10:47:18AM -0300, Philippe Mathieu-Daudé wrote: > Hi Dima, > > On 07/11/2018 05:34 AM, Dima Stepanov wrote: > > Gentle ping. CCing Paolo Bonzini. > > > > Regards, Dima. > > > > On Tue, Jun 19, 2018 at 05:12:16P

Re: [Qemu-devel] [PATCH v2 2/2] memory: fix possible NULL pointer dereference

2018-07-11 Thread Dima Stepanov
On Wed, Jul 11, 2018 at 03:09:13PM +0100, Peter Maydell wrote: > On 11 July 2018 at 14:47, Philippe Mathieu-Daudé wrote: > > Hi Dima, > > > > On 07/11/2018 05:34 AM, Dima Stepanov wrote: > >> Gentle ping. CCing Paolo Bonzini. > >> > >> Regards, Di

Re: [Qemu-devel] [PULL V2 24/26] net: ignore packet size greater than INT_MAX

2018-11-13 Thread Dima Stepanov
Hi Jason, I know that this patch has been already merged to stable, but i have a question: On Fri, Oct 19, 2018 at 11:22:23AM +0800, Jason Wang wrote: > There should not be a reason for passing a packet size greater than > INT_MAX. It's usually a hint of bug somewhere, so ignore packet size >

Re: [Qemu-devel] [PULL V2 24/26] net: ignore packet size greater than INT_MAX

2018-11-15 Thread Dima Stepanov
On Thu, Nov 15, 2018 at 10:47:04AM +0800, Jason Wang wrote: > > On 2018/11/15 上午12:23, Dima Stepanov wrote: > >On Wed, Nov 14, 2018 at 10:59:32AM +0800, Jason Wang wrote: > >>On 2018/11/13 下午11:41, Dima Stepanov wrote: > >>>Hi Jason, > >>> > &

Re: [Qemu-devel] [PULL V2 24/26] net: ignore packet size greater than INT_MAX

2018-11-14 Thread Dima Stepanov
On Wed, Nov 14, 2018 at 10:59:32AM +0800, Jason Wang wrote: > > On 2018/11/13 下午11:41, Dima Stepanov wrote: > >Hi Jason, > > > >I know that this patch has been already merged to stable, but i have a > >question: > > > >On Fri, Oct 19, 2018 at 11:22:23AM

Re: [Qemu-devel] [PATCH v1] virtio: add checks for the size of the indirect table

2019-01-15 Thread Dima Stepanov
On Tue, Jan 15, 2019 at 11:40:09AM +0100, Cornelia Huck wrote: > On Tue, 15 Jan 2019 13:08:47 +0300 > Dima Stepanov wrote: > > > The virtqueue_pop() and virtqueue_get_avail_bytes() routines can use the > > INDIRECT table to get the data. It is possible to create a packe

[Qemu-devel] [PATCH v1] virtio: add checks for the size of the indirect table

2019-01-15 Thread Dima Stepanov
size of the INDIRECT table, which should not be 0. Signed-off-by: Dima Stepanov --- hw/virtio/virtio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 22bd1ac..a1ff647 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virti

Re: [Qemu-devel] [PATCH v1] exec: check the range in the address_space_unmap routine

2019-04-03 Thread Dima Stepanov
On Fri, Mar 22, 2019 at 01:35:57PM +, Peter Maydell wrote: > On Fri, 22 Mar 2019 at 13:19, Dima Stepanov wrote: > > > > In case of the virtio-blk communication, can get the following assertion > > for the specifically crafted virtio packet: > > qemu

[Qemu-devel] [PATCH v1] exec: check the range in the address_space_unmap routine

2019-03-22 Thread Dima Stepanov
. The fix is to check the whole address range in the address_space_unmap function. Signed-off-by: Dima Stepanov --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 86a38d3..0eeb018 100644 --- a/exec.c +++ b/exec.c @@ -3717,7 +3717,7 @@ void

Re: [RFC PATCH v1 3/7] char-socket: initialize reconnect timer only if close is emitted

2020-04-27 Thread Dima Stepanov
> Marc-André Lureau 于2020年4月24日周五 上午3:16写道: > > > > > > Hi > > > > On Thu, Apr 23, 2020 at 8:41 PM Dima Stepanov > > wrote: > > > > > > During vhost-user reconnect functionality testing the following assert > > > was hit: > > >

Re: [RFC PATCH v1 5/7] vhost-user-blk: add mechanism to track the guest notifiers init state

2020-04-24 Thread Dima Stepanov
On Wed, Apr 22, 2020 at 12:17:50PM -0400, Raphael Norwitz wrote: > There are some problems with this patch. It doesn't apply cleanly. > > Are you sure you’re developing on an up to date master branch? > > On Thu, Apr 23, 2020 at 09:39:36PM +0300, Dima Stepanov wrote: &

[PATCH v2 2/5] vhost: introduce wrappers to set guest notifiers for virtio device

2020-04-30 Thread Dima Stepanov
factor code, so the set_guest_notifiers methods could be called based on the vhost device state. Update all vhost used devices to use these wrappers instead of direct method call. Signed-off-by: Dima Stepanov --- backends/cryptodev-vhost.c | 26 +++--- backends/vhost-user.c

[PATCH v2 0/5] vhost-user reconnect issues during vhost initialization

2020-04-30 Thread Dima Stepanov
onnected during vhost-user set log commands communication. *** BLURB HERE *** Dima Stepanov (5): char-socket: return -1 in case of disconnect during tcp_chr_write vhost: introduce wrappers to set guest notifiers for virtio device vhost-user-blk: add mechanism to track the guest notifiers i

[PATCH v2 5/5] vhost: add device started check in migration set log

2020-04-30 Thread Dima Stepanov
should be revised to handle these errors more carefully. In case of vhost-user device backend the fail paths should consider the state of the device. In this case we should skip some function calls during rollback on the error paths, so not to get the NULL dereference errors. Signed-off-by: Dima St

[PATCH v2 3/5] vhost-user-blk: add mechanism to track the guest notifiers init state

2020-04-30 Thread Dima Stepanov
Also connection can be broken after the dev.started field is set to true. A new notifiers_set field is added to the vhost_dev structure to track the state of the guest notifiers during the initialization process. Signed-off-by: Dima Stepanov --- hw/block/vhost-user-blk.c | 8 ---

[PATCH v2 1/5] char-socket: return -1 in case of disconnect during tcp_chr_write

2020-04-30 Thread Dima Stepanov
is that vhost_user_write doesn't get an error after disconnect and try to call vhost_user_read(). The tcp_chr_write() routine should return -1 in case of disconnect. Indicate the EIO error if this routine is called in the disconnected state. Signed-off-by: Dima Stepanov --- chardev/char-sock

[PATCH v2 4/5] vhost: check vring address before calling unmap

2020-04-30 Thread Dima Stepanov
assert() in the vhost_memory_unmap() routine. Signed-off-by: Dima Stepanov --- hw/virtio/vhost.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index ddbdc53..3ee50c4 100644 --- a/hw/virtio/vhost.c +++ b/hw

Re: [RFC PATCH v1 1/7] contrib/vhost-user-blk: add option to simulate disconnect on init

2020-04-25 Thread Dima Stepanov
s route I would prefer to add the debugging options to the > > vhost-user-blk sample in a separate patch. > > > > On Thu, Apr 23, 2020 at 09:39:32PM +0300, Dima Stepanov wrote: > > > > > > Add "--simulate-disconnect-stage" option for the testing purposes. >

[RFC PATCH v1 4/7] vhost: introduce wrappers to set guest notifiers for virtio device

2020-04-23 Thread Dima Stepanov
factor code, so the set_guest_notifiers methods could be called based on the vhost device state. Update all vhost used devices to use these wrappers instead of direct method call. Signed-off-by: Dima Stepanov --- backends/cryptodev-vhost.c | 26 +++--- backends/vhost-user.c

[RFC PATCH v1 5/7] vhost-user-blk: add mechanism to track the guest notifiers init state

2020-04-23 Thread Dima Stepanov
Also connection can be broken after the dev.started field is set to true. A new notifiers_set field is added to the vhost_dev structure to track the state of the guest notifiers during the initialization process. Signed-off-by: Dima Stepanov --- hw/block/vhost-user-blk.c | 8 ---

[RFC PATCH v1 1/7] contrib/vhost-user-blk: add option to simulate disconnect on init

2020-04-23 Thread Dima Stepanov
te the "GOptionEntry entries" definition with the final NULL item according to API. Signed-off-by: Dima Stepanov --- contrib/libvhost-user/libvhost-user.c | 30 ++ contrib/libvhost-user/libvhost-user.h | 13 + contrib/vhost-user-blk/vhost-use

[RFC PATCH v1 0/7] vhost-user reconnect issues during vhost initialization

2020-04-23 Thread Dima Stepanov
emon disconnected during vhost-user set log commands communication. Dima Stepanov (7): contrib/vhost-user-blk: add option to simulate disconnect on init char-socket: return -1 in case of disconnect during tcp_chr_write char-socket: initialize reconnect timer only if close is emitted vhost: i

[RFC PATCH v1 3/7] char-socket: initialize reconnect timer only if close is emitted

2020-04-23 Thread Dima Stepanov
oks correct, because the initialization routine can return error in many cases. The tcp_chr_disconnect_locked() routine could be fixed. The timer will be restarted only if the close event is emitted. Signed-off-by: Dima Stepanov --- chardev/char-socket.c | 10 +- 1 file changed, 5 inserti

[RFC PATCH v1 6/7] vhost: check vring address before calling unmap

2020-04-23 Thread Dima Stepanov
assert() in the vhost_memory_unmap() routine. Signed-off-by: Dima Stepanov --- hw/virtio/vhost.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index ddbdc53..3ee50c4 100644 --- a/hw/virtio/vhost.c +++ b/hw

[RFC PATCH v1 7/7] vhost: add device started check in migration set log

2020-04-23 Thread Dima Stepanov
should be revised to handle these errors more carefully. In case of vhost-user device backend the fail paths should consider the state of the device. In this case we should skip some function calls during rollback on the error paths, so not to get the NULL dereference errors. Signed-off-by: Dima St

[RFC PATCH v1 2/7] char-socket: return -1 in case of disconnect during tcp_chr_write

2020-04-23 Thread Dima Stepanov
is that vhost_user_write doesn't get an error after disconnect and try to call vhost_user_read(). The tcp_chr_write() routine should return -1 in case of disconnect. Indicate the EIO error if this routine is called in the disconnected state. Signed-off-by: Dima Stepanov --- chardev/char-sock

Re: [PATCH v2 4/5] vhost: check vring address before calling unmap

2020-05-12 Thread Dima Stepanov
On Tue, May 12, 2020 at 11:26:11AM +0800, Jason Wang wrote: > > On 2020/5/11 下午5:11, Dima Stepanov wrote: > >On Mon, May 11, 2020 at 11:05:58AM +0800, Jason Wang wrote: > >>On 2020/4/30 下午9:36, Dima Stepanov wrote: > >>>Since disconnect can happen at any t

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-12 Thread Dima Stepanov
On Tue, May 12, 2020 at 11:32:50AM +0800, Jason Wang wrote: > > On 2020/5/11 下午5:25, Dima Stepanov wrote: > >On Mon, May 11, 2020 at 11:15:53AM +0800, Jason Wang wrote: > >>On 2020/4/30 下午9:36, Dima Stepanov wrote: > >>>If vhost-user daemon is used as a back

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-12 Thread Dima Stepanov
start daemon), X is random - run dst VM - perform migration - fio should complete in dst VM And we cycle this test like forever. At least for now we see no new issues. No other comments mixed in below. > > Thanks, > > Feng Li > > Jason Wang 于2020年5月12日周二 上午1

Re: [PATCH v2 4/5] vhost: check vring address before calling unmap

2020-05-13 Thread Dima Stepanov
On Wed, May 13, 2020 at 11:00:38AM +0800, Jason Wang wrote: > > On 2020/5/12 下午5:08, Dima Stepanov wrote: > >On Tue, May 12, 2020 at 11:26:11AM +0800, Jason Wang wrote: > >>On 2020/5/11 下午5:11, Dima Stepanov wrote: > >>>On Mon, May 11, 2020 at 11:05:58AM +0800,

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-18 Thread Dima Stepanov
or false. As a result vhost_migration_log() will check device state at the start of the routine and before return. But if the disconnect state isn't okay for migration, then we should return an error. No other comments mixed in below. > > Thanks, > Feng Li > > Dima Stepanov 于2020年5月16

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-18 Thread Dima Stepanov
tate: - disconnect -> not started For other devices we can just return the started field value as it is right now. No other comments mixed in below. > > Thanks > > > > > >Thanks, > >Feng Li > > > >Dima Stepanov 于2020年5月16日周六 上午12:55写道: >

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-18 Thread Dima Stepanov
On Mon, May 18, 2020 at 10:50:39AM +0800, Jason Wang wrote: > > On 2020/5/16 上午12:54, Dima Stepanov wrote: > >On Thu, May 14, 2020 at 03:34:24PM +0800, Jason Wang wrote: > >>On 2020/5/13 下午5:47, Dima Stepanov wrote: > >>>>> case CHR_EVENT_CLOSED: >

Re: [PATCH v2 2/5] vhost: introduce wrappers to set guest notifiers for virtio device

2020-05-11 Thread Dima Stepanov
On Mon, May 11, 2020 at 11:03:01AM +0800, Jason Wang wrote: > > On 2020/4/30 下午9:36, Dima Stepanov wrote: > >Introduce new wrappers to set/reset guest notifiers for the virtio > >device in the vhost device module: > > vhost_dev_assign_guest_notifiers > > ->s

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-11 Thread Dima Stepanov
On Mon, May 11, 2020 at 11:15:53AM +0800, Jason Wang wrote: > > On 2020/4/30 下午9:36, Dima Stepanov wrote: > >If vhost-user daemon is used as a backend for the vhost device, then we > >should consider a possibility of disconnect at any moment. If such >

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-11 Thread Dima Stepanov
On Sun, May 10, 2020 at 08:03:39PM -0400, Raphael Norwitz wrote: > On Thu, May 7, 2020 at 11:35 AM Dima Stepanov wrote: > > > > What do you think? > > > > Apologies - I tripped over the if (dev->started && r < 0) check. > Never-mind my point

Re: [PATCH v2 4/5] vhost: check vring address before calling unmap

2020-05-11 Thread Dima Stepanov
On Mon, May 11, 2020 at 11:05:58AM +0800, Jason Wang wrote: > > On 2020/4/30 下午9:36, Dima Stepanov wrote: > >Since disconnect can happen at any time during initialization not all > >vring buffers (for instance used vring) can be intialized successfully. > >If the bu

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-15 Thread Dima Stepanov
On Thu, May 14, 2020 at 03:34:24PM +0800, Jason Wang wrote: > > On 2020/5/13 下午5:47, Dima Stepanov wrote: > >>> case CHR_EVENT_CLOSED: > >>> /* a close event may happen during a read/write, but vhost > >>> * code ass

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-19 Thread Dima Stepanov
On Mon, May 18, 2020 at 10:53:59AM +0100, Dr. David Alan Gilbert wrote: > * Dima Stepanov (dimas...@yandex-team.ru) wrote: > > On Mon, May 18, 2020 at 10:50:39AM +0800, Jason Wang wrote: > > > > > > On 2020/5/16 上午12:54, Dima Stepanov wrote: > > > >On Thu,

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-19 Thread Dima Stepanov
On Wed, May 13, 2020 at 01:56:18PM +0800, Jason Wang wrote: > > On 2020/5/13 下午12:15, Michael S. Tsirkin wrote: > >On Tue, May 12, 2020 at 12:35:30PM +0300, Dima Stepanov wrote: > >>On Tue, May 12, 2020 at 11:32:50AM +0800, Jason Wang wrote: > >>>On 2020

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-13 Thread Dima Stepanov
On Wed, May 13, 2020 at 11:20:50AM +0800, Jason Wang wrote: > > On 2020/5/12 下午5:35, Dima Stepanov wrote: > >On Tue, May 12, 2020 at 11:32:50AM +0800, Jason Wang wrote: > >>On 2020/5/11 下午5:25, Dima Stepanov wrote: > >>>On Mon, May 11, 2020 at 11:15:53AM +0800,

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-13 Thread Dima Stepanov
On Wed, May 13, 2020 at 01:56:18PM +0800, Jason Wang wrote: > > On 2020/5/13 下午12:15, Michael S. Tsirkin wrote: > >On Tue, May 12, 2020 at 12:35:30PM +0300, Dima Stepanov wrote: > >>On Tue, May 12, 2020 at 11:32:50AM +0800, Jason Wang wrote: > >>>On 2020

Re: [PATCH v2 3/5] vhost-user-blk: add mechanism to track the guest notifiers init state

2020-05-06 Thread Dima Stepanov
On Sun, May 03, 2020 at 09:06:38PM -0400, Raphael Norwitz wrote: > Apologies for mixing up patches last time. This looks good from a > vhost-user-blk perspective, but I worry that some of these changes > could impact other vhost device types. > > I agree with adding notifiers_set to struct

Re: [PATCH v2 2/5] vhost: introduce wrappers to set guest notifiers for virtio device

2020-05-06 Thread Dima Stepanov
only for vhost-user-blk. After it we can figure out how to propogate this change to other devices. > > On Thu, Apr 30, 2020 at 9:48 AM Dima Stepanov wrote: > > > > Introduce new wrappers to set/reset guest notifiers for the virtio > > device in the vhost devic

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-07 Thread Dima Stepanov
t. What i tried to follow is that if device not started (because of disconnect or any other reason), there is no need to continue initialization and we can proceed with the next migration step. > > On Thu, Apr 30, 2020 at 9:57 AM Dima Stepanov wrote: > > > > If vhost-

[PATCH v3 2/2] vhost-user-blk: delay vhost_user_blk_disconnect

2020-05-20 Thread Dima Stepanov
e7c83a885f865128ae3cf1946f8cb538b63cbfba "vhost-user: delay vhost_user_stop" Signed-off-by: Dima Stepanov --- hw/block/vhost-user-blk.c | 49 +-- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c ind

[PATCH v3 0/2] vhost-user reconnect issues during vhost initialization

2020-05-20 Thread Dima Stepanov
e simulated in two ways: - before any successful initialization - make successful initialization once and try to simulate disconnects Also we catch SIGABRT on the migration start if vhost-user daemon disconnected during vhost-user set log commands communication. Dima Stepanov (2): c

[PATCH v3 1/2] char-socket: return -1 in case of disconnect during tcp_chr_write

2020-05-20 Thread Dima Stepanov
is that vhost_user_write doesn't get an error after disconnect and try to call vhost_user_read(). The tcp_chr_write() routine should return -1 in case of disconnect. Indicate the EIO error if this routine is called in the disconnected state. Signed-off-by: Dima Stepanov Reviewed-by: Marc-André Lu

Re: [PATCH v2 2/7] vhost: check queue state in the vhost_dev_set_log routine

2020-09-01 Thread Dima Stepanov
On Mon, Aug 31, 2020 at 11:22:14PM -0400, Raphael Norwitz wrote: > On Mon, Aug 31, 2020 at 4:37 AM Dima Stepanov wrote: > > > > On Thu, Aug 27, 2020 at 09:46:03PM -0400, Raphael Norwitz wrote: > > > On Mon, Aug 24, 2020 at 4:41 AM Dima Stepanov > > > wrote: >

Re: [PATCH v2 1/7] vhost: recheck dev state in the vhost_migration_log routine

2020-08-31 Thread Dima Stepanov
On Thu, Aug 27, 2020 at 09:44:22PM -0400, Raphael Norwitz wrote: > Generally I’m happy with this. Some comments: > > On Mon, Aug 24, 2020 at 4:40 AM Dima Stepanov wrote: > > > > vhost-user devices can get a disconnect in the middle of the VHOST-USER > > hands

Re: [PATCH v2 2/7] vhost: check queue state in the vhost_dev_set_log routine

2020-08-31 Thread Dima Stepanov
On Thu, Aug 27, 2020 at 09:46:03PM -0400, Raphael Norwitz wrote: > On Mon, Aug 24, 2020 at 4:41 AM Dima Stepanov wrote: > > > > If the vhost-user-blk daemon provides only one virtqueue, but device was > > added with several queues, then QEMU will send more VHOST-USER comm

[PATCH v3 7/7] tests/qtest/vhost-user-test: enable the reconnect tests

2020-08-31 Thread Dima Stepanov
For now a QTEST_VHOST_USER_FIXME environment variable is used to separate reconnect tests for the vhost-user-net device. Looks like the reconnect functionality is pretty stable, so this separation is deprecated. Remove it and enable these tests for the default run. Signed-off-by: Dima Stepanov

[PATCH v3 5/7] tests/qtest/vhost-user-test: add support for the vhost-user-blk device

2020-08-31 Thread Dima Stepanov
Add vhost_user_ops structure for the vhost-user-blk device class. Add the test_reconnect and test_migrate tests for this device. Signed-off-by: Dima Stepanov --- tests/qtest/vhost-user-test.c | 139 +- 1 file changed, 137 insertions(+), 2 deletions

[PATCH v3 4/7] tests/qtest/libqos/virtio-blk: add support for vhost-user-blk

2020-08-31 Thread Dima Stepanov
Add support for the vhost-user-blk-pci device. This node can be used by the vhost-user-blk tests. Tests for the vhost-user-blk device are added in the following patches. Signed-off-by: Dima Stepanov --- tests/qtest/libqos/virtio-blk.c | 14 ++ 1 file changed, 14 insertions(+) diff

[PATCH v3 6/7] tests/qtest/vhost-user-test: add migrate_reconnect test

2020-08-31 Thread Dima Stepanov
Add new migrate_reconnect test for the vhost-user-blk device. Perform a disconnect after sending response for the VHOST_USER_SET_LOG_BASE command. Signed-off-by: Dima Stepanov --- tests/qtest/vhost-user-test.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tests

[PATCH v3 2/7] vhost: check queue state in the vhost_dev_set_log routine

2020-08-31 Thread Dima Stepanov
() function call. Add the same check to the vhost_dev_set_log() routine. Signed-off-by: Dima Stepanov --- hw/virtio/vhost.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index ffef7ab..a33ffd4 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio

[PATCH v3 1/7] vhost: recheck dev state in the vhost_migration_log routine

2020-08-31 Thread Dima Stepanov
devices. This migration issue was slightly discussed earlier: - https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg01509.html - https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg05241.html Signed-off-by: Dima Stepanov --- hw/block/vhost-user-blk.c | 19

[PATCH v3 0/7] vhost-user-blk: fix the migration issue and enhance qtests

2020-08-31 Thread Dima Stepanov
-user-blk functionality. The vhost-user-blk/vhost-user-blk-tests/migrate_reconnect test was added to reproduce the original issue found. Dima Stepanov (7): vhost: recheck dev state in the vhost_migration_log routine vhost: check queue state in the vhost_dev_set_log routine tests/qtest/vhos

[PATCH v3 3/7] tests/qtest/vhost-user-test: prepare the tests for adding new dev class

2020-08-31 Thread Dima Stepanov
line or make a proper vhost-user responses. Signed-off-by: Dima Stepanov --- tests/qtest/vhost-user-test.c | 105 ++ 1 file changed, 76 insertions(+), 29 deletions(-) diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index 9ee0f1e

[PATCH v5 1/7] vhost: recheck dev state in the vhost_migration_log routine

2020-09-11 Thread Dima Stepanov
devices. This migration issue was slightly discussed earlier: - https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg01509.html - https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg05241.html Signed-off-by: Dima Stepanov Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c

[PATCH v5 4/7] tests/qtest/libqos/virtio-blk: add support for vhost-user-blk

2020-09-11 Thread Dima Stepanov
Add support for the vhost-user-blk-pci device. This node can be used by the vhost-user-blk tests. Tests for the vhost-user-blk device are added in the following patches. Signed-off-by: Dima Stepanov --- tests/qtest/libqos/virtio-blk.c | 14 +- 1 file changed, 13 insertions(+), 1

[PATCH v5 0/7] vhost-user-blk: fix the migration issue and enhance qtests

2020-09-11 Thread Dima Stepanov
gration_log() routine before returning from the function. qtest framework was updated to test vhost-user-blk functionality. The vhost-user-blk/vhost-user-blk-tests/migrate_reconnect test was added to reproduce the original issue found. Dima Stepanov (7): vhost: recheck dev state in the vhost_migr

[PATCH v5 6/7] tests/qtest/vhost-user-test: add migrate_reconnect test

2020-09-11 Thread Dima Stepanov
Add new migrate_reconnect test for the vhost-user-blk device. Perform a disconnect after sending response for the VHOST_USER_SET_LOG_BASE command. Signed-off-by: Dima Stepanov Reviewed-by: Raphael Norwitz --- tests/qtest/vhost-user-test.c | 25 + 1 file changed, 25

[PATCH v5 2/7] vhost: check queue state in the vhost_dev_set_log routine

2020-09-11 Thread Dima Stepanov
() function call. Add the same check to the vhost_dev_set_log() routine. Signed-off-by: Dima Stepanov Reviewed-by: Raphael Norwitz --- hw/virtio/vhost.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index ffef7ab..a08b7d8 100644 --- a/hw/virtio

[PATCH v5 3/7] tests/qtest/vhost-user-test: prepare the tests for adding new dev class

2020-09-11 Thread Dima Stepanov
line or make a proper vhost-user responses. Signed-off-by: Dima Stepanov Reviewed-by: Raphael Norwitz --- tests/qtest/vhost-user-test.c | 105 ++ 1 file changed, 76 insertions(+), 29 deletions(-) diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest

[PATCH v5 5/7] tests/qtest/vhost-user-test: add support for the vhost-user-blk device

2020-09-11 Thread Dima Stepanov
Add vhost_user_ops structure for the vhost-user-blk device class. Add the test_reconnect and test_migrate tests for this device. Signed-off-by: Dima Stepanov Reviewed-by: Raphael Norwitz --- tests/qtest/vhost-user-test.c | 139 +- 1 file changed, 137

[PATCH v5 7/7] tests/qtest/vhost-user-test: enable the reconnect tests

2020-09-11 Thread Dima Stepanov
For now a QTEST_VHOST_USER_FIXME environment variable is used to separate reconnect tests for the vhost-user-net device. Looks like the reconnect functionality is pretty stable, so this separation is deprecated. Remove it and enable these tests for the default run. Signed-off-by: Dima Stepanov

[PATCH v4 3/7] tests/qtest/vhost-user-test: prepare the tests for adding new dev class

2020-09-04 Thread Dima Stepanov
line or make a proper vhost-user responses. Signed-off-by: Dima Stepanov --- tests/qtest/vhost-user-test.c | 105 ++ 1 file changed, 76 insertions(+), 29 deletions(-) diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index 9ee0f1e

[PATCH v4 4/7] tests/qtest/libqos/virtio-blk: add support for vhost-user-blk

2020-09-04 Thread Dima Stepanov
Add support for the vhost-user-blk-pci device. This node can be used by the vhost-user-blk tests. Tests for the vhost-user-blk device are added in the following patches. Signed-off-by: Dima Stepanov --- tests/qtest/libqos/virtio-blk.c | 14 ++ 1 file changed, 14 insertions(+) diff

[PATCH v4 0/7] vhost-user-blk: fix the migration issue and enhance qtests

2020-09-04 Thread Dima Stepanov
The vhost-user-blk/vhost-user-blk-tests/migrate_reconnect test was added to reproduce the original issue found. Dima Stepanov (7): vhost: recheck dev state in the vhost_migration_log routine vhost: check queue state in the vhost_dev_set_log routine tests/qtest/vhost-user-test: prepare the

[PATCH v4 1/7] vhost: recheck dev state in the vhost_migration_log routine

2020-09-04 Thread Dima Stepanov
devices. This migration issue was slightly discussed earlier: - https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg01509.html - https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg05241.html Signed-off-by: Dima Stepanov Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c

[PATCH v4 2/7] vhost: check queue state in the vhost_dev_set_log routine

2020-09-04 Thread Dima Stepanov
() function call. Add the same check to the vhost_dev_set_log() routine. Signed-off-by: Dima Stepanov --- hw/virtio/vhost.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index ffef7ab..a08b7d8 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio

[PATCH v4 7/7] tests/qtest/vhost-user-test: enable the reconnect tests

2020-09-04 Thread Dima Stepanov
For now a QTEST_VHOST_USER_FIXME environment variable is used to separate reconnect tests for the vhost-user-net device. Looks like the reconnect functionality is pretty stable, so this separation is deprecated. Remove it and enable these tests for the default run. Signed-off-by: Dima Stepanov

[PATCH v4 5/7] tests/qtest/vhost-user-test: add support for the vhost-user-blk device

2020-09-04 Thread Dima Stepanov
Add vhost_user_ops structure for the vhost-user-blk device class. Add the test_reconnect and test_migrate tests for this device. Signed-off-by: Dima Stepanov --- tests/qtest/vhost-user-test.c | 139 +- 1 file changed, 137 insertions(+), 2 deletions

[PATCH v4 6/7] tests/qtest/vhost-user-test: add migrate_reconnect test

2020-09-04 Thread Dima Stepanov
Add new migrate_reconnect test for the vhost-user-blk device. Perform a disconnect after sending response for the VHOST_USER_SET_LOG_BASE command. Signed-off-by: Dima Stepanov --- tests/qtest/vhost-user-test.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tests

Re: [PATCH v4 4/7] tests/qtest/libqos/virtio-blk: add support for vhost-user-blk

2020-09-09 Thread Dima Stepanov
On Tue, Sep 08, 2020 at 11:01:57PM -0400, Raphael Norwitz wrote: > On Fri, Sep 4, 2020 at 5:34 AM Dima Stepanov wrote: > > > > Add support for the vhost-user-blk-pci device. This node can be used by > > the vhost-user-blk tests. Tests for the vhost-user-blk device are added

Re: [PATCH v4 5/7] tests/qtest/vhost-user-test: add support for the vhost-user-blk device

2020-09-09 Thread Dima Stepanov
On Tue, Sep 08, 2020 at 11:03:56PM -0400, Raphael Norwitz wrote: > On Fri, Sep 4, 2020 at 5:35 AM Dima Stepanov wrote: > > > > Add vhost_user_ops structure for the vhost-user-blk device class. Add > > the test_reconnect and test_migrate tests for this device. > > >

Re: [PATCH v4 1/7] vhost: recheck dev state in the vhost_migration_log routine

2020-09-10 Thread Dima Stepanov
On Tue, Sep 08, 2020 at 03:25:20PM +0100, Stefan Hajnoczi wrote: > On Fri, Sep 04, 2020 at 12:31:13PM +0300, Dima Stepanov wrote: > > vhost-user devices can get a disconnect in the middle of the VHOST-USER > > handshake on the migration start. If disconnect event happened right >

[PATCH v1 1/2] fuzz: add virtio-blk fuzz target

2020-10-07 Thread Dima Stepanov
The virtio-blk fuzz target sets up and fuzzes the available virtio-blk queues. The implementation is based on two files: - tests/qtest/fuzz/virtio_scsi_fuzz.c - tests/qtest/virtio_blk_test.c Signed-off-by: Dima Stepanov --- tests/qtest/fuzz/meson.build | 1 + tests/qtest/fuzz

[PATCH v1 0/2] fuzz: add virtio-blk fuzz target

2020-10-07 Thread Dima Stepanov
Based on the current virtio-scsi-fuzz target implement new virtio-blk fuzz target. Use a virtio_blk_test.c file as a reference for the block device initialization. Also make a small update to the documentation to fix build/run command lines after meson and build changes in QEMU. Dima Stepanov (2

[PATCH v1 2/2] docs/fuzz: update make and run command lines

2020-10-07 Thread Dima Stepanov
After meson and some other build changes the qemu fuzz target should be build as: make qemu-fuzz-i386 And also update the run path command line. Signed-off-by: Dima Stepanov --- docs/devel/fuzzing.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/devel

Re: [PATCH v5 0/7] vhost-user-blk: fix the migration issue and enhance qtests

2020-10-07 Thread Dima Stepanov
On Tue, Sep 29, 2020 at 12:48:38PM +0300, Dima Stepanov wrote: > On Tue, Sep 29, 2020 at 03:13:09AM -0400, Michael S. Tsirkin wrote: > > On Sun, Sep 27, 2020 at 09:48:28AM +0300, Dima Stepanov wrote: > > > On Thu, Sep 24, 2020 at 07:26:14AM -0400, Michael S. Tsirkin wrote: >

Re: [PATCH v1 1/2] fuzz: add virtio-blk fuzz target

2020-10-14 Thread Dima Stepanov
On Wed, Oct 14, 2020 at 10:29:41AM +0300, Dima Stepanov wrote: > On Tue, Oct 13, 2020 at 11:30:52AM -0400, Alexander Bulekov wrote: > > On 201007 1647, Dima Stepanov wrote: > > > The virtio-blk fuzz target sets up and fuzzes the available virtio-blk > > > queues. The imp

Re: [PATCH v1 1/2] fuzz: add virtio-blk fuzz target

2020-10-14 Thread Dima Stepanov
On Tue, Oct 13, 2020 at 11:30:52AM -0400, Alexander Bulekov wrote: > On 201007 1647, Dima Stepanov wrote: > > The virtio-blk fuzz target sets up and fuzzes the available virtio-blk > > queues. The implementation is based on two files: > > - tests/qtest/fuzz/virtio_scsi_fuzz.

Re: [PATCH 00/12] Add a General Virtual Device Fuzzer

2020-08-26 Thread Dima Stepanov
Hi Alex, Thanks for the nice general fuzzer implementation, looks pretty exciting. Are there any future plans discussion which i can read or maybe join? I have some ideas about it so it could be great to syncronize. Regards, Dima. On Wed, Jul 22, 2020 at 11:39:21PM -0400, Alexander Bulekov

[PATCH v2 6/7] tests/qtest/vhost-user-test: add migrate_reconnect test

2020-08-24 Thread Dima Stepanov
Add new migrate_reconnect test for the vhost-user-blk device. Perform a disconnect after sending response for the VHOST_USER_SET_LOG_BASE command. Signed-off-by: Dima Stepanov --- tests/qtest/vhost-user-test.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tests

[PATCH v2 3/7] tests/qtest/vhost-user-test: prepare the tests for adding new dev class

2020-08-24 Thread Dima Stepanov
line or make a proper vhost-user responses. Signed-off-by: Dima Stepanov --- tests/qtest/vhost-user-test.c | 105 ++ 1 file changed, 76 insertions(+), 29 deletions(-) diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index 9ee0f1e

[PATCH v2 5/7] tests/qtest/vhost-user-test: add support for the vhost-user-blk device

2020-08-24 Thread Dima Stepanov
Add vhost_user_ops structure for the vhost-user-blk device class. Add the test_reconnect and test_migrate tests for this device. Signed-off-by: Dima Stepanov --- tests/qtest/vhost-user-test.c | 140 +- 1 file changed, 138 insertions(+), 2 deletions

  1   2   >