1. 02 11月, 2012 1 次提交
  2. 28 9月, 2012 2 次提交
  3. 21 9月, 2012 1 次提交
  4. 17 9月, 2012 1 次提交
    • O
      list: Implement listAllNodeDevices · c68cd62a
      Osier Yang 提交于
      This simply implements listAllNodeDevices using helper virNodeDeviceList
      
      src/node_device/node_device_driver.h:
        * Declare nodeListAllNodeDevices.
      
      src/node_device/node_device_driver.c:
        * Implement nodeListAllNodeDevices.
      
      src/node_device/node_device_hal.c:
        * Hook listAllNodeDevices to nodeListAllNodeDevices.
      
      src/node_device/node_device_udev.c
        * Hook listAllNodeDevices to nodeListAllNodeDevices.
      c68cd62a
  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. 19 7月, 2012 2 次提交
  7. 28 6月, 2012 1 次提交
  8. 05 5月, 2012 1 次提交
    • S
      node_device: fix possible non-terminated string · 43d1616f
      Stefan Berger 提交于
      Error: STRING_NULL:
      /libvirt/src/node_device/node_device_linux_sysfs.c:80:
      string_null_argument: Function "saferead" does not terminate string "*buf".
      /libvirt/src/util/util.c:101:
      string_null_argument: Function "read" fills array "*buf" with a non-terminated string.
      /libvirt/src/node_device/node_device_linux_sysfs.c:87:
      string_null: Passing unterminated string "buf" to a function expecting a null-terminated string.
      43d1616f
  9. 20 4月, 2012 1 次提交
    • D
      The policy kit and HAL node device drivers both require a · 2223ea98
      Daniel P. Berrange 提交于
      DBus connection. The HAL device code further requires that
      the DBus connection is integrated with the event loop and
      provides such glue logic itself.
      
      The forthcoming FirewallD integration also requires a
      dbus connection with event loop integration. Thus we need
      to pull the current event loop glue out of the HAL driver.
      
      Thus we create src/util/virdbus.{c,h} files. This contains
      just one method virDBusGetSystemBus() which obtains a handle
      to the single shared system bus instance, with event glue
      automagically setup.
      2223ea98
  10. 10 4月, 2012 1 次提交
    • E
      build: avoid s390 compiler warnings · 9011a494
      Eric Blake 提交于
      I noticed these compiler warnings when building for the s390 architecture.
      
      * src/node_device/node_device_udev.c (udevDeviceMonitorStartup):
      Mark unused variable.
      * src/nodeinfo.c (linuxNodeInfoCPUPopulate): Avoid unused variable.
      9011a494
  11. 30 3月, 2012 1 次提交
  12. 10 2月, 2012 1 次提交
    • O
      npiv: Auto-generate WWN if it's not specified · 7c90026d
      Osier Yang 提交于
      The auto-generated WWN comply with the new addressing schema of WWN:
      
      <quote>
      the first nibble is either hex 5 or 6 followed by a 3-byte vendor
      identifier and 36 bits for a vendor-specified serial number.
      </quote>
      
      We choose hex 5 for the first nibble. And for the 3-bytes vendor ID,
      we uses the OUI according to underlying hypervisor type, (invoking
      virConnectGetType to get the virt type). e.g. If virConnectGetType
      returns "QEMU", we use Qumranet's OUI (00:1A:4A), if returns
      ESX|VMWARE, we use VMWARE's OUI (00:05:69). Currently it only
      supports qemu|xen|libxl|xenapi|hyperv|esx|vmware drivers. The last
      36 bits are auto-generated.
      7c90026d
  13. 07 12月, 2011 1 次提交
    • O
      npiv: Expose fabric_name outside · cc17f092
      Osier Yang 提交于
      This patch is to expose the fabric_name of fc_host class, which
      might be useful for users who wants to known which fabric the
      (v)HBA connects to.
      
      The patch also adds the missed capabilities' XML schema of scsi_host,
      (of course, with fabric_wwn added), and update the documents
      (docs/formatnode.html.in)
      cc17f092
  14. 12 11月, 2011 1 次提交
    • E
      build: drop useless dirent.h includes · e55ec69d
      Eric Blake 提交于
      * .gnulib: Update to latest, for improved syntax-check.
      * src/lxc/lxc_container.c (includes): Drop unused include.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_linux_sysfs.c: Likewise.
      * src/openvz/openvz_driver.c: Likewise.
      * src/qemu/qemu_conf.c: Likewise.
      * src/storage/storage_backend_iscsi.c: Likewise.
      * src/storage/storage_backend_mpath.c: Likewise.
      * src/uml/uml_conf.c: Likewise.
      * src/uml/uml_driver.c: Likewise.
      e55ec69d
  15. 14 10月, 2011 1 次提交
    • E
      build: add compiler attributes to virUUIDParse · 430156cf
      Eric Blake 提交于
      Coverity complained that most, but not all, clients of virUUIDParse
      were checking for errors.  Silence those coverity warnings by
      explicitly marking the cases where we trust the input, and fixing
      one instance that really should have been checking.  In particular,
      this silences a rather large percentage of the warnings I saw on my
      most recent Coverity analysis run.
      
      * src/util/uuid.h (virUUIDParse): Enforce rules.
      * src/util/uuid.c (virUUIDParse): Drop impossible check; at least
      Coverity will detect if we break rules and pass NULL.
      * src/xenapi/xenapi_driver.c (xenapiDomainCreateXML)
      (xenapiDomainLookupByID, xenapiDomainLookupByName)
      (xenapiDomainDefineXML): Ignore return when we trust data source.
      * src/vbox/vbox_tmpl.c (nsIDtoChar, vboxIIDToUUID_v3_x)
      (vboxCallbackOnMachineStateChange)
      (vboxCallbackOnMachineRegistered, vboxStoragePoolLookupByName):
      Likewise.
      * src/node_device/node_device_hal.c (gather_system_cap): Likewise.
      * src/xenxs/xen_sxpr.c (xenParseSxpr): Check for errors.
      430156cf
  16. 27 9月, 2011 1 次提交
  17. 08 9月, 2011 1 次提交
  18. 16 8月, 2011 1 次提交
  19. 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
  20. 20 7月, 2011 1 次提交
  21. 13 7月, 2011 1 次提交
    • E
      node_device: reject unknown flags · ba78d2cf
      Eric Blake 提交于
      * src/node_device/node_device_driver.c (nodeNumOfDevices)
      (nodeListDevices, nodeDeviceGetXMLDesc, nodeDeviceCreateXML):
      Reject unknown flags.
      * src/node_device/node_device_hal.c (halNodeDrvOpen): Likewise.
      * src/node_device/node_device_udev.c (udevNodeDrvOpen): Likewise.
      ba78d2cf
  22. 08 7月, 2011 1 次提交
    • E
      drivers: prefer unsigned int for flags · 1740c381
      Eric Blake 提交于
      Now that the public APIs always use unsigned flags, the internal
      driver callbacks might as well do likewise.
      
      * src/driver.h (vrDrvOpen, virDrvDomainCoreDump)
      (virDrvDomainGetXMLDesc, virDrvNetworkGetXMLDesc)
      (virDrvNWFilterGetXMLDesc): Update type.
      * src/remote/remote_protocol.x (remote_open_args)
      (remote_domain_core_dump_args, remote_domain_get_xml_desc_args)
      (remote_network_get_xml_desc_args)
      (remote_nwfilter_get_xml_desc_args): Likewise.
      * src/test/test_driver.c: Update clients.
      * src/remote/remote_driver.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * src/xen/xen_hypervisor.h: Likewise.
      * src/xen/xen_driver.c: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * src/xen/xend_internal.h: Likewise.
      * src/xen/xm_internal.c: Likewise.
      * src/xen/xm_internal.h: Likewise.
      * src/xen/xs_internal.c: Likewise.
      * src/xen/xs_internal.h: Likewise.
      * src/xen/xen_inotify.c: Likewise.
      * src/xen/xen_inotify.h: Likewise.
      * src/phyp/phyp_driver.c: Likewise.
      * src/openvz/openvz_driver.c: Likewise.
      * src/vmware/vmware_driver.c: Likewise.
      * src/vbox/vbox_driver.c: Likewise.
      * src/vbox/vbox_tmpl.c: Likewise.
      * src/xenapi/xenapi_driver.c: Likewise.
      * src/esx/esx_driver.c: Likewise.
      * src/esx/esx_interface_driver.c: Likewise.
      * src/esx/esx_network_driver.c: Likewise.
      * src/esx/esx_storage_driver.c: Likewise.
      * src/esx/esx_device_monitor.c: Likewise.
      * src/esx/esx_secret_driver.c: Likewise.
      * src/esx/esx_nwfilter_driver.c: Likewise.
      * src/interface/netcf_driver.c: Likewise.
      * src/nwfilter/nwfilter_driver.c: Likewise.
      * src/libxl/libxl_driver.c: Likewise.
      * src/qemu/qemu_driver.c: Likewise.
      * src/lxc/lxc_driver.c: Likewise.
      * src/uml/uml_driver.c: Likewise.
      * src/network/bridge_driver.c: Likewise.
      * src/secret/secret_driver.c: Likewise.
      * src/storage/storage_driver.c: Likewise.
      * src/node_device/node_device_hal.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/remote_protocol-structs: Likewise.
      1740c381
  23. 06 7月, 2011 1 次提交
  24. 21 6月, 2011 1 次提交
    • C
      Promote virEvent*Handle/Timeout to public API · 6094ad7b
      Cole Robinson 提交于
      Since we virEventRegisterDefaultImpl is now a public API, callers need
      a way to invoke the default registered Handle and Timeout functions. We
      already have general functions for these internally, so promote
      them to the public API.
      
      v2:
          Actually add APIs to libvirt.h
      6094ad7b
  25. 06 6月, 2011 1 次提交
  26. 12 5月, 2011 2 次提交
    • 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
    • E
      node_device: avoid null dereference on error · 98cd17bd
      Eric Blake 提交于
      If we plow on after udev_device_get_syspath fails, we will hit a NULL
      dereference.  Clang found one due to strdup later in udevSetParent,
      but in fact we hit a NULL dereference sooner because of the use of
      STREQ within virNodeDeviceFindBySysfsPath.
      
      * src/conf/node_device_conf.h (virNodeDeviceFindBySysfsPath): Mark
      path argument non-null.
      * src/node_device/node_device_udev.c (udevSetParent): Avoid null
      dereference.
      98cd17bd
  27. 11 5月, 2011 1 次提交
    • M
      Rename internal DumpXML functions to GetXMLDesc · 9817604a
      Matthias Bolte 提交于
      This matches the public API and helps to get rid of some special
      case code in the remote generator.
      
      Rename driver API functions and XDR protocol structs.
      
      No functional change included outside of the remote generator.
      9817604a
  28. 06 5月, 2011 1 次提交
    • E
      maint: rename virBufferVSprintf to virBufferAsprintf · 68ea80cf
      Eric Blake 提交于
      We already have virAsprintf, so picking a similar name helps for
      seeing a similar purpose.  Furthermore, the prefix V before printf
      generally implies 'va_list', even though this variant was '...', and
      the old name got in the way of adding a new va_list version.
      
      global rename performed with:
      
      $ git grep -l virBufferVSprintf \
        | xargs -L1 sed -i 's/virBufferVSprintf/virBufferAsprintf/g'
      
      then revert the changes in ChangeLog-old.
      68ea80cf
  29. 03 5月, 2011 1 次提交
  30. 07 4月, 2011 1 次提交
    • S
      Change locking for udev monitor and callbacks · 28795828
      Serge Hallyn 提交于
      We're seeing bugs apparently resulting from thread unsafety of
      libpciaccess, such as
      https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/726099
      To prevent those, as suggested by danpb on irc, move the
      nodeDeviceLock(driverState) higher into the callers.  In
      particular:
      
        udevDeviceMonitorStartup should hold the lock while calling
        udevEnumerateDevices(), and udevEventHandleCallback should hold it
        over its entire execution.
      
      It's not clear to me whether it is ok to hold the
      nodeDeviceLock while taking the virNodeDeviceObjLock(dev) on a
      device.  If not, then the lock will need to be dropped around
      the calling of udevSetupSystemDev(), and udevAddOneDevice()
      may not actually be safe to call from higher layers with the
      driverstate lock held.
      
      libvirt 0.8.8 with this patch on it seems to work fine for me.
      Assuming it looks ok and I haven't done anything obviously dumb,
      I'll ask the bug submitters to try this patch.
      Signed-off-by: NSerge Hallyn <serge.hallyn@ubuntu.com>
      28795828
  31. 05 4月, 2011 1 次提交
    • E
      build: detect potentential uninitialized variables · 0d166c6b
      Eric Blake 提交于
      Even with -Wuninitialized (which is part of autobuild.sh
      --enable-compile-warnings=error), gcc does NOT catch this
      use of an uninitialized variable:
      
      {
        if (cond)
          goto error;
        int a = 1;
      error:
        printf("%d", a);
      }
      
      which prints 0 (supposing the stack started life wiped) if
      cond was true.  Clang will catch it, but we don't use clang
      as often.  Using gcc -Wjump-misses-init catches it, but also
      gives false positives:
      
      {
        if (cond)
          goto error;
        int a = 1;
        return a;
      error:
        return 0;
      }
      
      Here, a was never used in the scope of the error block, so
      declaring it after goto is technically fine (and clang agrees).
      However, given that our HACKING already documents a preference
      to C89 decl-before-statement, the false positive warning is
      enough of a prod to comply with HACKING.
      
      [Personally, I'd _really_ rather use C99 decl-after-statement
      to minimize scope, but until gcc can efficiently and reliably
      catch scoping and uninitialized usage bugs, I'll settle with
      the compromise of enforcing a coding standard that happens to
      reject false positives if it can also detect real bugs.]
      
      * acinclude.m4 (LIBVIRT_COMPILE_WARNINGS): Add -Wjump-misses-init.
      * src/util/util.c (__virExec): Adjust offenders.
      * src/conf/domain_conf.c (virDomainTimerDefParseXML): Likewise.
      * src/remote/remote_driver.c (doRemoteOpen): Likewise.
      * src/phyp/phyp_driver.c (phypGetLparNAME, phypGetLparProfile)
      (phypGetVIOSFreeSCSIAdapter, phypVolumeGetKey)
      (phypGetStoragePoolDevice)
      (phypVolumeGetPhysicalVolumeByStoragePool)
      (phypVolumeGetPath): Likewise.
      * src/vbox/vbox_tmpl.c (vboxNetworkUndefineDestroy)
      (vboxNetworkCreate, vboxNetworkDumpXML)
      (vboxNetworkDefineCreateXML): Likewise.
      * src/xenapi/xenapi_driver.c (getCapsObject)
      (xenapiDomainDumpXML): Likewise.
      * src/xenapi/xenapi_utils.c (createVMRecordFromXml): Likewise.
      * src/security/security_selinux.c (SELinuxGenNewContext):
      Likewise.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia):
      Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetPtyPaths):
      Likewise.
      * src/qemu/qemu_driver.c (qemudDomainShutdown)
      (qemudDomainBlockStats, qemudDomainMemoryPeek): Likewise.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendCreateIfaceIQN): Likewise.
      * src/node_device/node_device_udev.c (udevProcessPCI): Likewise.
      0d166c6b
  32. 01 4月, 2011 1 次提交
  33. 22 3月, 2011 1 次提交
  34. 21 2月, 2011 1 次提交
    • E
      maint: kill all remaining uses of old DEBUG macro · 994e7567
      Eric Blake 提交于
      Done mechanically with:
      $ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/'
      
      followed by manual deletion of qemudDebug in daemon/libvirtd.c, along
      with a single 'make syntax-check' fallout in the same file, and the
      actual deletion in src/util/logging.h.
      
      * src/util/logging.h (DEBUG, DEBUG0): Delete.
      * daemon/libvirtd.h (qemudDebug): Likewise.
      * global: Change remaining clients over to VIR_DEBUG counterpart.
      994e7567
  35. 10 2月, 2011 3 次提交
    • D
      Adjust some log levels in udev driver · 7a4bc156
      Daniel P. Berrange 提交于
      Most of te VIR_INFO calls in the udev driver are only relevant
      to developers so can switch to VIR_DEBUG. Failure to initialize
      libpciaccess though is a fatal error
      
      * src/node_device/node_device_udev.c: Adjust log levels
      7a4bc156
    • D
      Support SCSI RAID type & lower log level for unknown types · cd782cc3
      Daniel P. Berrange 提交于
      The Linux kernel headers don't have a value for SCSI type 12,
      but HAL source code shows this to be a 'raid'. Add workaround
      for this type. Lower log level for unknown types since
      this is not a fatal error condition. Include the device sysfs
      path in the log output to allow identification of which device
      has problems.
      
      * src/node_device/node_device_udev.c: Add SCSI RAID type
      cd782cc3
    • D
      Only initialize/cleanup libpciaccess once · 2215050e
      Daniel P. Berrange 提交于
      libpciaccess has many bugs in its pci_system_init/cleanup
      functions that makes calling them multiple times unwise.
      eg it will double close() FDs, and leak other FDs.
      
      * src/node_device/node_device_udev.c: Only initialize
        libpciaccess once
      2215050e