Il 03/07/2013 03:10, Fam Zheng ha scritto: > > This has the important side effect of marking the exported disk as > > "in_use" (to use the terms before the series). Right now you can serve > > a disk and, at the same time, stream it or mirror it or create a live > > snapshot of it. > > > > Do we really want to block anything for a device being served? Perhaps > > truncation, but maybe not even that. The NBD server is meant to be as > > unobtrusive as possible (in some sense NBD accesses are the same as > > guest accesses). > > OK, it is better to work like that. But I don't quite understand why was > there drive_get_ref() on the device (w/o the series), as there's already > a close notifier? And it just drive_put_ref() when bs is closed?
The close notifier runs when the user invokes a drive_del or eject command from the monitor. The drive_get_ref/drive_put_ref delays the bdrv_delete until after nbd.c has cleaned up all the connections. Paolo