1. 23 7月, 2013 2 次提交
    • J
      conf: Introduce new XML tag "mode" for disk source · c00b2f0d
      John Ferlan 提交于
      There are two ways to use a iSCSI LUN as disk source for qemu.
      
       * The LUN's path as it shows up on host, e.g.
         /dev/disk/by-path/ip-$ip:3260-iscsi-$iqn-fc18:iscsi.iscsi0-lun-1
      
       * The libiscsi URI from the storage pool source element host attribute, e.g.
         iscsi://demo.org:6000/iqn.1992-01.com.example/1
      
      For a "volume" type disk, if the specified "pool" is of iscsi
      type, we should support to use the LUN in either of above 2 ways.
      That's why to introduce a new XML tag "mode" for the disk source
      (libvirt should support iscsi pool with libiscsi, but it's another
      new feature, which should be done later).
      
      The "mode" can be either of "host" or "direct". Use "host" to indicate
      use of the LUN with the path as it shows up on host. Use "direct" to
      indicate to use it with the source pool host URI (future patches may support
      to use network type libvirt storage too, e.g. Ceph)
      c00b2f0d
    • J
      storage_iscsi: Reflect the default target port · 5c62d5ea
      John Ferlan 提交于
      Make sure default iSCSI target is 3260.
      5c62d5ea
  2. 22 7月, 2013 16 次提交
  3. 20 7月, 2013 2 次提交
  4. 19 7月, 2013 6 次提交
    • 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
    • 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
  5. 18 7月, 2013 14 次提交
    • 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
      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