Am 07.09.2012 17:50, schrieb Paolo Bonzini: > Il 27/08/2012 17:00, Paolo Bonzini ha scritto: >> The part where I need >> a second opinion and/or ack is patch 12 and 13. They fix the case of >> a disk being unplugged while NBD export is active. To do this I add a >> NotifierList to a BlockDriverState. Does this look okay, or is it too >> ad hoc? > > Ping... Kevin/Stefan, could you look at just these two patches: > > http://permalink.gmane.org/gmane.comp.emulators.qemu/167411 > [12/13] block: add close notifiers > > http://permalink.gmane.org/gmane.comp.emulators.qemu/167410 > [13/13] nbd: add notifier to close exports when the image is closed > > and if you need some context: > > http://permalink.gmane.org/gmane.comp.emulators.qemu/167400 > [09/13] qmp: add NBD server commands > > > Everything else is totally uninteresting.
I was planning to review it in more detail next week, but I just had a quick look. I'm not sure if automatically shutting down the NBD server when the guest stops using it is always right (for removable media it could even be an eject from the guest), but introducing a notifier list doesn't look too bad. We can probably use it for other things that are currently hardcoded in bdrv_close() with some if statements, like disabling I/O throttling, cancelling a block job, etc. Kevin