1. 13 2月, 2013 4 次提交
    • M
      virCommand: Don't misuse the eventloop for async IO · 3178df9a
      Michal Privoznik 提交于
      Currently, if a command wants to do asynchronous IO, a callback
      is registered in the libvirtd eventloop to handle writes and
      reads. However, there's a race in virCommandWait. The eventloop
      may already be executing the callback, while virCommandWait is
      mangling internal state of virCommand. To deal with it, we need
      to either introduce locking or spawn a separate thread where we
      poll() on stdio from child. The former, however, requires to
      unlock all mutexes held, as the event loop may execute other
      callbacks which tries to lock one of the mutexes, deadlock and
      thus never wake us up. So it's safer to spawn a separate thread.
      3178df9a
    • E
      xen: clean up the mess with cpumap · 069b5c5a
      Eric Blake 提交于
      Commit 8b55992f added some Coverity comments to silence what was
      a real bug in the code.  Since then, we've had a miserable run
      of trying to fix the underlying problem (commits c059cdea and
      ba5193c8), and still have a problem on 32-bit machines.
      
      This fixes the problem for once and for all, by realizing that
      on older xen, cpumap_t is identical to uint64_t, and using the
      new virendian.h to do the transformation from the API (documented
      to be little-endian) to the host structure.
      
      * src/xen/xen_hypervisor.c (virXen_setvcpumap): Do the conversion
      correctly.  Finally.
      069b5c5a
    • E
      util: use new virendian.h macros · 731ad692
      Eric Blake 提交于
      This makes code easier to read, by avoiding lines longer than
      80 columns and removing the repetition from the callers.
      
      * src/util/virstoragefile.c (qedGetHeaderUL, qedGetHeaderULL):
      Delete in favor of more generic macros.
      (qcow2GetBackingStoreFormat, qcowXGetBackingStore)
      (qedGetBackingStore, virStorageFileMatchesVersion)
      (virStorageFileGetMetadataInternal): Use new macros.
      * src/cpu/cpu_x86.c (x86VendorLoad): Likewise.
      731ad692
    • E
      util: add virendian.h macros · c6f1060c
      Eric Blake 提交于
      We have several cases where we need to read endian-dependent
      data regardless of host endianness; rather than open-coding
      these call sites, it will be nicer to funnel things through
      a macro.
      
      The virendian.h file can be expanded to add writer functions,
      and/or 16-bit access patterns, if needed.  Also, if we need
      to turn things into a function to avoid multiple evaluations
      of buf, that can be done later.  But for now, a macro worked.
      
      * src/util/virendian.h: New file.
      * src/Makefile.am (UTIL_SOURCES): Ship it.
      * tests/virendiantest.c: New test.
      * tests/Makefile.am (test_programs, virendiantest_SOURCES): Run
      the test.
      * .gitignore: Ignore built file.
      c6f1060c
  2. 12 2月, 2013 10 次提交
    • 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
    • L
      build: fix make check of remote_protocol-structs · 6627ea3c
      Laine Stump 提交于
      Broken by incorrect formatting / spelling of remote_nonnull in commit
      39758e75
      6627ea3c
    • 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
      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
    • D
      Remove re-entrant API call in SELinux/AppArmor security managers · 0ab49601
      Daniel P. Berrange 提交于
      The security manager drivers are not allowed to call back
      out to top level security manager APIs, since that results
      in recursive mutex acquisition and thus deadlock. Remove
      calls to virSecurityManagerGetModel from SELinux / AppArmor
      drivers
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      0ab49601
  3. 11 2月, 2013 10 次提交
  4. 09 2月, 2013 3 次提交
  5. 08 2月, 2013 12 次提交
  6. 06 2月, 2013 1 次提交
    • E
      build: fix build of HAL node backend · 542fbfb0
      Eric Blake 提交于
      Commit 20253560 missed uses of PCI functions in the older HAL-related
      code, probably because hal-devel is no longer available in latest Fedora.
      
      * src/node_device/node_device_hal.c (gather_pci_cap): Reflect
      function rename.
      542fbfb0