Closed suzj801 closed 7 years ago
Hi, Thank you for the interest to the project. A few comments on your changes.
Regarding this changes
- util.pread2(["ln", "-s", dev, _dev_name])
+ util.pread2(["ln", "-bs", dev, _dev_name])
If all is normal, the link that is made here shouldn't exist, as it should be deleted on unmap
operation. If it exists then something went wrong.
I think it would be better to receive an error and make some investigation than ignore the problem by making the backup copy of existing file using -b
option with ln
command
The same situation with this changes
+ self.session.xenapi.VDI.remove_from_sm_config(vdi_ref, 'dm')
self.session.xenapi.VDI.add_to_sm_config(vdi_ref, 'dm', dm)
The dm
attribute in sm_config is deleted on unmap operation and shouldn't exist before VDI is mapped. So it is not required to delete it before add it to sm_config if all is normal.
And again it would be better to receive error than ignore problem. If VDI is not mapped but sm_config has atttribute dm
then something went wrong and some investigation is required.
Thank you.
Thanks for reply. This may happend after the host crushed or power off. So I find the problem that can't boot the guest vms.