hello, after some debugging, I am suspecting
https://github.com/qemu/qemu/blob/b0ca999a43a22b38158a222233d3f5881648bb4f/hw/block/vhost-user-blk.c#L376
this code creates a watcher which
might not be released ( in 4.2.0), if I remove this line, looks like
device_del + chardev-remove could correctly release unix link.

On Thu, Feb 10, 2022 at 11:03 AM Jiatong Shen <yshxxsjt...@gmail.com> wrote:

> Hello, I figured out I should have executed chardev-remove to disconnect
> unix socket connection. It actually works on qemu 6.2.0.
> but for qemu 4.2.0 even after delete chardev device, the connection is not
> disconnected, My current assumption is that char-socket
> object ref count is not 0 after connection_free.
>
> My question is is there a simple way to track ref count for a specific
> object? thank you.
>
> On Wed, Feb 9, 2022 at 3:07 PM Jiatong Shen <yshxxsjt...@gmail.com> wrote:
>
>> Hello community,
>>
>>   I am testing vhost-user-blk. the virtual machine is started with the
>> following command
>>
>> ./x86_64-softmmu/qemu-system-x86_64 \
>> --enable-kvm \
>> -smp 2 \
>> -chardev
>> socket,id=chr-vu-virtio-disk0,path=/var/lib/nova/volume-04789a9b-21ce-4270-89bd-638700a0e56c,reconnect=10
>> \
>> -device
>> vhost-user-blk-pci,bus=pci.0,addr=0x8,chardev=chr-vu-virtio-disk0,id=virtio-disk0
>> \
>> -chardev
>> socket,id=chr-vu-virtio-disk1,path=/var/lib/nova/volume-9590b74a-c652-4e97-a88d-f736000b4886,reconnect=10
>> \
>> -device
>> vhost-user-blk-pci,bus=pci.0,addr=0x9,chardev=chr-vu-virtio-disk1,id=virtio-disk1
>> \
>> -m 2048 \
>> -overcommit mem-lock=off \
>> -smp 2,sockets=2,dies=1,cores=1,threads=1 \
>> -object
>> memory-backend-file,id=ram-node0,mem-path=/dev/hugepages/libvirt/qemu/7-instance-00000005,share=on,prealloc=on,size=2147483648,host-nodes=0,policy=bind
>> \
>> -numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
>> -monitor stdio \
>> -vnc :0
>>
>> the two devices are hosted by spdk vhost application
>>
>> it uses two vhost-user-blk devices. then in the monitor, I execute
>>
>> device_del virtio-disk1
>>
>> the command completed successfully and in the virtual machine the disk is
>> gone.
>>
>> but when I execute spdk vhost_delete_controller, this command will fail
>> with spdk vhost application complained
>>
>> [2022-02-09 14:52:30.487815] vhost.c:1013:vhost_dev_unregister: *ERROR*:
>> Controller volume-9590b74a-c652-4e97-a88d-f736000b4
>>
>> it looks like qemu  does not disconnect unix socket connection even
>> though the device is removed.
>>
>> My question is: is device_del enough? do I need to remove chardev as
>> well? thank you.
>>
>> --
>>
>> Best Regards,
>>
>> Jiatong Shen
>>
>
>
> --
>
> Best Regards,
>
> Jiatong Shen
>


-- 

Best Regards,

Jiatong Shen

Reply via email to