1. 09 2月, 2016 1 次提交
    • P
      qemu: vcpu: Aggregate code to set vCPU tuning · 56971667
      Peter Krempa 提交于
      Rather than iterating 3 times for various settings this function
      aggregates all the code into single place. One of the other advantages
      is that it can then be reused for properly setting vCPU info on hotplug.
      
      With this approach autoCpuset is also used when setting the process
      affinity rather than just via cgroups.
      56971667
  2. 08 2月, 2016 18 次提交
  3. 05 2月, 2016 3 次提交
    • M
      systemd: Modernize machine naming · c3bd0019
      Martin Kletzander 提交于
      So, systemd-machined has this philosophy that machine names are like
      hostnames and hence should follow the same rules.  But we always allowed
      international characters in domain names.  Thus we need to modify the
      machine name we are passing to systemd.
      
      In order to change some machine names that we will be passing to systemd,
      we also need to call TerminateMachine at the end of a lifetime of a
      domain.  Even for domains that were started with older libvirt.  That
      can be achieved thanks to virSystemdGetMachineNameByPID().  And because
      we can change machine names, we can get rid of the inconsistent and
      pointless escaping of domain names when creating machine names.
      
      So this patch modifies the naming in the following way.  It creates the
      name as <drivername>-<id>-<name> where invalid hostname characters are
      stripped out of the name and if the resulting name is longer, it
      truncates it to 64 characters.  That way we can start domains we
      couldn't start before.  Well, at least on systemd.
      
      To make it work all together, the machineName (which is needed only with
      systemd) is saved in domain's private data.  That way the generation is
      moved to the driver and we don't need to pass various unnecessary
      arguments to cgroup functions.
      
      The only thing this complicates a bit is the scope generation when
      validating a cgroup where we must check both old and new naming, so a
      slight modification was needed there.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1282846Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      c3bd0019
    • J
      conf: add caps to virDomainSnapshotDefFormat · b8b03f64
      Joao Martins 提交于
      The virDomainSnapshotDefFormat calls into virDomainDefFormat,
      so should be providing a non-NULL virCapsPtr instance. On the
      qemu driver we change qemuDomainSnapshotWriteMetadata to also
      include caps since it calls virDomainSnapshotDefFormat.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      b8b03f64
    • D
      conf: add caps to virDomainObjFormat/SaveStatus · 1036ddad
      Daniel P. Berrange 提交于
      The virDomainObjFormat and virDomainSaveStatus methods
      both call into virDomainDefFormat, so should be providing
      a non-NULL virCapsPtr instance.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1036ddad
  4. 04 2月, 2016 3 次提交
  5. 03 2月, 2016 6 次提交
  6. 01 2月, 2016 2 次提交
  7. 28 1月, 2016 2 次提交
  8. 27 1月, 2016 2 次提交
    • L
      util: keep/use a bitmap of in-use macvtap devices · 370608b4
      Laine Stump 提交于
      This patch creates two bitmaps, one for macvlan device names and one
      for macvtap. The bitmap position is used to indicate that libvirt is
      currently using a device with the name macvtap%d/macvlan%d, where %d
      is the position in the bitmap. When requested to create a new
      macvtap/macvlan device, libvirt will now look for the first clear bit
      in the appropriate bitmap and derive the device name from that rather
      than just starting at 0 and counting up until one works.
      
      When libvirtd is restarted, the qemu driver code that reattaches to
      active domains calls the appropriate function to "re-reserve" the
      device names as it is scanning the status of running domains.
      
      Note that it may seem strange that the retry counter now starts at
      8191 instead of 5. This is because we now don't do a "pre-check" for
      the existence of a device once we've reserved it in the bitmap - we
      move straight to creating it; although very unlikely, it's possible
      that someone has a running system where they have a large number of
      network devices *created outside libvirt* named "macvtap%d" or
      "macvlan%d" - such a setup would still allow creating more devices
      with the old code, while a low retry max in the new code would cause a
      failure. Since the objective of the retry max is just to prevent an
      infinite loop, and it's highly unlikely to do more than 1 iteration
      anyway, having a high max is a reasonable concession in order to
      prevent lots of new failures.
      370608b4
    • P
      device: cleanup input device code · 36785c7e
      Pavel Hrdina 提交于
      The current code was a little bit odd.  At first we've removed all
      possible implicit input devices from domain definition to add them later
      back if there was any graphics device defined while parsing XML
      description.  That's not all, while formating domain definition to XML
      description we at first ignore any input devices with bus different to
      USB and VIRTIO and few lines later we add implicit input devices to XML.
      
      This seems to me as a lot of code for nothing.  This patch may look
      to be more complicated than original approach, but this is a preferred
      way to modify/add driver specific stuff only in those drivers and not
      deal with them in common parsing/formating functions.
      
      The update is to add those implicit input devices into config XML to
      follow the real HW configuration visible by guest OS.
      
      There was also inconsistence between our behavior and QEMU's in the way,
      that in QEMU there is no way how to disable those implicit input devices
      for x86 architecture and they are available always, even without graphics
      device.  This applies also to XEN hypervisor.  VZ driver already does its
      part by putting correct implicit devices into live XML.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      36785c7e
  9. 26 1月, 2016 3 次提交
    • D
      qemu: add reporting of vCPU wait time · 511e7c5b
      Daniel P. Berrange 提交于
      The VIR_DOMAIN_STATS_VCPU flag to virDomainListGetStats
      enables reporting of stats about vCPUs. Currently we
      only report the cumulative CPU running time and the
      execution state.
      
      This adds reporting of the wait time - time the vCPU
      wants to run, but the host scheduler has something else
      running ahead of it.
      
      The data is reported per-vCPU eg
      
      $ virsh domstats --vcpu demo
       Domain: 'demo'
         vcpu.current=4
         vcpu.maximum=4
         vcpu.0.state=1
         vcpu.0.time=1420000000
         vcpu.0.wait=18403928
         vcpu.1.state=1
         vcpu.1.time=130000000
         vcpu.1.wait=10612111
         vcpu.2.state=1
         vcpu.2.time=110000000
         vcpu.2.wait=12759501
         vcpu.3.state=1
         vcpu.3.time=90000000
         vcpu.3.wait=21825087
      
      In implementing this I notice our reporting of CPU execute
      time has very poor granularity, since we are getting it
      from /proc/$PID/stat. As a future enhancement we should
      prefer to get CPU execute time from /proc/$PID/schedstat
      or /proc/$PID/sched (if either exist on the running kernel)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      511e7c5b
    • P
      (qemu|lxc)DomainGetCPUStats: Clean up · 51f07d8f
      Peter Krempa 提交于
      Remove unnecessary condition and variable.
      51f07d8f
    • P
      qemu: process: Disallow VMs with 0 vcpus · b3c91b8a
      Peter Krempa 提交于
      Counterintuitively the user would end up with a VM with maximum number
      of vCPUs available.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1290324
      b3c91b8a