Terminology: instance = one (nbd) blockdev/one chardev/the single migrationstate connection = one TCP connection
Hello Everyone, Having read all the comments, here is proposal v2: Every instance registers itself with a unique name in the form "blockdev:<node-name>", "chardev:<chardev-name>" and "migration" using yank_register_instance which will do some sanity checks like checking if the same name exists already. Then (multiple) yank functions can be registered as needed with that single name. When the instance exits/is removed, it unregisters all yank functions and unregisters it's name with yank_unregister_instance which will check if all yank functions where unregistered. Every instance that supports the yank feature will register itself and the yank functions unconditionally (No extra 'yank' option per instance). The 'query-yank' oob qmp command lists the names of all registered instances. The 'yank' oob qmp command takes a list of names and for every name calls all yank functions registered with that name. Before doing anything, it will check that all names exist. If the instance has multiple connections (say, migration with multifd), i don't think it makes much sense to just shutdown one connection. Calling 'yank' on a instance will always shutdown all connections of that instance. Yank functions are generic and in no way limited to connections. Say, if migration is started to an 'exec:' address, migration could register a yank function to kill that external command on yank (Won't be implemented yet though). Regards, Lukas Straub
pgpIjV1bZXPyk.pgp
Description: OpenPGP digital signature