Re: [PATCH v6 2/3] KVM: selftests: Allow creation of selftest VM without vcpus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shortlog and new function name are a bit confusing.  The framework already supports
creating VMs without vCPUs, what it doesn't provide is a helper to load the guest
code and do the other "default" stuff.

That said, the framework is such an absolute mess that I'm fine going with
vm_create_without_vcpus() for now, carving out a more appropriate name will be an
exercise in futility without a large-scale renaming and refactoring of the other
crud.

So just a different shortlog I supposed, though even that seems doomed to be
contradictory.  Maybe something like this?

  KVM: selftests: Carve out helper to create "default" VM without vCPUs

Default in quotes because the selftests already have a goofy interpretation of
"default".

On Wed, Feb 09, 2022, David Dunn wrote:
> Break out portion of vm_create_with_vcpus so that selftests can modify
> the VM prior to creating vcpus.
> 
> Signed-off-by: David Dunn <daviddunn@xxxxxxxxxx>
> ---
>  .../selftests/kvm/include/kvm_util_base.h     |  3 ++
>  tools/testing/selftests/kvm/lib/kvm_util.c    | 35 +++++++++++++++----
>  2 files changed, 32 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h b/tools/testing/selftests/kvm/include/kvm_util_base.h
> index 4ed6aa049a91..2bdf96f520aa 100644
> --- a/tools/testing/selftests/kvm/include/kvm_util_base.h
> +++ b/tools/testing/selftests/kvm/include/kvm_util_base.h
> @@ -336,6 +336,9 @@ struct kvm_vm *vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus,
>  				    uint32_t num_percpu_pages, void *guest_code,
>  				    uint32_t vcpuids[]);
>  
> +/* First phase of vm_create_with_vcpus, allows customization before vcpu add */

Eh, drop the comment, the association is obvious from the code, and it's just one
more thing that needs to be updated when this stuff finally gets cleaned up.

> +struct kvm_vm *vm_create_without_vcpus(enum vm_guest_mode mode, uint64_t pages);
> +
>  /*
>   * Adds a vCPU with reasonable defaults (e.g. a stack)
>   *



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux