1. 22 7月, 2013 9 次提交
  2. 20 7月, 2013 2 次提交
  3. 19 7月, 2013 12 次提交
    • J
      d327ac53
    • J
      util: Non-existent string array does not contain any string · 09e9f281
      Jiri Denemark 提交于
      Make virStringArrayHasString return false when called on a non-existent
      string array.
      09e9f281
    • E
      security: fix deadlock with prefork · bfc183c1
      Eric Blake 提交于
      Attempts to start a domain with both SELinux and DAC security
      modules loaded will deadlock; latent problem introduced in commit
      fdb3bde3 and exposed in commit 29fe5d74.  Basically, when recursing
      into the security manager for other driver's prefork, we have to
      undo the asymmetric lock taken at the manager level.
      
      Reported by Jiri Denemark, with diagnosis help from Dan Berrange.
      
      * src/security/security_stack.c (virSecurityStackPreFork): Undo
      extra lock grabbed during recursion.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bfc183c1
    • D
      Change s/i/iv/ in test code to avoid syntax-check · a81eb0b4
      Daniel P. Berrange 提交于
      The code parsing VIR_TEST_RANGE mistakenly used 'unsigned int i'
      which violated syntax-check rules
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a81eb0b4
    • D
      Allow test cases to be run selectively · ab92ae33
      Daniel P. Berrange 提交于
      When debugging a failing test with many test cases, it is useful
      to be able to skip most tests. Introducing a new environment
      variable VIR_TEST_RANGE=N-M enables execution of only the test
      cases numbered N-M inclusive, starting from 1.
      
      For example, to skip all the cgroup tests except 2
      
      $ VIR_TEST_RANGE=2-3 VIR_TEST_DEBUG=1 ./vircgrouptest
      TEST: vircgrouptest
       2) New cgroup for driver                                             ... Unexpected found LXC cgroup: 1
      libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory
      FAILED
       3) New cgroup for domain driver                                      ... Cannot find LXC cgroup: 1
      libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory
      FAILED
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ab92ae33
    • E
      maint: update to latest gnulib · ac0852c7
      Eric Blake 提交于
      Upstream gnulib recently patched a bug in bootstrap, for projects
      that use a different name than build-aux for a subdirectory.  We
      don't, but it doesn't hurt to update.
      
      * .gnulib: Update, for bootstrap fix.
      * bootstrap: Sync to upstream.
      * bootstrap.conf: Match upstream bug fix.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ac0852c7
    • M
      autogen: Handle case when libvirt's submodule · 5cfe0d37
      Michal Privoznik 提交于
      Currently, in the autogen.sh script we check whether .git is an existing
      directory in which case bootstrap is run. However, if libvirt is a
      submodule, then the .git is just a file (with reference to the topmost
      .git directory). However, our submodule routines work well. So there's
      no real reason why we should prohibit users to build libvirt from
      submodule.
      5cfe0d37
    • E
      maint: split long lines in Makefiles · d21d40bf
      Eric Blake 提交于
      Makefiles are another easy file to enforce line limits.
      
      Mostly straightforward; interesting tricks worth noting:
      src/Makefile.am: $(confdir) was already defined, use it in more places
      tests/Makefile.am: path_add and VG required some interesting compression
      
      * cfg.mk (sc_prohibit_long_lines): Add another test.
      * Makefile.am: Fix offenders.
      * daemon/Makefile.am: Likewise.
      * docs/Makefile.am: Likewise.
      * python/Makefile.am: Likewise.
      * src/Makefile.am: Likewise.
      * tests/Makefile.am: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d21d40bf
    • E
      security_dac: compute supplemental groups before fork · 29fe5d74
      Eric Blake 提交于
      Commit 75c12564 states that virGetGroupList must not be called
      between fork and exec, then commit ee777e99 promptly violated
      that for lxc's use of virSecurityManagerSetProcessLabel.  Hoist
      the supplemental group detection to the time that the security
      manager needs to fork.  Qemu is safe, as it uses
      virSecurityManagerSetChildProcessLabel which in turn uses
      virCommand to determine supplemental groups.
      
      This does not fix the fact that virSecurityManagerSetProcessLabel
      calls virSecurityDACParseIds calls parseIds which eventually
      calls getpwnam_r, which also violates fork/exec async-signal-safe
      safety rules, but so far no one has complained of hitting
      deadlock in that case.
      
      * src/security/security_dac.c (_virSecurityDACData): Track groups
      in private data.
      (virSecurityDACPreFork): New function, to set them.
      (virSecurityDACClose): Clean up new fields.
      (virSecurityDACGetIds): Alter signature.
      (virSecurityDACSetSecurityHostdevLabelHelper)
      (virSecurityDACSetChardevLabel, virSecurityDACSetProcessLabel)
      (virSecurityDACSetChildProcessLabel): Update callers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      29fe5d74
    • E
      security: framework for driver PreFork handler · fdb3bde3
      Eric Blake 提交于
      A future patch wants the DAC security manager to be able to safely
      get the supplemental group list for a given uid, but at the time
      of a fork rather than during initialization so as to pick up on
      live changes to the system's group database.  This patch adds the
      framework, including the possibility of a pre-fork callback
      failing.
      
      For now, any driver that implements a prefork callback must be
      robust against the possibility of being part of a security stack
      where a later element in the chain fails prefork.  This means
      that drivers cannot do any action that requires a call to postfork
      for proper cleanup (no grabbing a mutex, for example).  If this
      is too prohibitive in the future, we would have to switch to a
      transactioning sequence, where each driver has (up to) 3 callbacks:
      PreForkPrepare, PreForkCommit, and PreForkAbort, to either clean
      up or commit changes made during prepare.
      
      * src/security/security_driver.h (virSecurityDriverPreFork): New
      callback.
      * src/security/security_manager.h (virSecurityManagerPreFork):
      Change signature.
      * src/security/security_manager.c (virSecurityManagerPreFork):
      Optionally call into driver, and allow returning failure.
      * src/security/security_stack.c (virSecurityDriverStack):
      Wrap the handler for the stack driver.
      * src/qemu/qemu_process.c (qemuProcessStart): Adjust caller.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fdb3bde3
    • G
      Use AC_LINK_IFELSE · c5d79fb0
      Guido Günther 提交于
      instead of the deprecated AC_TRY_LINK
      c5d79fb0
    • E
      tests: split long lines · 684c90bf
      Eric Blake 提交于
      Long lines are harder to read and harder to diff; in fact, if lines get
      too long (> 1000 bytes), it starts causing issues where git send-email
      refuses to send patches for the file.  I've cleaned up the tests
      directory in the past (see commits bd6c46fa, 3b750d13), but new long
      lines have been introduced in the meantime.
      
      Why 90 instead of 80? Because there were too many tests on the fringe
      edge, and I didn't want to edit that many files.
      
      Add a syntax check to prevent future long lines.
      
      * cfg.mk (sc_prohibit_long_lines): New rule.
      * tests/qemuxml2argvdata/qemuxml2argv-*.args: Split lines of any
      file with content longer than 90 columns.
      * tests/storagevolxml2argvdata/*.argv: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      684c90bf
  4. 18 7月, 2013 17 次提交
    • G
      Check for link_addr more thoroughly · 77bac48b
      Guido Günther 提交于
      Some versions of kFreeBSD (like 9.0) declare link_addr in a header
      but lack an implementation. This makes ./configure pass but breaks
      compilation later with a
      
           undefined reference to `link_addr'
      
      Althought that's a bug in the OS header we can detect it easily by also
      trying to link.
      
      http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715320
      77bac48b
    • J
      984c01ba
    • J
      3fbf78bd
    • J
      qemu: Add support for DEVICE_DELETED event · ab47cc9b
      Jiri Denemark 提交于
      ab47cc9b
    • J
      ae951e72
    • J
      Clarify virDomainDetachDeviceFlags documentation · 1f71de59
      Jiri Denemark 提交于
      1f71de59
    • J
      ee023f6c
    • J
      Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event · 4421e257
      Jiri Denemark 提交于
      4421e257
    • J
      d077cda4
    • 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
    • P
      caps: Add helpers to convert NUMA nodes to corresponding CPUs · b8b38321
      Peter Krempa 提交于
      These helpers use the remembered host capabilities to retrieve the cpu
      map rather than query the host again. The intended usage for this
      helpers is to fix automatic NUMA placement with strict memory alloc. The
      code doing the prepare needs to pin the emulator process only to cpus
      belonging to a subset of NUMA nodes of the host.
      b8b38321
    • M
      Add virtio-scsi to fallback models of scsi controller · b7f1c0c3
      Martin Kletzander 提交于
      When user does not specify any model for scsi controller, or worse, no
      controller at all, but libvirt automatically adds scsi controller with
      no model, we are not searching for virtio-scsi and thus this can fail
      for example on qemu which doesn't support lsi logic adapter.
      
      This means that when qemu on x86 doesn't support lsi53c895a and the
      user adds the following to an XML without any scsi controller:
      
      <disk ...>
        ...
        <target dev='sda'>
      </disk>
      
      libvirt fails like this:
       # virsh define asdf.xml
       error: Failed to define domain from asdf.xml
       error: internal error Unable to determine model for scsi controller
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=974943
      b7f1c0c3
    • M
      Introduce lxcDomObjFromDomain · dbeb04a6
      Michal Privoznik 提交于
      Similarly to qemu driver, we can use a helper function to
      lookup a domain instead of copying multiple lines around.
      dbeb04a6
    • M
      Remove lxcDriverLock from almost everywhere · eb150c86
      Michal Privoznik 提交于
      With the majority of fields in the virLXCDriverPtr struct
      now immutable or self-locking, there is no need for practically
      any methods to be using the LXC driver lock. Only a handful
      of helper APIs now need it.
      eb150c86
    • M
      lxc: Make activeUsbHostdevs use locks · 2a82171a
      Michal Privoznik 提交于
      The activeUsbHostdevs item in LXCDriver are lockable, but the lock has
      to be called explicitly. Call the virObject(Un)Lock() in order to
      achieve mutual exclusion once lxcDriverLock is removed.
      2a82171a
    • M
      Stop accessing driver->caps directly in LXC driver · 64ec738e
      Michal Privoznik 提交于
      The 'driver->caps' pointer can be changed on the fly. Accessing
      it currently requires the global driver lock. Isolate this
      access in a single helper, so a future patch can relax the
      locking constraints.
      64ec738e