On Fri, Nov 05, 2010 at 05:01:49PM +0100, Markus Armbruster wrote: > "Michael S. Tsirkin" <m...@redhat.com> writes: > > > On Fri, Nov 05, 2010 at 02:27:49PM +0100, Markus Armbruster wrote: > >> I'd be fine with any of these: > >> > >> 1. A new command "device_disconnet ID" (or similar name) to disconnect > >> device ID from any host parts. Nice touch: you don't have to know > >> about the device's host part(s) to disconnect it. But it might be > >> more work than the other two. > >> > >> 2. New commands netdev_disconnect, drive_disconnect (or similar names) > >> to disconnect a host part from a guest device. Like (1), except you > >> have to point to the other end of the connection to cut it. > > > > I think it's cleaner not to introduce a concept of a disconnected > > backend. > > Backends start disconnected, so the concept already exists. > > > One thing that we must be careful to explicitly disallow, is > > reconnecting guest to another host backend. The reason being > > that guest might rely on backend features and changing these > > would break this. > > > > Given that, disconnecting without delete isn't helpful. > > What about disconnect, hot plug new device, connect?
Exactly. I don't think we want to support this. New device might not support all features that old one has. Or it may have more features. > >> 3. A new command "drive_del ID" similar to existing netdev_del. This is > >> (2) fused with delete. Conceptual wart: you can't disconnect and > >> keep the host part around. Moreover, delete is slightly dangerous, > >> because it renders any guest device still using the host part > >> useless. > > > > I don't see how it's more dangerous than disconnecting. > > If guest can't access the backend it might not exist > > as far as guest is concerned. > > If we keep disconnect and delete separate operations, we can make delete > fail when still connected. Typo insurance. > > >> Do you need anything else from me to make progress? > > > > Let's go for 3. Need for 1/2 seems dubious, and it's much harder > > to support.