
on 2014/04/24 16:57, Mark Wu wrote:
I don't like the idea of updating template to support pci passthrough because one pci device can only be attached on one guest. This usage breaks the semantics of template. I know we have adopted this method to support SCSI LUN volume. But I think we need stop moving towards that direction. I want to propose the following way to resolve this problem:
Provides an option to allow user do customization based on the selected template when he create vm from the template. Then the guest xml generation code merge the customized configuration into template xml. It makes more sense to handle vm specific configuration than updating template.
I considered the same way you suggested. A big problem is that all the XML generation code now is in template class but not VM class. I think there should be no XML generation code in template, and template should only produce VM with proper parameters, then the VM generates the XML itself according to the parameters given by the templates and overrides given by the user. I don't see any benefit to place XML generation code in template class. Let's raise a discussion in a separated thread for this problem. I'll cc you in the new thread.