Ok, why we did undefine before define is worrying about the define will fail if VM exists. 
But it seems no need to do. Yes, define will not fail even if the domain name is used,
it looks like a 'redefine' at this situation. And if the VM is running , 'redefine' will take effect
on next boot. 

Anyway, undefine in sync() is not necessary, also the backup. I will send a patch for it. 

Thanx.