On Thu, Oct 23, 2025 at 10:34 AM Zhang Tianci
<[email protected]> wrote:
>
> Hi, thank you for your reply, but I still have a few questions:
>
> On Wed, Oct 22, 2025 at 7:31 PM Michael S. Tsirkin <[email protected]> wrote:
> >
> > On Wed, Oct 22, 2025 at 07:21:45PM +0800, Zhang Tianci wrote:
> > > Hi,
> > > I noticed that the reference count of the virtio_pci kernel module
> > > in the VM is always 0, even though there are at least two
> > > virtio block devices and one virtiofs device in the VM.
> > >
> > > Using rmmod virtio_pci can unload the virtio_pci module,
> > > but this renders the virtio block devices unusable.
> >
> > it removes them. you can put it back in and you will
> > get devices again.
>
> But I can't do it anymore because the rootfs is no longer available,
> or rather, the OS is no longer available.
>
> >
> > > I wonder if this result is expected? Why don't the virtio block devices
> > > and virtiofs device hold a reference count to the virtio_pci kernel 
> > > module?
> >
> > because they don't have to.
>
> Is it due to design reasons or implementation reasons?
> Is it because the semantics of kernel module refcnt does not include such
> logical dependency?

Note that virito has a bus so it follows the device/driver model so if
I was not wrong the refcnt was handled by the driver core.

Thanks

>
> Thanks,
> Tianci
>


Reply via email to