
在 2012-09-11二的 18:00 +0100,Daniel P. Berrange写道:
Good point - the new flag is necessary, and must be user-visible. At which point, do we argue that use of the MIGRATE_OFFLINE flag automatically implies MIGRATE_PERSISTENT, or should it be an error unless the user explicitly requests both flags?
It sort of depends what you consider the semantics of MIGRATE_OFFLINE to be. You can consider it to be a flag indicating that the guest must be in the shutoff state curently, or you can consider it to be a permission flag to indicate that migration is allowed if the guest is offline. The difference here is subtle - basically comes down to whether you raise an error if OFFLINE is set, and the guest is currently running.
In the case where you consider it a permission flag (which is what is currently implemented), then we must mandate use of the PERSISTENT flag, otherwise you get wierd semantics. eg The persistent config would not be copied if running, but would be copied if shutoff.
If you consider it a state flag, then I don't think it matters so much, though I would still prefer to see the MIGRATE_PERSISTENT flag specified explicitly. It would let you deal with a case where you have a shutoff guest, and you migrate the storage (using the appropriate flag) but do not migrate the config.
Yes, implicit flags really lead to misunderstanding.
Daniel
-- liguang lig.fnst@cn.fujitsu.com FNST linux kernel team