[Qemu-devel] Fwd: port forward not work when using with macvtap

2018-06-20 Thread Li Feng
Hi all, I create a vm with a macvtap network and a nat network. ``` netdev user,id=fl.1,hostfwd=tcp::-:22 \ -device e1000,netdev=fl.1 \ -net nic,model=virtio,macaddr=$(< /sys/class/net/macvtap0/address) \ -net tap,fd=3 3<>/dev/tap$(< /sys/class/net/macvtap0/ifindex) ``` I create two network

[Qemu-devel] [PATCH] block/nvme: optimize the performance of nvme driver based on vfio-pci

2018-11-01 Thread Li Feng
1 ↵ read 1073741824/1073741824 bytes at offset 0 1 GiB, 1 ops; 0:00:01.94 (526.770 MiB/sec and 0.5144 ops/sec) Signed-off-by: Li Feng --- block/nvme.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/block

[Qemu-devel] [PATCH] libvhost-user: fix bad vu_log_write

2019-04-20 Thread Li Feng
Mark dirty as page, the step of each call is 1. Signed-off-by: Li Feng --- contrib/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c index e08d6c7b97..2689de6d1c 100644

Re: hotplug issue of vhost-user-blk

2020-04-09 Thread Li Feng
, Feng Li Igor Mammedov 于2020年4月8日周三 下午6:40写道: > > On Wed, 8 Apr 2020 10:25:42 +0800 > Li Feng wrote: > > > Hi all, > > > > Hotplug of vhost-user-blk doesn't not work in qemu master branch and > > all previous version. > > > > The action I insert a vhost

[PATCH 2/4] vhost-user-blk: fix invalid memory access

2020-04-14 Thread Li Feng
oned by user:f7 Container overflow: fc Array cookie:ac Intra object redzone:bb ASan internal: fe Left alloca redzone: ca Right alloca redzone:cb ==7309==ABORTING Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 4 hw/vi

[PATCH 0/4] fix crashes when inject errors to vhost-user-blk chardev

2020-04-14 Thread Li Feng
PEN) -> vhost_user_blk_connect -> vhost_dev_init -> vhost_user_blk_event(CLOSE) -> vhost_dev_cleanup Li Feng (4): vhost-user-blk: delay vhost_user_blk_disconnect vhost-user-blk: fix invalid memory access char-socket: avoid double call tcp_chr_

[PATCH 4/4] vhost-user-blk: fix crash in realize process

2020-04-14 Thread Li Feng
nected is true, otherwise the hdev->host_ops will be nullptr. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 47 +-- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 1

[PATCH 1/4] vhost-user-blk: delay vhost_user_blk_disconnect

2020-04-14 Thread Li Feng
Since commit b0a335e351103bf92f3f9d0bd5759311be8156ac, a socket write may trigger a disconnect events, calling vhost_user_blk_disconnect() and clearing all the vhost_dev strutures. Then the next socket read will encounter an invalid pointer to vhost_dev. Signed-off-by: Li Feng --- hw/block

[PATCH 3/4] char-socket: avoid double call tcp_chr_free_connection

2020-04-14 Thread Li Feng
double call tcp_chr_free_connection generates a crash. Signed-off-by: Li Feng --- chardev/char-socket.c | 5 + 1 file changed, 5 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 185fe38dda..43aab8f24b 100644 --- a/chardev/char-socket.c +++ b/chardev/char

hotplug issue of vhost-user-blk

2020-04-07 Thread Li Feng
Hi all, Hotplug of vhost-user-blk doesn't not work in qemu master branch and all previous version. The action I insert a vhost-user-blk disk is: (qemu) chardev-add socket,id=spdk_vhost_blk2,path=/vhost-blk.0,reconnect=1 (qemu) device_add

Re: [PATCH 3/4] char-socket: avoid double call tcp_chr_free_connection

2020-04-19 Thread Li Feng
when writing tests code(tests/test-char.c ). Any tips? Thanks, Feng Li Marc-André Lureau 于2020年4月15日周三 下午6:35写道: > > Hi > > On Wed, Apr 15, 2020 at 5:31 AM Li Feng wrote: > > > > double call tcp_chr_free_connection generates a crash. > > > > Signed-off-by: Li Feng

Re: [PATCH 1/4] vhost-user-blk: delay vhost_user_blk_disconnect

2020-04-20 Thread Li Feng
all the vhost_dev strutures holding data that vhost.c functions expect to remain valid. Delay the cleanup to keep the vhost_dev structure valid during the vhost.c functions. Feng Li Raphael Norwitz 于2020年4月17日周五 上午11:41写道: > > On Wed, Apr 15, 2020 at 11:28:23AM +0800, Li Feng

Fwd: [PATCH 4/4] vhost-user-blk: fix crash in realize process

2020-04-17 Thread Li Feng
Add mail group list. Thank you, Raphael . Raphael Norwitz 于2020年4月17日周五 下午12:10写道: > > Mostly looks good - just a few superficial notes. > > On Wed, Apr 15, 2020 at 11:28:26AM +0800, Li Feng wrote: > > 1. set s->connected to true after vhost_dev_init; > > 2. call

Re: [PATCH 0/4] fix crashes when inject errors to vhost-user-blk chardev

2020-04-17 Thread Li Feng
OK, I will submit this patch "vhost-user-blk: fix invalid memory access" firstly. This is unrelated with other three and it has been acked. Thanks, Feng Li Michael S. Tsirkin 于2020年4月17日周五 下午5:45写道: > > On Wed, Apr 15, 2020 at 11:28:22AM +0800, Li Feng wrote: > > The

[PATCH] vhost-user-blk: fix invalid memory access

2020-04-17 Thread Li Feng
oned by user:f7 Container overflow: fc Array cookie:ac Intra object redzone:bb ASan internal: fe Left alloca redzone: ca Right alloca redzone:cb ==7309==ABORTING Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 4 hw/vi

Re: [PATCH] vhost-user-blk: fix invalid memory access

2020-04-17 Thread Li Feng
Nothing changed. Just separate this patch from those patchset series. Thanks, Feng Li Philippe Mathieu-Daudé 于2020年4月17日周五 下午6:55写道: > > Hi Li, > > On 4/17/20 12:17 PM, Li Feng wrote: > > when s->inflight is freed, vhost_dev_free_inflight may try to access

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

2020-04-26 Thread Li Feng
This patch is trying to fix the same issue with me. However, our fix is different. I think that check the s->reconnect_timer is better. Thanks, Feng Li Marc-André Lureau 于2020年4月24日周五 上午3:16写道: > > Hi > > On Thu, Apr 23, 2020 at 8:41 PM Dima Stepanov wrote: > > > > During vhost-user

Re: [PATCH v2] char-socket: initialize reconnect timer only when the timer doesn't start

2020-04-28 Thread Li Feng
0555a9556 in qemu_thread_start (args=) at util/qemu-thread-posix.c:519 #10 0x75e61e25 in start_thread () from /lib64/libpthread.so.0 #11 0x75b8bbad in clone () from /lib64/libc.so.6 I think this is a new issue of qemu, not my test issue. How do you think? Thanks, Feng Li L

[PATCH v2] char-socket: initialize reconnect timer only when the timer doesn't start

2020-04-28 Thread Li Feng
: qemu_chr_socket_restart_timer: Assertion `!s->reconnect_timer' failed. Signed-off-by: Li Feng --- v2: - Rewrite the solution. - Add test to reproduce this issue. chardev/char-socket.c | 2 +- tests/test-char.c | 48 ++-- 2 files changed, 39 insertions(+), 11 deleti

[PATCH v2] char-socket: initialize reconnect timer only when the timer doesn't start

2020-04-28 Thread Li Feng
: qemu_chr_socket_restart_timer: Assertion `!s->reconnect_timer' failed. Signed-off-by: Li Feng --- v2: - Rewrite the solution. - Add test to reproduce this issue. chardev/char-socket.c | 2 +- tests/test-char.c | 48 ++-- 2 files changed, 39 insertions(+), 11 deleti

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

2020-05-11 Thread Li Feng
Hi, Dima. If vhost_migration_log return < 0, then vhost_log_global_start will trigger a crash. Does your patch have process this abort? If a disconnect happens in the migration stage, the correct operation is to stop the migration, right? 841 static void vhost_log_global_start(MemoryListener

Re: [PATCH v3 1/2] io/channel: fix crash when qio_channel_readv_all return 0

2020-05-11 Thread Li Feng
2:22PM +0800, Li Feng wrote: > > Marc-André Lureau 于2020年5月8日周五 下午8:32写道: > > > > > > Hi > > > > > > On Fri, May 8, 2020 at 7:14 AM Li Feng wrote: > > > > > > > > Root cause: > > > > From `man recvmsg`, the RETURN VAL

[PATCH v4] char-socket: initialize reconnect timer only when the timer doesn't start

2020-05-11 Thread Li Feng
: qemu_chr_socket_restart_timer: Assertion `!s->reconnect_timer' failed. Signed-off-by: Li Feng --- v4: - remove the wrong patch - fix the char_socket_ping_pong to support the reconnect exception test v3: - add a patch to fix a crash when recvmsg return 0 - make the tests reproduce the two crash v2: - add unit t

Re: [PATCH v3 1/2] io/channel: fix crash when qio_channel_readv_all return 0

2020-05-08 Thread Li Feng
Marc-André Lureau 于2020年5月8日周五 下午8:32写道: > > Hi > > On Fri, May 8, 2020 at 7:14 AM Li Feng wrote: > > > > Root cause: > > From `man recvmsg`, the RETURN VALUE says: > > These calls return the number of bytes received, or -1 if an error > > occurred.

Re: [PATCH v3 2/2] char-socket: initialize reconnect timer only when the timer doesn't start

2020-05-08 Thread Li Feng
Have you applied the first one? io/channel: fix crash when qio_channel_readv_all return 0 Thanks, Feng Li Marc-André Lureau 于2020年5月8日周五 下午7:01写道: > > On Fri, May 8, 2020 at 7:14 AM Li Feng wrote: > > > > When the disconnect event is triggered in th

Re: [PATCH v3 2/2] char-socket: initialize reconnect timer only when the timer doesn't start

2020-05-08 Thread Li Feng
Thanks! Feng Li Marc-André Lureau 于2020年5月8日周五 下午8:29写道: > > Hi > > On Fri, May 8, 2020 at 2:16 PM Li Feng wrote: > > > > Have you applied the first one? > > io/channel: fix crash when qio_channel_readv_all return 0 > > > > Sorry, I missed that one

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

2020-05-15 Thread Li Feng
Hi, Dima. This abort is what I have mentioned in my previous email. I have triggered this crash without any fix a week ago. And I have written a test patch to let vhost_log_global_start return int and propagate the error to up layer. However, my change is a little large, because the origin

kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-14 Thread Li Feng
Dear all, I have encountered a weird crash. I remember before a few days it works well and I rebase my code from upstream. This is the command: /root/qemu-master/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -device virtio-balloon -cpu host -smp 4 -m 2G -drive

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-14 Thread Li Feng
L1 kernel is : (base) 20-05-14 23:31:32 root@31_216:~ uname -a Linux 31_216 5.6.7-1.el7.centos.x86_64 #1 SMP Mon Apr 27 15:26:08 CST 2020 x86_64 x86_64 x86_64 GNU/Linux The OS is CentOS 7. Thanks, Feng Li Li Feng 于2020年5月14日周四 下午11:10写道: > > EXSi CPU is : Intel(R) Xeon(R) CPU E5-2

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-14 Thread Li Feng
Dr. David Alan Gilbert 于2020年5月14日周四 下午11:16写道: > > * Li Feng (fen...@smartx.com) wrote: > > EXSi CPU is : Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz > > This is my vm, I run qemu in it. > > Do you know what the real hardware is? What information do you need? I could send

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-14 Thread Li Feng
Cc'ing David/Paolo in case they have a clue... > > > > On 5/14/20 1:27 PM, Li Feng wrote: > > > Dear all, > > > > > > I have encountered a weird crash. > > > I remember before a few days it works well and I rebase my code from > > > upstream. &g

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-14 Thread Li Feng
Dr. David Alan Gilbert 于2020年5月14日周四 下午11:31写道: > > * Li Feng (fen...@smartx.com) wrote: > > Dr. David Alan Gilbert 于2020年5月14日周四 下午11:16写道: > > > > > > * Li Feng (fen...@smartx.com) wrote: > > > > EXSi CPU is : Intel(R) Xeon(R) CPU E5-2640 v3 @

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

2020-05-06 Thread Li Feng
Thanks, Feng Li Dima Stepanov 于2020年4月30日周四 下午9:36写道: > > During testing of the vhost-user-blk reconnect functionality the qemu > SIGSEGV was triggered: > start qemu as: > x86_64-softmmu/qemu-system-x86_64 -m 1024M -M q35 \ >-object >

[PATCH] fix vhost_user_blk_watch crash

2020-03-23 Thread Li Feng
the G_IO_HUP is watched in tcp_chr_connect, and the callback vhost_user_blk_watch is not needed, because tcp_chr_hup is registered as callback. And it will close the tcp link. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 19 --- include/hw/virtio/vhost-user

[PATCH v3 2/2] char-socket: initialize reconnect timer only when the timer doesn't start

2020-05-07 Thread Li Feng
: qemu_chr_socket_restart_timer: Assertion `!s->reconnect_timer' failed. Signed-off-by: Li Feng --- chardev/char-socket.c | 2 +- tests/test-char.c | 68 --- 2 files changed, 55 insertions(+), 15 deletions(-) diff --git a/chardev/char-socket.c b/chardev/c

[PATCH v3 1/2] io/channel: fix crash when qio_channel_readv_all return 0

2020-05-07 Thread Li Feng
556ae12 in char_socket_client_server_thread (data=data@entry=0x5582e350) at tests/test-char.c:891 #9 0x555a95b6 in qemu_thread_start (args=) at util/qemu-thread-posix.c:519 #10 0x75e61e25 in start_thread () from /lib64/libpthread.so.0 #11 0x000075b8bbad in clone ()

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-21 Thread Li Feng
Paolo, Million thanks. I will try to dig into this code in my spare time. Thanks, Feng Li Paolo Bonzini 于2020年5月20日周三 下午6:27写道: > > On 20/05/20 12:15, Li Feng wrote: > > /root/qemu-master/x86_64-softmmu/qemu-system-x86_64 -enable-kvm > > -device virtio-balloon -cpu > &g

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-19 Thread Li Feng
Hi, Any update about this issue? Thanks, Feng Li Li Feng 于2020年5月14日周四 下午11:49写道: > > Dr. David Alan Gilbert 于2020年5月14日周四 下午11:31写道: > > > > * Li Feng (fen...@smartx.com) wrote: > > > Dr. David Alan Gilbert 于2020年5月14日周四 下午11:16写道: > > > > >

[PATCH v5] char-socket: initialize reconnect timer only when the timer doesn't start

2020-05-21 Thread Li Feng
: qemu_chr_socket_restart_timer: Assertion `!s->reconnect_timer' failed. Signed-off-by: Li Feng --- v5: - rebase to master v4: - remove the wrong patch - fix the char_socket_ping_pong to support the reconnect exception test v3: - add a patch to fix a crash when recvmsg return 0 - make the tests reproduce the two cr

[PATCH] vhost-scsi: support inflight io track

2020-09-09 Thread Li Feng
Qemu will send GET_INFLIGHT_FD and SET_INFLIGH_FD to backend, and the backend setup the inflight memory to track the io. Change-Id: I805d6189996f7a1b44c65f0b12ef7473b1789510 Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 27 +++ include/hw/virtio

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

2020-06-01 Thread Li Feng
e based on the similar changes for the vhost-user-net > > device: > > commit e7c83a885f865128ae3cf1946f8cb538b63cbfba > > "vhost-user: delay vhost_user_stop" > > > > Signed-off-by: Dima Stepanov > > Reviewed-by: Raphael Norwitz > > Li Feng - would you also like to sign

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-20 Thread Li Feng
Paolo Bonzini 于2020年5月20日周三 下午3:28写道: > > On 20/05/20 05:50, Li Feng wrote: > >>>>>>>>> qemu-system-x86_64: error: failed to set MSR 0x48f to > >>>>>>>>> 0x7fefff00036dfb > > The high 32 bits are 0111 111

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-20 Thread Li Feng
Paolo Bonzini 于2020年5月20日周三 下午4:32写道: > > On 20/05/20 10:22, Li Feng wrote: > >> - bit 2, vmx-exit-nosave-debugctl > >> - bit 9, host address space size, is handled automatically by QEMU > >> - bit 15, vmx-exit-ack-intr > >> - bit 17, vmx-exit-save-pat &

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-20 Thread Li Feng
Paolo Bonzini 于2020年5月20日周三 下午6:10写道: > > On 20/05/20 11:36, Li Feng wrote: > >> Can you do "rdmsr 0x48f" (as root)? On my machine for example I get > >> 1ff00036dfb. > >> > > $ rdmsr 0x48f > > 3f00036dfb > > > > Hmm,

Re: kvm_buf_set_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.

2020-05-20 Thread Li Feng
Paolo Bonzini 于2020年5月20日周三 下午5:34写道: > > On 20/05/20 10:55, Li Feng wrote: > >>> After computing xor, the result is 0b10. > >>> The bit 9 is set. > >> Are you running KVM with a 32-bit kernel. > >> > > No, I'm running 64 bit. > &g

Fwd: [PATCH v5] char-socket: initialize reconnect timer only when the timer doesn't start

2020-06-17 Thread Li Feng
Hi Lureau, When will this patch be merged? Thanks, Feng Li. -- Forwarded message - 发件人: Dima Stepanov Date: 2020年6月15日周一 下午4:43 Subject: Re: [PATCH v5] char-socket: initialize reconnect timer only when the timer doesn't start To: Li Feng Hi, I don't see this change merged

Re: [PATCH] file-posix: check the use_lock

2020-12-07 Thread Li Feng
ilesystem manually, and it's probably completely impossible in a > test case without root permissions. > > So maybe just add a more detailed description of the bug to the commit > message, and we'll have to apply it without a test. > > Kevin > > > Li Feng 于2020年12月4日周五 下午6

[PATCH v2] file-posix: check the use_lock before setting the file lock

2020-12-07 Thread Li Feng
he syscall of 'fcnctl' will return non-zero. Signed-off-by: Li Feng --- block/file-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index d5fd1dbcd2..806764f7e3 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -3104

Re: [PATCH] file-posix: detect the lock using the real file

2020-12-08 Thread Li Feng
Daniel P. Berrangé 于2020年12月8日周二 下午9:45写道: > > On Tue, Dec 08, 2020 at 08:59:37PM +0800, Li Feng wrote: > > This patch addresses this issue: > > When accessing a volume on an NFS filesystem without supporting the file > > lock, > > tools, like qemu-img, will com

Re: [PATCH] file-posix: detect the lock using the real file

2020-12-08 Thread Li Feng
Kevin Wolf 于2020年12月8日周二 下午10:38写道: > > Am 08.12.2020 um 13:59 hat Li Feng geschrieben: > > This patch addresses this issue: > > When accessing a volume on an NFS filesystem without supporting the file > > lock, > > tools, like qemu-img, will com

[PATCH v2] file-posix: detect the lock using the real file

2020-12-08 Thread Li Feng
ly, the file.locking is per-drive property, which depends on the underlay filesystem. In this patch, make the 'qemu_has_ofd_lock' with a filename be more generic and reasonable. Signed-off-by: Li Feng --- v2: remove the refactoring. --- block/file-posix.c | 32 ++

[PATCH] file-posix: detect the lock using the real file

2020-12-08 Thread Li Feng
ly, the file.locking is per-drive property, which depends on the underlay filesystem. In this patch, make the 'qemu_has_ofd_lock' with a filename be more generic and reasonable. Signed-off-by: Li Feng --- block/file-posix.c | 32 +++- include/qemu/osdep.h

Re: [PATCH] file-posix: detect the lock using the real file

2020-12-10 Thread Li Feng
Kevin Wolf 于2020年12月10日周四 上午1:43写道: > > Am 09.12.2020 um 10:33 hat Daniel P. Berrangé geschrieben: > > On Tue, Dec 08, 2020 at 03:38:22PM +0100, Kevin Wolf wrote: > > > Am 08.12.2020 um 13:59 hat Li Feng geschrieben: > > > > This patch addresses this issue

[PATCH] file-posix: check the use_lock

2020-12-04 Thread Li Feng
When setting the file.locking = false, we shouldn't set the lock. Signed-off-by: Li Feng --- block/file-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index d5fd1dbcd2..806764f7e3 100644 --- a/block/file-posix.c +++ b/block

Re: [PATCH] file-posix: check the use_lock

2020-12-04 Thread Li Feng
byte 100 I will look at the iotest 182 and try to add a test. Thanks, Feng Li Kevin Wolf 于2020年12月4日周五 下午6:40写道: > > Am 04.12.2020 um 11:28 hat Li Feng geschrieben: > > When setting the file.locking = false, we shouldn't set the lock. > > > > Signed-off-by: Li Feng &g

[PATCH v3] file-posix: detect the lock using the real file

2020-12-10 Thread Li Feng
ve is auto mode, use the 'qemu_has_file_lock' to set the toggle. Signed-off-by: Li Feng --- v3: don't call the qemu_has_ofd_lock, use a new function instead. v2: remove the refactoring. --- block/file-posix.c | 30 +- include/qemu/osdep.h | 1 + util/osdep.c

[PATCH v4] file-posix: detect the lock using the real file

2020-12-14 Thread Li Feng
ly, the file.locking is per-drive property, which depends on the underlay filesystem. In this patch, add a new 'qemu_has_file_lock' to detect whether the file supports the file lock. And disable the lock when the underlay file system doesn't support locks. Signed-off-by: Li Feng

Re: [PATCH v4] file-posix: detect the lock using the real file

2020-12-15 Thread Li Feng
Daniel P. Berrangé 于2020年12月15日周二 下午6:08写道: > > On Tue, Dec 15, 2020 at 03:09:28PM +0800, Li Feng wrote: > > This patch addresses this issue: > > When accessing a volume on an NFS filesystem without supporting the file > > lock, > > tools, like qemu-img, will com

[PATCH v5] file-posix: detect the lock using the real file

2020-12-15 Thread Li Feng
ly, the file.locking is per-drive property, which depends on the underlay filesystem. In this patch, add a new 'qemu_has_file_lock' to detect whether the file supports the file lock. And disable the lock when the underlay file system doesn't support locks. Signed-off-by: Li Feng --- v5: simpli

[PATCH v2] file-posix: detect the lock using the real file

2020-12-10 Thread Li Feng
ly, the file.locking is per-drive property, which depends on the underlay filesystem. In this patch, make the 'qemu_has_ofd_lock' with a filename be more generic and reasonable. Signed-off-by: Li Feng --- v2: remove the refactoring. --- block/file-posix.c | 32 ++

Re: [PATCH v3 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-09-12 Thread Li Feng
> On 1 Sep 2023, at 8:00 PM, Markus Armbruster wrote: > > Li Feng mailto:fen...@smartx.com>> writes: > >> Add a Error parameter to report the real error, like vhost-user-blk. >> >> Signed-off-by: Li Feng >> --- >> hw/scsi/vhost-scsi-common.c

[PATCH v4 0/5] Implement reconnect for vhost-user-scsi

2023-09-12 Thread Li Feng
the v1 patch to small separate patchset; - New patch for fixing fd leak, which has sent to reviewers in another mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user

[PATCH v4 4/5] vhost-user-scsi: start vhost when guest kicks

2023-09-12 Thread Li Feng
Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng --- hw/scsi/vhost-user-scsi.c | 51 +++ 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/hw/scsi

[PATCH v4 1/5] vhost-user-common: send get_inflight_fd once

2023-09-12 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index a06f01af26

[PATCH v4 5/5] vhost-user: fix lost reconnect

2023-09-12 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 9 +++-- include/hw/virtio/vhost-user.h | 3 ++- 4 files changed, 11 insertions(+), 5 delet

[PATCH v4 2/5] vhost: move and rename the conn retry times

2023-09-12 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw

Re: [PATCH v3 5/5] vhost-user-scsi: start vhost when guest kicks

2023-09-12 Thread Li Feng
> On 1 Sep 2023, at 7:44 PM, Markus Armbruster wrote: > > Li Feng mailto:fen...@smartx.com>> writes: > >> Let's keep the same behavior as vhost-user-blk. >> >> Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. >> >> Sign

[PATCH v4 3/5] vhost-user-scsi: support reconnect to backend

2023-09-12 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +- hw/scsi

Re: [PATCH v3 4/5] vhost-user-scsi: support reconnect to backend

2023-09-12 Thread Li Feng
> On 1 Sep 2023, at 8:00 PM, Markus Armbruster wrote: > > Li Feng mailto:fen...@smartx.com>> writes: > >> If the backend crashes and restarts, the device is broken. >> This patch adds reconnect for vhost-user-scsi. >> >> Tested with spdk backend. &

[PATCH v3 0/2] Fix vhost reconnect issues

2023-08-29 Thread Li Feng
/ Changes for v3: - Fix the code style. Changes for v2: - Add a event_cb in VhostAsyncCallback to be called when dev is NULL; - Fix the error report message. Li Feng (2): vhost-user: Fix lost reconnect vhost: Add Error parameter to vhost_scsi_common_start() hw/block/vhost-user-blk.c

[PATCH v3 2/2] vhost: Add Error parameter to vhost_scsi_common_start()

2023-08-29 Thread Li Feng
Add a Error parameter to report the real error, like vhost-user-blk. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +--- hw/scsi/vhost-scsi.c | 5 +++-- hw/scsi/vhost-user-scsi.c | 14 -- include/hw/virtio/vhost-scsi

Re: [PATCH v2 1/2] vhost-user: Fix lost reconnect

2023-08-29 Thread Li Feng
> On 30 Aug 2023, at 6:11 AM, Raphael Norwitz > wrote: > > > >> On Aug 24, 2023, at 3:41 AM, Li Feng wrote: >> >> When the vhost-user is reconnecting to the backend, and if the vhost-user >> fails >> at the get_features in v

[PATCH v3 1/2] vhost-user: Fix lost reconnect

2023-08-30 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 9 +++-- include/hw/virtio/vhost-user.h | 3 ++-

[PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-09-22 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index a06f01af26

[PATCH v6 3/5] vhost-user-scsi: support reconnect to backend

2023-09-22 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +- hw/scsi

[PATCH v6 5/5] vhost-user: fix lost reconnect

2023-09-22 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 10 -- include/hw/virtio/vhost-user.h | 3 +

[PATCH v6 4/5] vhost-user-scsi: start vhost when guest kicks

2023-09-22 Thread Li Feng
Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/hw/scsi

[PATCH v6 2/5] vhost: move and rename the conn retry times

2023-09-22 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw

[PATCH v6 0/5] Implement reconnect for vhost-user-scsi

2023-09-22 Thread Li Feng
patch to small separate patchset; - New patch for fixing fd leak, which has sent to reviewers in another mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user-common

[PATCH v5 3/5] vhost-user-scsi: support reconnect to backend

2023-09-19 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +- hw/scsi

[PATCH v5 1/5] vhost-user-common: send get_inflight_fd once

2023-09-19 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index a06f01af26

[PATCH v5 4/5] vhost-user-scsi: start vhost when guest kicks

2023-09-19 Thread Li Feng
Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/hw/scsi

[PATCH v5 5/5] vhost-user: fix lost reconnect

2023-09-19 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 9 +++-- include/hw/virtio/vhost-user.h | 3 ++-

[PATCH v5 0/5] Implement reconnect for vhost-user-scsi

2023-09-19 Thread Li Feng
; - New patch for fixing fd leak, which has sent to reviewers in another mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user-common: send get_inflight_fd once vhost

[PATCH v5 2/5] vhost: move and rename the conn retry times

2023-09-19 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw

[PATCH v8 5/5] vhost-user: fix lost reconnect

2023-10-08 Thread Li Feng
a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-gpio.c| 2 +- hw/virtio/vhost-user.c | 10 -- incl

[PATCH v8 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +- hw/scsi

[PATCH v8 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
. This patch is a preparation for the following patches. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/scsi/vhost-scsi-common.c | 37 ++--- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi

Re: [PATCH v7 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
Thanks for your comments, I will submit the v8. > On 8 Oct 2023, at 6:46 PM, Manos Pitsidianakis > wrote: > > Hello Li, I have some trivial style comments you could possibly address in a > next version: > > On Sun, 08 Oct 2023 12:12, Li Feng wrote: >> diff --git

[PATCH v8 2/5] vhost: move and rename the conn retry times

2023-10-08 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw

[PATCH v8 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Li Feng
reviewers in another mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user-common: send get_inflight_fd once vhost: move and rename the conn retry times vhost-user-scs

[PATCH v8 4/5] vhost-user-scsi: start vhost when guest kicks

2023-10-08 Thread Li Feng
Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/scsi/vhost-user-scsi.c | 48 +++ 1 file changed, 44 insertions(+), 4

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz wrote: > > > > > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > > > Currently the get_inflight_fd will be sent every time the device is > > started, and > > the backend will allocate shared memory to save

Re: [PATCH v6 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
you? Otherwise do you think we should also > fix up the vhost-user-blk realize function? > > > On Sep 22, 2023, at 7:46 AM, Li Feng wrote: > > > > If the backend crashes and restarts, the device is broken. > > This patch adds reconnect for vhost-user-scsi. > &

Re: [PATCH v8 0/5] Implement reconnect for vhost-user-scsi

2023-10-18 Thread Li Feng
Hello Guys, Ping… These patches have been waiting for a long time. Can they be merged? Best Regards, li > On 9 Oct 2023, at 12:46 PM, Li Feng wrote: > > Changes for v8: > - [PATCH 3/5] vhost-user-scsi: support reconnect to backend > - Fix code style suggested by Mano

Re: [PATCH v6 1/5] vhost-user-common: send get_inflight_fd once

2023-10-08 Thread Li Feng
On Sun, Oct 8, 2023 at 4:51 PM Michael S. Tsirkin wrote: > > On Sun, Oct 08, 2023 at 04:49:05PM +0800, Li Feng wrote: > > On Fri, Sep 29, 2023 at 8:55 AM Raphael Norwitz > > wrote: > > > > > > > > > > > > > On Sep 22, 20

Re: [PATCH v6 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Li Feng
On Sun, Oct 8, 2023 at 4:49 PM Michael S. Tsirkin wrote: > > On Fri, Sep 22, 2023 at 07:46:10PM +0800, Li Feng wrote: > > Changes for v6: > > - [PATCH] vhost-user: fix lost reconnect > > - Fix missing assign event_cb. > > > Pls don't make vN+1 a reply to vN

[PATCH v7 3/5] vhost-user-scsi: support reconnect to backend

2023-10-08 Thread Li Feng
If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng --- hw/scsi/vhost-scsi-common.c | 16 +- hw/scsi

[PATCH v7 2/5] vhost: move and rename the conn retry times

2023-10-08 Thread Li Feng
Multiple devices need this macro, move it to a common header. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 4 +--- hw/virtio/vhost-user-gpio.c | 3 +-- include/hw/virtio/vhost.h | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw

[PATCH v7 0/5] Implement reconnect for vhost-user-scsi

2023-10-08 Thread Li Feng
her mail; - Implement the `vhost_user_scsi_handle_output`; - Add the started_vu safe check; - Fix error handler; - Check the inflight before set/get inflight fd. Li Feng (5): vhost-user-common: send get_inflight_fd once vhost: move and rename the conn retry times vhost-user-scsi: support

  1   2   >