qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 26/35] kvm: Eliminate KVMState arguments


From: Jan Kiszka
Subject: [Qemu-devel] Re: [PATCH 26/35] kvm: Eliminate KVMState arguments
Date: Fri, 07 Jan 2011 10:03:11 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Am 06.01.2011 20:24, Anthony Liguori wrote:
> On 01/06/2011 11:56 AM, Marcelo Tosatti wrote:
>> From: Jan Kiszka<address@hidden>
>>
>> QEMU supports only one VM, so there is only one kvm_state per process,
>> and we gain nothing passing a reference to it around. Eliminate any need
>> to refer to it outside of kvm-all.c.
>>
>> Signed-off-by: Jan Kiszka<address@hidden>
>> CC: Alexander Graf<address@hidden>
>> Signed-off-by: Marcelo Tosatti<address@hidden>
>>    
> 
> I think this is a big mistake.

Obviously, I don't share your concerns. :)

> 
> Having to manage kvm_state keeps the abstraction lines well defined. 

How does it help?

> Otherwise, it's far too easy for portions of code to call into KVM
> functions that really shouldn't.

I can't imagine we gain anything from requiring kvm_check_extension
callers to hold a kvm_state "capability". Yes, it's now much easier to
call kvm_[vm_]ioctl, but that's the key point of this change:

So far we primarily complicated the internal interface between generic
and arch-dependent kvm parts by requiring kvm_state joggling. But
external users already find interfaces without this restriction
(kvm_log_*, kvm_ioeventfd_*, ...). That's because it's at least
complicated to _cleanly_ pass kvm_state references to all users that
need it - e.g. sysbus devices like kvmclock or upcoming in-kernel irqchips.

Let's just stop this artificial abstraction that has no practical use
and focus on detecting layering violations via code review. That's more
reliable IMHO.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]