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

Re: [libvirt] [PATCH 7/7] kvmtool: Implementation for kvm tool driver

On 2011年12月06日 22:55, Daniel P. Berrange wrote:
On Fri, Nov 11, 2011 at 07:57:06PM +0800, Osier Yang wrote:
Basically, the drivers is implemented by using kvm tool binary
currently, (see ./kvm help for more info).

Current implementation supports define/undefine, start/destroy/,
suspend/resume, connect to guest console via "virsh console",
and balloon memory with with "virsh setmem" (using ./kvm balloon
command). Also as it supports cgroup controllers "cpuacct", and
"memory", so some other commands like "schedinfo", "memtune" can
also work. Some other commands such as "domid", "domname", "dumpxml"
,"autostart", etc. are supported, as the driver is designed
as a "stateful" driver, those APIs just need to talk with libvirtd

As Native Linux KVM Tool is designed for both non-root and root users,
the driver is designed just like QEMU, supports two modes of the



An example of the domain XML (all the XMLs supported currently are

% virsh -c kvm:///system dumpxml kvm_test
<domain type='kvmtool'>
     <type arch='x86_64'>hvm</type>
     <boot dev='hd'/>
   <clock offset='utc'/>
     <disk type='file' device='disk'>
       <source file='/var/lib/libvirt/images/linux-0.2.img'/>
       <target dev='vda' bus='virtio'/>
     <filesystem type='mount' accessmode='passthrough'>
       <source dir='/tmp'/>
       <target dir='/mnt'/>
     <console type='pty'>
       <target type='serial' port='0'/>
     <memballoon model='virtio'/>
  cfg.mk                       |    1 +
  daemon/Makefile.am           |    4 +
  daemon/libvirtd.c            |    7 +
  po/POTFILES.in               |    2 +
  src/Makefile.am              |   36 +-
  src/kvmtool/kvmtool_conf.c   |  130 ++
  src/kvmtool/kvmtool_conf.h   |   66 +
  src/kvmtool/kvmtool_driver.c | 3079 ++++++++++++++++++++++++++++++++++++++++++
  src/kvmtool/kvmtool_driver.h |   29 +

My main suggestion here would be to split up the kvmtool_driver.c
file into 3 parts as we did with the QEMU driver.

   kvmtool_driver.c   ->  Basic libvirt API glue
   kvmtool_command.c  ->  ARGV generation
   kvmtool_process.c  ->  KVMtool process start/stop/autostart/autodestroy

Agreed. As a early thinking, kvmtool might has APIs exposed in future,
how should we plan for it? A new driver just like libxl for XEN? or new
backend driver like what we do for xm, xend for XEN driver? Should we
consider the expansibility currently if we tend to use backend


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