|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v9 2/5] xen: add parent_domid field to createdomain domctl
Hi Tamas, On 21/02/2020 21:35, Tamas K Lengyel wrote: On Fri, Feb 21, 2020 at 2:03 PM Julien Grall <julien@xxxxxxx> wrote:Hi Tamas, On 21/02/2020 18:49, Tamas K Lengyel wrote:When creating a domain that will be used as a VM fork some information is required to set things up properly, like the max_vcpus count. Instead of the toolstack having to gather this information for each fork in a separate hypercall we can just include the parent domain's id in the createdomain domctl so that Xen can copy the setting without the extra toolstack queries.It is not entirely clear why you only want to copy max_vcpus. From my understanding, when you are going to fork a domain you will want the domain to be nearly identical. So how do you decide what to copy?All parameters of the parent domain need to be copied, but during createdomain domctl only max_vcpus is required. The rest are copied during XENMEM_sharing_op_fork. I don't believe max_vcpus is the only field required here. Most of the information hold in the structure are required at creation time so the domain is configured correctly. For instance, on Arm, the version of interrupt controller can only be configured at creation time. For x86, I am pretty sure the emuflags have to be correct at creation time as well. So it feels weird to me that you only need to copy max_vcpus here. Because if you are able to fill up the other fields of the structure, then most likely you have the max_vcpus in hand as well. The current suggestion is too restrictive and only save you one hypercall. IMHO, if we are going to update createdomain, then all the fields but parent_domid should be ignored when the latter is valid. The fields can then be filled up and copied back to the toolstack so it can consumed the information.
Maybe not in the context VM fork. But ... Currently I don't think it would work, so I consider that to be out-of-scope. ... this is a generic hypercall and therefore we should be open to other usecase. I am not asking to check whether we can recreate a domain based on dom0. I am only asking to be mindful with your interface and not put ourself in a corner just because this is out-of-scope for you. The more important bit for me my point 1). I.e not assuming that 0 is an invalid value for domid. So we should consider a different value to indicate whether we want to clone from a domain. Maybe by setting bit 16 of the parent_domid?I can add a XEN_DOMCTL_CDF_fork flag, but I think that's an overkill. See above. If you are going to modify a common interface then you need to bear in mind how this can be used.
Bear in mind that developpers don't want to play the blame game everytime they want to understand an interfaces. So you either want to use a meaningful name or a comment in your code. Maybe "clone_domid" would be clearer here. Yet it is not clear that only "max_vcpus" is going to be copied. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |