1. 16 4月, 2013 4 次提交
    • D
      Change default cgroup layout for QEMU/LXC and honour XML config · db44eb1b
      Daniel P. Berrange 提交于
      Historically QEMU/LXC guests have been placed in a cgroup layout
      that is
      
         $LOCATION-OF-LIBVIRTD/libvirt/{qemu,lxc}/$VMNAME
      
      This is bad for a number of reasons
      
       - The cgroup hierarchy gets very deep which seriously
         impacts kernel performance due to cgroups scalability
         limitations.
      
       - It is hard to setup cgroup policies which apply across
         services and virtual machines, since all VMs are underneath
         the libvirtd service.
      
      To address this the default cgroup location is changed to
      be
      
          /system/$VMNAME.{lxc,qemu}.libvirt
      
      This puts virtual machines at the same level in the hierarchy
      as system services, allowing consistent policy to be setup
      across all of them.
      
      This also honours the new resource partition location from the
      XML configuration, for example
      
        <resource>
          <partition>/virtualmachines/production</partitions>
        </resource>
      
      will result in the VM being placed at
      
          /virtualmachines/production/$VMNAME.{lxc,qemu}.libvirt
      
      NB, with the exception of the default, /system, path which
      is intended to always exist, libvirt will not attempt to
      auto-create the partitions in the XML. It is the responsibility
      of the admin/app to configure the partitions. Later libvirt
      APIs will provide a way todo this.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      db44eb1b
    • D
      Add a new virCgroupNewPartition for setting up resource partitions · aa8604dd
      Daniel P. Berrange 提交于
      A resource partition is an absolute cgroup path, ignoring the
      current process placement. Expose a virCgroupNewPartition API
      for constructing such cgroups
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      aa8604dd
    • D
      Rename virCgroupForXXX to virCgroupNewXXX · 04c18d25
      Daniel P. Berrange 提交于
      Rename all the virCgroupForXXX methods to use the form
      virCgroupNewXXX since they are all constructors. Also
      make sure the output parameter is the last one in the
      list, and annotate all pointers as non-null. Fix up
      all callers, and make sure they use true/false not 0/1
      for the boolean parameters
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      04c18d25
    • D
      Store a virCgroupPtr instance in qemuDomainObjPrivatePtr · 632f78ca
      Daniel P. Berrange 提交于
      Instead of calling virCgroupForDomain every time we need
      the virCgrouPtr instance, just do it once at Vm startup
      and cache a reference to the object in qemuDomainObjPrivatePtr
      until shutdown of the VM. Removing the virCgroupPtr from
      the QEMU driver state also means we don't have stale mount
      info, if someone mounts the cgroups filesystem after libvirtd
      has been started
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      632f78ca
  2. 15 4月, 2013 2 次提交
    • P
      qemu: Report also domain name in error message when domain object wasn't found · 63b68f3c
      Peter Krempa 提交于
      Report the errors as:
      Domain not found: no domain with matching uuid '41414141-4141-4141-4141-414141414141' (crashtest)
      instead of:
      Domain not found: no domain with matching uuid '41414141-4141-4141-4141-414141414141'
      63b68f3c
    • P
      qemu: Refactor lookup of domain object · 54a99ba8
      Peter Krempa 提交于
      Use the helper to lookup the domain object in the remaining places.
      
      This patch also fixes error reporting when the domain was not found in several
      functions that were printing the raw UUID buffer instead of the formatted
      string. The offending functions were:
      
      qemuDomainGetInterfaceParameters
      qemuDomainSetInterfaceParameters
      qemuGetSchedulerParametersFlags
      qemuSetSchedulerParametersFlags
      qemuDomainGetNumaParameters
      qemuDomainSetNumaParameters
      qemuDomainGetMemoryParameters
      qemuDomainSetMemoryParameters
      qemuDomainGetBlkioParameters
      qemuDomainSetBlkioParameters
      qemuDomainGetCPUStats
      54a99ba8
  3. 13 4月, 2013 5 次提交
  4. 12 4月, 2013 2 次提交
    • L
      Add USB option capability · a6e37aed
      Li Zhang 提交于
      To avoid the collision for creating USB controllers in machine->init()
      and -device xx command line, it needs to set usb=off to avoid one USB
      controller created in machine->init(). So that libvirt can use -device
      or -usb to create USB controller sucessfully.
      So QEMU_CAPS_MACHINE_USB_OPT capability is added, and it is for QEMU
      v1.3.0 onwards which supports USB option.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      a6e37aed
    • J
      qemu: Do not report unsafe migration for local files · 88624b5d
      Jiri Denemark 提交于
      When migrating a domain with disk images stored locally (and using
      storage migration), we should not complain about unsafe migration no
      matter what cache policy is used for that disk.
      88624b5d
  5. 11 4月, 2013 6 次提交
  6. 09 4月, 2013 4 次提交
  7. 08 4月, 2013 7 次提交
  8. 06 4月, 2013 2 次提交
    • O
      qemu: Error out if the bitmap for pinning is all clear · fd1432c7
      Osier Yang 提交于
      For both "live" and "config" changes of vcpupin and emulatorpin, an
      all clear bitmap doesn't make sense, and it can just cause corruptions.
      E.g (similar for emulatorpin).
      
      % virsh vcpupin hame 0 8,^8 --config
      
      % virsh vcpupin hame
      VCPU: CPU Affinity
      ----------------------------------
         0:
         1: 0-63
         2: 0-63
         3: 0-63
      
      % virsh dumpxml hame | grep cpuset
          <vcpupin vcpu='0' cpuset=''/>
      
      % virsh start hame
      error: Failed to start domain hame
      error: An error occurred, but the cause is unknown
      fd1432c7
    • O
      qemu: Support multiple queue virtio-scsi · d4bf0a93
      Osier Yang 提交于
      This introduce a new attribute "num_queues" (same with the good name
      QEMU uses) for virtio-scsi controller. An example of the XML:
      
      <controller type='scsi' index='0' model='virtio-scsi' num_queues='8'/>
      
      The corresponding QEMU command line:
      
      -device virtio-scsi-pci,id=scsi0,num_queues=8,bus=pci.0,addr=0x3 \
      d4bf0a93
  9. 05 4月, 2013 8 次提交
    • P
      qemu: Remove maximum cpu limit when setting processor count using the API · ce65b435
      Peter Krempa 提交于
      When setting processor count for a domain using the API libvirt enforced
      a maximum processor count, while it isn't enforced when taking the XML path.
      
      This patch removes the check to match the XML.
      ce65b435
    • D
      Don't create dirs in cgroup controllers we don't want to use · 56f27b3b
      Daniel P. Berrange 提交于
      Currently when getting an instance of virCgroupPtr we will
      create the path in all cgroup controllers. Only at the virt
      driver layer are we attempting to filter controllers. This
      is bad because the mere act of creating the dirs in the
      controllers can have a functional impact on the kernel,
      particularly for performance.
      
      Update the virCgroupForDriver() method to accept a bitmask
      of controllers to use. Only create dirs in the controllers
      that are requested. When creating cgroups for domains,
      respect the active controller list from the parent cgroup
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      56f27b3b
    • P
      virCaps: get rid of defaultConsoleTargetType callback · 482e5f15
      Peter Krempa 提交于
      This patch refactors various places to allow removing of the
      defaultConsoleTargetType callback from the virCaps structure.
      
      A new console character device target type is introduced -
      VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE - to mark that no type was
      specified in the XML. This type is at the end converted to the standard
      VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL. Other types that are
      different from this default have to be processed separately in the
      device post parse callback.
      482e5f15
    • P
      virCaps: get rid of macPrefix field · 46becc18
      Peter Krempa 提交于
      Use the virDomainXMLConf structure to hold this data and tweak the code
      to avoid semantic change.
      
      Without configuration the KVM mac prefix is used by default. I chose it
      as it's in the privately administered segment so it should be usable for
      any purposes.
      46becc18
    • P
      virCaps: get rid of hasWideScsiBus · 8960d656
      Peter Krempa 提交于
      Use the virDomainXMLConf structure to hold this data.
      8960d656
    • P
      virCaps: get rid of defaultDiskDriverType · b2990849
      Peter Krempa 提交于
      Use the qemu specific callback to fill this data in the qemu driver as
      it's the only place where it was used and fix tests as the qemu test
      capability object didn't configure the defaults for the tests.
      b2990849
    • P
      virCaps: get rid of emulatorRequired · b5def001
      Peter Krempa 提交于
      This patch removes the emulatorRequired field and associated
      infrastructure from the virCaps object. Instead the driver specific
      callbacks are used as this field isn't enforced by all drivers.
      
      This patch implements the appropriate callbacks in the qemu and lxc
      driver and moves to check to that location.
      b5def001
    • P
      virCaps: get rid of defaultDiskDriverName · 9ea249e7
      Peter Krempa 提交于
      This patch removes the defaultDiskDriverName from the virCaps
      structure. This particular default value is used only in the qemu driver
      so this patch uses the recently added callback to fill the driver name
      if it's needed instead of propagating it through virCaps.
      9ea249e7