RFC: qemu: use uuid instead of name for misc filenames

Nikolay Shirokovskiy nshirokovskiy at virtuozzo.com
Thu Feb 27 12:57:04 UTC 2020


Hi, everyone.                                                                   
                                                                                
I'm working on supporting domain renaming when it has snapshots which is not    
supported now. And it strikes me things will be much simplier to manage on      
renaming if we use uuid in filenames instead of domain names.                   
                                                                                
1. Renaming will only involve saving updated config.                            
The saving is atomic thanx to tmp file and rename(2) approach. In constast      
current renaming on error paths can leave config with old or new name. Thus     
on libvirt restart extra VM will appear.

And we don't need to rename autostart links, snapshot directories etc.                                   
                                                                                
2. Renaming will be possible for running domains with no efforts.               
We only need to pass uuid instead of name in '-name guest=...' command line.    
                                                                                
3. Mgmt can stop using autogenerated names for domains.                         
I guess openstack for example uses names like instance-000002ff because we      
have many limitations on domain renaming. And if these limitations are removed  
then openstack can just use user supplied names for domains.
                                                                                
4. No issues with long domain names and filename length limit                   
                                                                                
If the above conversion makes sense I guess the good time to apply it is        
on domain start (and rename to support renaming with snapshots).                
                                                                                
I guess we can also have tool (some virsh command) for developers to generate   
symlinks so one can access logs, configs etc by name instead of uuid.


Nikolay





More information about the libvir-list mailing list