1. 26 11月, 2012 1 次提交
  2. 02 11月, 2012 1 次提交
  3. 21 9月, 2012 1 次提交
  4. 31 8月, 2012 1 次提交
  5. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  6. 18 7月, 2012 1 次提交
  7. 30 3月, 2012 1 次提交
  8. 09 3月, 2012 2 次提交
    • L
      util: consolidate duplicated error messages in pci.c · b8e47850
      Laine Stump 提交于
      This is nearly identical to an earlier patch for virnetlink.c.
      
      There are special stub versions of all public functions in this file
      that are compiled when the platform isn't linux. Each of these
      functions had an almost identical message, differing only in the
      function name included in the message. Since log messages already
      contain the function name, we can just define a const char* with the
      common part of the string, and use that same string for all the log
      messages.
      
      If nothing else, this at least makes for less strings that need
      translating...
      b8e47850
    • L
      util: add stub pciConfigAddressToSysfsFile for non-linux platforms · 09d22af1
      Laine Stump 提交于
      Absence of this stub function caused a build failure on mingw32.
      09d22af1
  9. 08 3月, 2012 1 次提交
  10. 06 3月, 2012 1 次提交
    • R
      util: two new pci util functions · b8b70273
      Roopa Prabhu 提交于
      pciDeviceGetVirtualFunctionInfo returns pf netdevice name and virtual
      function index for a given vf. This is just a wrapper around existing functions
      to return vf's pf and vf_index with one api call
      
      pciConfigAddressToSysfsfile returns the sysfile pci device link
      from a 'struct pci_config_address'
      Signed-off-by: NRoopa Prabhu <roprabhu@cisco.com>
      b8b70273
  11. 22 2月, 2012 1 次提交
    • M
      configure: Define program name if not found · 2b38e59b
      Michal Privoznik 提交于
      AC_CHECK_PROG checks for program in given path. However, if it doesn't
      exists, [variable] is set to [value-if-not-found]. We don't want this
      to be the empty string in case of 'modprobe' and 'scrub' as we want to
      fallback to runtime detection.
      2b38e59b
  12. 18 1月, 2012 1 次提交
    • O
      qemu: Introduce inactive PCI device list · 6be610bf
      Osier Yang 提交于
      pciTrySecondaryBusReset checks if there is active device on the
      same bus, however, qemu driver doesn't maintain an effective
      list for the inactive devices, and it passes meaningless argument
      for parameter "inactiveDevs". e.g. (qemuPrepareHostdevPCIDevices)
      
      if (!(pcidevs = qemuGetPciHostDeviceList(hostdevs, nhostdevs)))
          return -1;
      
      ..skipped...
      
      if (pciResetDevice(dev, driver->activePciHostdevs, pcidevs) < 0)
          goto reattachdevs;
      
      NB, the "pcidevs" used above are extracted from domain def, and
      thus one won't be able to attach a device of which bus has other
      device even detached from host (nodedev-detach). To see more
      details of the problem:
      
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=773667
      
      This patch is to resolve the problem by introducing an inactive
      PCI device list (just like qemu_driver->activePciHostdevs), and
      the whole logic is:
      
        * Add the device to inactive list during nodedev-dettach
        * Remove the device from inactive list during nodedev-reattach
        * Remove the device from inactive list during attach-device
          (for non-managed device)
        * Add the device to inactive list after detach-device, only
          if the device is not managed
      
      With the above, we have a sufficient inactive PCI device list, and thus
      we can use it for pciResetDevice. e.g.(qemuPrepareHostdevPCIDevices)
      
      if (pciResetDevice(dev, driver->activePciHostdevs,
                         driver->inactivePciHostdevs) < 0)
          goto reattachdevs;
      6be610bf
  13. 12 1月, 2012 2 次提交
  14. 30 10月, 2011 1 次提交
    • O
      qemu: Restore the original states of PCI device when restarting daemon · d84b3626
      Osier Yang 提交于
      To support "managed" mode of host PCI device, we record the original
      states (unbind_from_stub, remove_slot, and reprobe) so that could
      reattach the device to host with original driver. But there is no XML
      for theses attrs, and thus after daemon is restarted, we lose the
      original states. It's easy to reproduce:
      
          1) virsh start domain
          2) virsh attach-device dom hostpci.xml (in 'managed' mode)
          3) service libvirtd restart
          4) virsh destroy domain
      
          You will see the device won't be bound to the original driver
      if there was one.
      
      This patch is to solve the problem by introducing internal XML
      (won't be dumped to user, only dumped to status XML). The XML is:
          <origstates>
            <unbind/>
            <remove_slot/>
            <reprobe/>
          </origstates>
      
      Which will be child node of <hostdev><source>...</souce></hostdev>.
      (only for PCI device).
      
      A new struct "virDomainHostdevOrigStates" is introduced for the XML,
      and the according members are updated when preparing the PCI device.
      And function "qemuUpdateActivePciHostdevs" is modified to honor
      the original states. Use of qemuGetPciHostDeviceList is removed
      in function "qemuUpdateActivePciHostdevs", and the "managed" value of
      the device config is honored by the change. This fixes another problem
      alongside:
      
          qemuGetPciHostDeviceList set the device as "managed" force
          regardless of whether the device is configured as "managed='yes'"
          or not in XML, which is not right.
      d84b3626
  15. 29 10月, 2011 1 次提交
  16. 15 10月, 2011 2 次提交
    • R
      Add missing strdup return value check · 7c23c34d
      Roopa Prabhu 提交于
      Check strdup return value and fail if error
      Signed-off-by: NRoopa Prabhu <roprabhu@cisco.com>
      7c23c34d
    • O
      qemu: Do not reattach PCI device used by other domain when shutdown · 24b8be89
      Osier Yang 提交于
      When failing on starting a domain, it tries to reattach all the PCI
      devices defined in the domain conf, regardless of whether the devices
      are still used by other domain. This will cause the devices to be deleted
      from the list qemu_driver->activePciHostdevs, thus the devices will be
      thought as usable even if it's not true. And following commands
      nodedev-{reattach,reset} will be successful.
      
      How to reproduce:
        1) Define two domains with same PCI device defined in the confs.
        2) # virsh start domain1
        3) # virsh start domain2
        4) # virsh nodedev-reattach $pci_device
      
      You will see the device will be reattached to host successfully.
      As pciDeviceReattach just check if the device is still used by
      other domain via checking if the device is in list driver->activePciHostdevs,
      however, the device is deleted from the list by step 2).
      
      This patch is to prohibit the bug by:
        1) Prohibit a domain starting or device attachment right at
           preparation period (qemuPrepareHostdevPCIDevices) if the
           device is in list driver->activePciHostdevs, which means
           it's used by other domain.
      
        2) Introduces a new field for struct _pciDevice, (const char *used_by),
           it will be set as the domain name at preparation period,
           (qemuPrepareHostdevPCIDevices). Thus we can prohibit deleting
           the device from driver->activePciHostdevs if it's still used by
           other domain when stopping the domain process.
      
      * src/pci.h (define two internal functions, pciDeviceSetUsedBy and
          pciDevceGetUsedBy)
      * src/pci.c (new field "const char *used_by" for struct _pciDevice,
          implementations for the two new functions)
      * src/libvirt_private.syms (Add the two new internal functions)
      * src/qemu_hostdev.h (Modify the definition of functions
          qemuPrepareHostdevPCIDevices, and qemuDomainReAttachHostdevDevices)
      * src/qemu_hostdev.c (Prohibit preparation and don't delete the
          device from activePciHostdevs list if it's still used by other domain)
      * src/qemu_hotplug.c (Update function usage, as the definitions are
          changed)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      24b8be89
  17. 20 9月, 2011 1 次提交
  18. 17 8月, 2011 1 次提交
  19. 16 8月, 2011 2 次提交
  20. 22 7月, 2011 1 次提交
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089
  21. 06 7月, 2011 1 次提交
    • G
      pci: initialize state values on reattach · 416814e6
      Guannan Ren 提交于
      add a new API pciDeviceReAttachInit() in pci.c to initialize state values for nodedev reattach
      
      Initialize three state value of device driver to 1. This is just for a new call to
      qemudNodeDeviceReAttach()
      416814e6
  22. 02 7月, 2011 1 次提交
    • E
      pci: avoid memory leak on error · 95eaf7ba
      Eric Blake 提交于
      Detected by Coverity.  Some, but not all, error paths were clean;
      but they were repetitive so I refactored them.
      
      * src/util/pci.c (pciGetDevice): Plug leak.
      95eaf7ba
  23. 23 6月, 2011 1 次提交
    • E
      util: avoid PATH_MAX-sized array · 60bfd5b5
      Eric Blake 提交于
      See previous patch for why this is good...
      
      * src/util/pci.c (struct _pciDevice, pciGetDevice, pciFreeDevice):
      Manage path dynamically.  Report snprintf overflow.
      * src/util/hostusb.c (struct _usbDevice, usbGetDevice)
      (usbFreeDevice): Likewise.
      60bfd5b5
  24. 08 6月, 2011 1 次提交
  25. 01 6月, 2011 1 次提交
    • O
      util: Fix incorrect error in PCI functions · a74575e3
      Osier Yang 提交于
      Substitute VIR_ERR_NO_SUPPORT with VIR_ERR_INTERNAL_ERROR. Error
      like following is not what user want to see.
      
      error : pciDeviceIsAssignable:1487 : this function is not supported
      by the connection driver: Device 0000:07:10.0 is behind a switch
      lacking ACS and cannot be assigned
      a74575e3
  26. 12 5月, 2011 1 次提交
    • L
      libvirt,logging: cleanup VIR_XXX0() · b65f37a4
      Lai Jiangshan 提交于
      These VIR_XXXX0 APIs make us confused, use the non-0-suffix APIs instead.
      
      How do these coversions works? The magic is using the gcc extension of ##.
      When __VA_ARGS__ is empty, "##" will swallow the "," in "fmt," to
      avoid compile error.
      
      example: origin				after CPP
      	high_level_api("%d", a_int)	low_level_api("%d", a_int)
      	high_level_api("a  string")	low_level_api("a  string")
      
      About 400 conversions.
      
      8 special conversions:
      VIR_XXXX0("") -> VIR_XXXX("msg") (avoid empty format) 2 conversions
      VIR_XXXX0(string_literal_with_%) -> VIR_XXXX(%->%%) 0 conversions
      VIR_XXXX0(non_string_literal) -> VIR_XXXX("%s", non_string_literal)
        (for security) 6 conversions
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      b65f37a4
  27. 04 5月, 2011 1 次提交
    • E
      pci: fix null pointer dereference · 1164e1a2
      Eric Blake 提交于
      Clang detected a null-pointer dereference regression, introduced
      in commit 4e8969eb.  Without this patch, a device with
      unbind_from_stub set to false would eventually try to call
      virFileExists on uncomputed drvdir.
      
      * src/util/pci.c (pciUnbindDeviceFromStub): Ensure drvdir is set
      before use.
      1164e1a2
  28. 17 4月, 2011 1 次提交
  29. 12 4月, 2011 1 次提交
    • E
      maint: fix grammar errors · 99fa3080
      Eric Blake 提交于
      Jim Meyering recently improved gnulib to catch various grammar
      errors during 'make syntax-check'.
      
      * .gnulib: Update to latest, for syntax-check improvements.
      * include/libvirt/libvirt.h.in (virConnectAuthCallbackPtr): Use
      cannot rather than two words.
      * src/driver.c: Likewise.
      * src/driver.h (VIR_SECRET_GET_VALUE_INTERNAL_CALL): Likewise.
      * src/remote/remote_driver.c (initialize_gnutls): Likewise.
      * src/util/pci.c (pciBindDeviceToStub): Likewise.
      * src/storage/storage_backend.c (virStorageBackendCreateQemuImg):
      Likewise.
      (virStorageBackendUpdateVolTargetInfoFD): Avoid doubled word.
      * docs/formatdomain.html.in: Likewise.
      * src/qemu/qemu_process.c (qemuProcessStart): Likewise.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_can_not)
      (exclude_file_name_regexp--sc_prohibit_doubled_word): Exclude
      existing translation problems.
      99fa3080
  30. 07 4月, 2011 3 次提交
  31. 05 4月, 2011 1 次提交
  32. 18 3月, 2011 1 次提交
  33. 03 12月, 2010 1 次提交
    • J
      Create file in virFileWriteStr() if it doesn't exist · 966a1bfe
      Jean-Baptiste Rouault 提交于
      This patch adds a mode_t parameter to virFileWriteStr().
      If mode is different from 0, virFileWriteStr() will try
      to create the file if it doesn't exist.
      
      * src/util/util.h (virFileWriteStr): Alter signature.
      * src/util/util.c (virFileWriteStr): Allow file creation.
      * src/network/bridge_driver.c (networkEnableIpForwarding)
      (networkDisableIPV6): Adjust clients.
      * src/node_device/node_device_driver.c
      (nodeDeviceVportCreateDelete): Likewise.
      * src/util/cgroup.c (virCgroupSetValueStr): Likewise.
      * src/util/pci.c (pciBindDeviceToStub, pciUnBindDeviceFromStub):
      Likewise.
      966a1bfe
  34. 25 11月, 2010 1 次提交
    • E
      build: enforce files.h usage · f1fe9671
      Eric Blake 提交于
      * cfg.mk (sc_prohibit_close): New syntax-check rule.
      * src/util/pci.c (pciWaitForDeviceCleanup): Fix violation.
      * .x-sc_prohibit_close: New exceptions.
      * Makefile.am (EXTRA_DIST): Distribute new file.
      f1fe9671