Re: [PATCH 4/4] KVM: selftests: Remove duplicate guest mode handling

From: Andrew Jones
Date: Thu Aug 29 2019 - 05:22:41 EST


On Thu, Aug 29, 2019 at 10:09:35AM +0800, Peter Xu wrote:
> On Wed, Aug 28, 2019 at 01:46:13PM +0200, Andrew Jones wrote:
>
> [...]
>
> > > +unsigned int vm_get_page_size(struct kvm_vm *vm)
> > > +{
> > > + return vm->page_size;
> > > +}
> > > +
> > > +unsigned int vm_get_page_shift(struct kvm_vm *vm)
> > > +{
> > > + return vm->page_shift;
> > > +}
> >
> > We could get by with just one of the above two, but whatever
>
> Right... and imho if we export kvm_vm struct we don't even any
> helpers. :) But I didn't touch that.

yeah, I'm starting to wonder if there's much value in keeping the vm and
vcpu structures private. I've already had a couple cases where I wanted
to write a quick+dirty test that needed the vcpu_fd, so I cheated and
included the internal header to get to it.

Thanks,
drew

>
> > > +
> > > +unsigned int vm_get_max_gfn(struct kvm_vm *vm)
> > > +{
> > > + return vm->max_gfn;
> > > +}
> > > --
> > > 2.21.0
> > >
> >
> > Reviewed-by: Andrew Jones <drjones@xxxxxxxxxx>
>
> Thanks!
>
> --
> Peter Xu