qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Amit Shah <amit.shah@qumranet.com>
Cc: muli@il.ibm.com, kvm@vger.kernel.org, weidong.han@intel.com,
	allen.m.kay@intel.com, qemu-devel@nongnu.org, benami@il.ibm.com,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [Qemu-devel] Re: [PATCH 1/1] KVM/userspace: Support for assigning PCI devices to guests
Date: Thu, 28 Aug 2008 08:11:33 -0500	[thread overview]
Message-ID: <48B6A405.2060108@codemonkey.ws> (raw)
In-Reply-To: <200808281718.01485.amit.shah@qumranet.com>

Amit Shah wrote:
> * On Wednesday 27 Aug 2008 19:20:26 Anthony Liguori wrote:
>   
>
>>>  libkvm/libkvm-x86.c         |   14 +
>>>  libkvm/libkvm.h             |   27 ++
>>>  qemu/Makefile.target        |    1 +
>>>  qemu/hw/device-assignment.c |  600
>>> +++++++++++++++++++++++++++++++++++++++++++ qemu/hw/device-assignment.h |
>>>   94 +++++++
>>>  qemu/hw/isa.h               |    2 +
>>>  qemu/hw/pc.c                |    9 +
>>>  qemu/hw/pci.c               |   12 +
>>>  qemu/hw/pci.h               |    1 +
>>>  qemu/hw/piix_pci.c          |   19 ++
>>>  qemu/vl.c                   |   18 ++
>>>  11 files changed, 797 insertions(+), 0 deletions(-)
>>>  create mode 100644 qemu/hw/device-assignment.c
>>>  create mode 100644 qemu/hw/device-assignment.h
>>>       
>> This patch is too big on it's on.  It should be split into logical parts.
>>     
>
> However, it just adds device assignment support and does nothing else. I don't 
> see a way of splitting this any more.
>   

The libkvm changes can go in there own patch.  The changes necessary to 
piix_pci can get in their own patch.  If you get creative, it's probably 
possible to split up device-assignment.c too.

> As you noticed, it's quite different. They have a lot more code in there. (3k+ 
> lines vs 600 lines). I guess most of it went away when we realised we didn't 
> need all that. Also, I noticed most of the code there is not in the qemu 
> style.
>   

What are you looking at?  In my version of xen-unstable, I see 
pass-through.c at 694 lines.  It's all in the right style too.

>> We try to avoid open coding calls to libkvm functions directly within
>> QEMU.  At the least, it should be wrapped with an if (kvm_enabled()).
>>     
>
> With the direct-mmio patch, we just start depending on KVM. Ben-Ami, is there 
> a chance you can keep the MMIO-via-userspace method supported as well for 
> non-kvm hosts?
>   

Open-coding calls to libkvm functions breaks the build when not using 
KVM.  They all need qemu-kvm.c wrappers.

> From your other mail:
>
>   
>> Where did this come from originally?  It's completely different from
>> what is in xen-unstable.  What's in xen-unstable is actually a lot nicer
>> IMHO.
>>     
>
> Nicer in what way?
>
> I think the original code was picked up from before the time it was merged in 
> Xen.
>   

It's in the right style, it avoids layering violations (there are no 
direct calls to the piix device within the code).  At some point in 
time, both KVM and Xen are going to live in the upstream QEMU tree so 
this code will have to be shared.  Since we're basing our code off what 
appears to be older Xen code, I think rebasing it to the latest bits 
makes sense.

Regards,

Anthony Liguori

> Amit
>   

  reply	other threads:[~2008-08-28 13:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1219764544-29764-1-git-send-email-amit.shah@qumranet.com>
     [not found] ` <1219764544-29764-2-git-send-email-amit.shah@qumranet.com>
2008-08-27 13:50   ` [Qemu-devel] Re: [PATCH 1/1] KVM/userspace: Support for assigning PCI devices to guests Anthony Liguori
2008-08-27 14:02     ` Anthony Liguori
2008-08-27 14:20       ` Ian Jackson
2008-08-28 11:50         ` Amit Shah
2008-08-28 11:48     ` Amit Shah
2008-08-28 13:11       ` Anthony Liguori [this message]
2008-08-28 13:25         ` Amit Shah
2008-08-28 16:37           ` Ian Jackson
2008-08-29 16:54             ` Amit Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B6A405.2060108@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=allen.m.kay@intel.com \
    --cc=amit.shah@qumranet.com \
    --cc=benami@il.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=muli@il.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weidong.han@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).