1. 23 1月, 2014 1 次提交
    • O
      util: Add "shareable" field for virSCSIDevice struct · 2b66504d
      Osier Yang 提交于
      Unlike the host devices of other types, SCSI host device XML supports
      "shareable" tag. This patch introduces it for the virSCSIDevice struct
      for a later patch use (to detect if the SCSI device is shareable when
      preparing the SCSI host device in QEMU driver).
      2b66504d
  2. 20 1月, 2014 1 次提交
  3. 12 12月, 2013 1 次提交
  4. 21 11月, 2013 1 次提交
    • E
      maint: fix comma style issues: qemu · 5d509e9e
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/qemu/qemu_cgroup.c: Consistently use commas.
      * src/qemu/qemu_command.c: Likewise.
      * src/qemu/qemu_conf.c: Likewise.
      * src/qemu/qemu_driver.c: Likewise.
      * src/qemu/qemu_monitor.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5d509e9e
  5. 01 10月, 2013 1 次提交
  6. 16 9月, 2013 1 次提交
  7. 03 9月, 2013 1 次提交
    • C
      qemu: Set QEMU_AUDIO_DRV=none with -nographic · a216e648
      Cole Robinson 提交于
      On my machine, a guest fails to boot if it has a sound card, but not
      graphical device/display is configured, because pulseaudio fails to
      initialize since it can't access $HOME.
      
      A workaround is removing the audio device, however on ARM boards there
      isn't any option to do that, so -nographic always fails.
      
      Set QEMU_AUDIO_DRV=none if no <graphics> are configured. Unfortunately
      this has massive test suite fallout.
      
      Add a qemu.conf parameter nographics_allow_host_audio, that if enabled
      will pass through QEMU_AUDIO_DRV from sysconfig (similar to
      vnc_allow_host_audio)
      a216e648
  8. 20 8月, 2013 1 次提交
    • M
      qemuSetupMemoryCgroup: Handle hard_limit properly · 94a24dd3
      Michal Privoznik 提交于
      Since 16bcb3 we have a regression. The hard_limit is set
      unconditionally. By default the limit is zero. Hence, if user hasn't
      configured any, we set the zero in cgroup subsystem making the kernel
      kill the corresponding qemu process immediately. The proper fix is to
      set hard_limit iff user has configured any.
      94a24dd3
  9. 19 8月, 2013 1 次提交
    • M
      qemu: Drop qemuDomainMemoryLimit · 16bcb3b6
      Michal Privoznik 提交于
      This function is to guess the correct limit for maximal memory
      usage by qemu for given domain. This can never be guessed
      correctly, not to mention all the pains and sleepless nights this
      code has caused. Once somebody discovers algorithm to solve the
      Halting Problem, we can compute the limit algorithmically. But
      till then, this code should never see the light of the release
      again.
      16bcb3b6
  10. 02 8月, 2013 1 次提交
  11. 01 8月, 2013 1 次提交
  12. 26 7月, 2013 2 次提交
  13. 25 7月, 2013 1 次提交
  14. 24 7月, 2013 2 次提交
    • D
      Create + setup cgroups atomically for QEMU process · 2049ef99
      Daniel P. Berrange 提交于
      Currently the QEMU driver creates the VM's cgroup prior to
      forking, and then uses a virCommand hook to move the child
      into the cgroup. This won't work with systemd whose APIs
      do the creation of cgroups + attachment of processes atomically.
      
      Fortunately we have a handshake taking place between the
      QEMU driver and the child process prior to QEMU being exec()d,
      which was introduced to allow setup of disk locking. By good
      fortune this synchronization point can be used to enable the
      QEMU driver to do atomic setup of cgroups removing the use
      of the hook script.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      2049ef99
    • D
      Auto-detect existing cgroup placement · 87b2e6fa
      Daniel P. Berrange 提交于
      Use the new virCgroupNewDetect function to determine cgroup
      placement of existing running VMs. This will allow the legacy
      cgroups creation APIs to be removed entirely
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      87b2e6fa
  15. 22 7月, 2013 2 次提交
  16. 18 7月, 2013 2 次提交
    • P
      qemu: Cleanup coding style nits in qemu_cgroup.c · bac21820
      Peter Krempa 提交于
      bac21820
    • O
      qemu: Set cpuset.cpus for domain process · a39f69d2
      Osier Yang 提交于
      When either "cpuset" of <vcpu> is specified, or the "placement" of
      <vcpu> is "auto", only setting the cpuset.mems might cause the guest
      starting to fail. E.g. ("placement" of both <vcpu> and <numatune> is
      "auto"):
      
      1) Related XMLs
        <vcpu placement='auto'>4</vcpu>
        <numatune>
          <memory mode='strict' placement='auto'/>
        </numatune>
      
      2) Host NUMA topology
        % numactl --hardware
        available: 8 nodes (0-7)
        node 0 cpus: 0 4 8 12 16 20 24 28
        node 0 size: 16374 MB
        node 0 free: 11899 MB
        node 1 cpus: 32 36 40 44 48 52 56 60
        node 1 size: 16384 MB
        node 1 free: 15318 MB
        node 2 cpus: 2 6 10 14 18 22 26 30
        node 2 size: 16384 MB
        node 2 free: 15766 MB
        node 3 cpus: 34 38 42 46 50 54 58 62
        node 3 size: 16384 MB
        node 3 free: 15347 MB
        node 4 cpus: 3 7 11 15 19 23 27 31
        node 4 size: 16384 MB
        node 4 free: 15041 MB
        node 5 cpus: 35 39 43 47 51 55 59 63
        node 5 size: 16384 MB
        node 5 free: 15202 MB
        node 6 cpus: 1 5 9 13 17 21 25 29
        node 6 size: 16384 MB
        node 6 free: 15197 MB
        node 7 cpus: 33 37 41 45 49 53 57 61
        node 7 size: 16368 MB
        node 7 free: 15669 MB
      
      4) cpuset.cpus will be set as: (from debug log)
      
      2013-05-09 16:50:17.296+0000: 417: debug : virCgroupSetValueStr:331 :
      Set value '/sys/fs/cgroup/cpuset/libvirt/qemu/toy/cpuset.cpus'
      to '0-63'
      
      5) The advisory nodeset got from querying numad (from debug log)
      
      2013-05-09 16:50:17.295+0000: 417: debug : qemuProcessStart:3614 :
      Nodeset returned from numad: 1
      
      6) cpuset.mems will be set as: (from debug log)
      
      2013-05-09 16:50:17.296+0000: 417: debug : virCgroupSetValueStr:331 :
      Set value '/sys/fs/cgroup/cpuset/libvirt/qemu/toy/cpuset.mems'
      to '0-7'
      
      I.E, the domain process's memory is restricted on the first NUMA node,
      however, it can use all of the CPUs, which will likely cause the domain
      process to fail to start because of the kernel fails to allocate
      memory with the the memory policy as "strict".
      
      % tail -n 20 /var/log/libvirt/qemu/toy.log
      ...
      2013-05-09 05:53:32.972+0000: 7318: debug : virCommandHandshakeChild:377 :
      Handshake with parent is done
      char device redirected to /dev/pts/2 (label charserial0)
      kvm_init_vcpu failed: Cannot allocate memory
      ...
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      a39f69d2
  17. 11 7月, 2013 1 次提交
  18. 10 7月, 2013 1 次提交
  19. 08 7月, 2013 1 次提交
  20. 26 6月, 2013 1 次提交
  21. 05 6月, 2013 1 次提交
  22. 23 5月, 2013 1 次提交
  23. 21 5月, 2013 2 次提交
  24. 20 5月, 2013 4 次提交
  25. 17 5月, 2013 1 次提交
  26. 13 5月, 2013 2 次提交
    • J
      Fix starting domains when kernel has no cgroups support · bbe97ae9
      Jim Fehlig 提交于
      Found that I was unable to start existing domains after updating
      to a kernel with no cgroups support
      
        # zgrep CGROUP /proc/config.gz
        # CONFIG_CGROUPS is not set
        # virsh start test
        error: Failed to start domain test
        error: Unable to initialize /machine cgroup: Cannot allocate memory
      
      virCgroupPartitionNeedsEscaping() correctly returns errno (ENOENT) when
      attempting to open /proc/cgroups on such a system, but it was being
      dropped in virCgroupSetPartitionSuffix().
      
      Change virCgroupSetPartitionSuffix() to propagate errors returned by
      its callees.  Also check for ENOENT in qemuInitCgroup() when determining
      if cgroups support is available.
      bbe97ae9
    • H
      qemu: Allow the scsi-generic device in cgroup · 6eb42e38
      Han Cheng 提交于
      This adds the scsi-generic device into the device controller's
      whitelist, so that it's allowed to used by the qemu process.
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      6eb42e38
  27. 04 5月, 2013 1 次提交
  28. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  29. 30 4月, 2013 2 次提交
    • L
      qemu: put usb cgroup setup in common function · 811143c0
      Laine Stump 提交于
      The USB-specific cgroup setup had been inserted inline in
      qemuDomainAttachHostUsbDevice and qemuSetupCgroup, but now there is a
      common cgroup setup function called for all hostdevs, so it makes sens
      to put the usb-specific setup there and just rely on that function
      being called.
      
      The one thing I'm uncertain of here (and a reason for not pushing
      until after release) is that previously hostdev->missing was checked
      only when starting a domain (and cgroup setup for the device skipped
      if missing was true), but with this consolidation, it is now checked
      in the case of hotplug as well. I don't know if this will have any
      practical effect (does it make sense to hotplug a "missing" usb
      device?)
      811143c0
    • L
      qemu: add vfio devices to cgroup ACL when appropriate · 6e13860c
      Laine Stump 提交于
      PCIO device assignment using VFIO requires read/write access by the
      qemu process to /dev/vfio/vfio, and /dev/vfio/nn, where "nn" is the
      VFIO group number that the assigned device belongs to (and can be
      found with the function virPCIDeviceGetVFIOGroupDev)
      
      /dev/vfio/vfio can be accessible to any guest without danger
      (according to vfio developers), so it is added to the static ACL.
      
      The group device must be dynamically added to the cgroup ACL for each
      vfio hostdev in two places:
      
      1) for any devices in the persistent config when the domain is started
         (done during qemuSetupCgroup())
      
      2) at device attach time for any hotplug devices (done in
         qemuDomainAttachHostDevice)
      
      The group device must be removed from the ACL when a device it
      "hot-unplugged" (in qemuDomainDetachHostDevice())
      
      Note that USB devices are already doing their own cgroup setup and
      teardown in the hostdev-usb specific function. I chose to make the new
      functions generic and call them in a common location though. We can
      then move the USB-specific code (which is duplicated in two locations)
      to this single location. I'll be posting a followup patch to do that.
      6e13860c
  30. 23 4月, 2013 1 次提交