1. 14 2月, 2013 8 次提交
    • L
      build: define SECDRIVER_LIBS in Makefile.am · 4a56e80f
      Laine Stump 提交于
      This makes it simpler to include the necessary system security driver
      libraries for a particular system. For this patch, several existing
      conditional sections from the Makfile were replaced; I'll later be
      adding SECDRIVER_LIBS to libvirt_util_la_LIBADD, because vircommand.c
      will be calling a function from $securitylib.
      4a56e80f
    • L
    • L
      qemu: replace exec hook with virCommandSetUID/GID in qemuCaps* · 6a8ecc37
      Laine Stump 提交于
      Setting the uid/gid of the child process was the only thing done by
      the hook function in this case, and that can now be done more simply
      with virCommandSetUID/GID.
      6a8ecc37
    • L
      util: make virSetUIDGID a NOP only when uid or gid is -1 · f506a4c1
      Laine Stump 提交于
      Rather than treating uid:gid of 0:0 as a NOP, we blindly pass that
      through to the lower layers. However, we *do* check for a requested
      value of "-1" to mean "don't change this setting". setregid() and
      setreuid() already interpret -1 as a NOP, so this is just an
      optimization, but we are also calling getpwuid_r and initgroups, and
      it's unclear what the former would do with a uid of -1.
      f506a4c1
    • L
      util: add virCommandSetUID and virCommandSetGID · 417182b0
      Laine Stump 提交于
      If a uid and/or gid is specified for a command, it will be set just
      after the user-supplied post-fork "hook" function is called.
      
      The intent is that this can replace user hook functions that set
      uid/gid. This moves the setting of uid/gid and dropping of
      capabilities closer to each other, which is important since the two
      should really be done at the same time (libcapng provides a single
      function that does both, which we will be unable to use, but want to
      mimic as closely as possible).
      417182b0
    • L
    • L
      util: eliminate extra args from virExec · 5f2ce539
      Laine Stump 提交于
      All args except "cmd" in the call to virExec are now redundant, since
      they can all be found in cmd, so remove the args and reference the
      data directly in cmd. One exception to this is that "infd" was being
      modified within virExec, and modifying the original in cmd caused make
      check failures, so cmd->infd is copied to a local, and the local is
      used during virExec().
      5f2ce539
    • L
      util: eliminate generic hook from virExecWithHook · b6decc57
      Laine Stump 提交于
      virExecWithHook is only called from one place, so it always has the
      same "hook" function (virHookCommand), and the data sent to that
      function is always a virCommandPtr, so eliminate the function and
      generic data from the arglist, and replace it with "virCommandPtr
      cmd". The call to (hook)(data) is replaced with
      "virHookCommand(cmd)". Finally, virExecWithHook is renamed to virExec.
      
      Indentation has been updated only for code that will remain after the
      next patch, which will remove all other args to virExec (since they
      are now redundant, as they're all members of virCommandPtr).
      b6decc57
  2. 13 2月, 2013 18 次提交
  3. 12 2月, 2013 14 次提交
    • D
      Release VM lock before acquiring virDomainObjListPtr lock · d1c7b00b
      Daniel P. Berrange 提交于
      When removing a VM from the virDomainObjListPtr, we must not
      be holding the VM lock while acquiring the list lock. Re-order
      code to ensure that we can release the VM lock early.
      d1c7b00b
    • D
      Fix potential deadlock across fork() in QEMU driver · 61b52d2e
      Daniel P. Berrange 提交于
      The hook scripts used by virCommand must be careful wrt
      accessing any mutexes that may have been held by other
      threads in the parent process. With the recent refactoring
      there are 2 potential flaws lurking, which will become real
      deadlock bugs once the global QEMU driver lock is removed.
      
      Remove use of the QEMU driver lock from the hook function
      by passing in the 'virQEMUDriverConfigPtr' instance directly.
      
      Add functions to the virSecurityManager to be invoked before
      and after fork, to ensure the mutex is held by the current
      thread. This allows it to be safely used in the hook script
      in the child process.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      61b52d2e
    • E
      build: fix compilation of selinux on RHEL 5 · 736a87b9
      Eric Blake 提交于
      On RHEL 5, I got:
      
      security/security_selinux.c: In function 'getContext':
      security/security_selinux.c:971: warning: unused parameter 'mgr' [-Wunused-parameter]
      
      * src/security/security_selinux.c (getContext): Mark potentially
      unused parameter.
      736a87b9
    • V
      S390: domain_conf support for CCW · 0bbbd42c
      Viktor Mihajlovski 提交于
      Add necessary handling code for the new s390 CCW address type to
      virDomainDeviceInfo. Further, introduce  memory management, XML
      parsing, output formatting and range validation for the new
      virDomainDeviceCCWAddress type.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      0bbbd42c
    • V
      S390: Documentation for CCW address type · 24aa7f8d
      Viktor Mihajlovski 提交于
      The native bus for s390 I/O is called CCW (channel command word).
      As QEMU has added basic support for the CCW bus, i.e. the
      ability to assign CCW devnos (bus addresses) to devices.
      Domains with the new machine type s390-ccw-virtio can use the
      CCW bus. Currently QEMU will only allow to define virtio
      devices on the CCW bus.
      Here we add the new machine type and the new device address to the
      schema definition and add a new paragraph to the domain XML
      documentation.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      24aa7f8d
    • E
      build: fix VPATH testsuite · ca7cc852
      Eric Blake 提交于
      'make check' has been failing on VPATH builds since commit
      907a39e7.  The tests already had magic for munging path names,
      but were munging to the wrong location, thus working only on
      an in-tree build.
      
      * tests/securityselinuxlabeltest.c (testSELinuxMungePath): Munge
      to correct path.
      ca7cc852
    • E
      docs: fix 1.0.2 release date · 19b21ac4
      Eric Blake 提交于
      * docs/news.html.in: Use correct release year.
      19b21ac4
    • L
      build: fix make check of remote_protocol-structs · 6627ea3c
      Laine Stump 提交于
      Broken by incorrect formatting / spelling of remote_nonnull in commit
      39758e75
      6627ea3c
    • G
      Check if classes are derived from object · 21858e21
      Guido Günther 提交于
      This makes sure we don't regress to old style classes
      21858e21
    • J
      hypervisor: Restore pm initialization · ba5193c8
      John Ferlan 提交于
      Adjustment for 'c059cdea' due to older compiler complaint about pm
      not being initialized even though the j&7 == 0 does the trick.
      ba5193c8
    • O
      virsh: Use virNodeDeviceLookupSCSIHostByWWN · 9be20184
      Osier Yang 提交于
      Only nodedev-destroy and nodedev-dumpxml can benifit from the
      new API, other commands like nodedev-detach only works for
      PCI devices, WWN makes no sense for them.
      9be20184
    • O
      nodedev: Implement virNodeDeviceLookupSCSIHostByWWN · fb2e4653
      Osier Yang 提交于
      This just simply changes nodeDeviceLookupByWWN to be not static,
      and its name into nodeDeviceLookupSCSIHostByWWN. And use that for
      udev and HAL backends.
      fb2e4653
    • O
      remote: Wire up the remote protocol · 39758e75
      Osier Yang 提交于
      Like virNodeDeviceCreateXML, virNodeDeviceLookupSCSIHostByWWN
      has to be treated specially when generating the RPC codes. Also
      new rules are added in fixup_name to keep the name SCSIHostByWWN.
      39758e75
    • O
      Introduce API virNodeDeviceLookupSCSIHostByWWN · efed366e
      Osier Yang 提交于
      Since the name (like scsi_host10) is not stable for vHBA, (it can
      be changed either after recreating or system rebooting), current
      API virNodeDeviceLookupByName is not nice to use for management app
      in this case. (E.g. one wants to destroy the vHBA whose name has
      been changed after system rebooting, he has to find out current
      name first).
      
      Later patches will support the persistent vHBA via storage pool,
      with which one can identify the vHBA stably by the wwnn && wwpn
      pair.
      
      So this new API comes.
      efed366e