1. 24 6月, 2016 1 次提交
    • J
      Introduce VIR_DIR_CLOSE · a4e6f1eb
      Ján Tomko 提交于
      Introduce a helper that only calls closedir if DIR* is non-NULL
      and sets it to NULL afterwards.
      a4e6f1eb
  2. 17 6月, 2016 1 次提交
  3. 07 6月, 2016 1 次提交
    • P
      conf: Add device def validation callback · 9890a7a1
      Peter Krempa 提交于
      Similarly to the domain definition validator add a device validator. The
      change to the prototype of the domain validator is necessary as
      virDomainDeviceInfoIterateInternal requires a non-const pointer.
      9890a7a1
  4. 17 2月, 2016 1 次提交
    • E
      util: Add a return value to void hash iterators · cc48d3a1
      Erik Skultety 提交于
      Our existing virHashForEach method iterates through all items disregarding the
      fact, that some of the iterators might have actually failed. Errors are usually
      dispatched through an error element in opaque data which then causes the
      original caller of virHashForEach to return -1. In that case, virHashForEach
      could return as soon as one of the iterators fail. This patch changes the
      iterator return type and adjusts all of its instances accordingly, so the
      actual refactor of virHashForEach method can be dealt with later.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      cc48d3a1
  5. 18 12月, 2015 2 次提交
  6. 09 12月, 2015 6 次提交
  7. 22 9月, 2015 1 次提交
  8. 12 9月, 2015 1 次提交
    • D
      xen: fix race in refresh of config cache · 427067f7
      Daniel P. Berrange 提交于
      The xenXMConfigCacheRefresh method scans /etc/xen and loads
      all config files it finds. It then scans its internal hash
      table and purges any (previously) loaded config files whose
      refresh timestamp does not match the timestamp recorded at
      the start of xenXMConfigCacheRefresh(). There is unfortunately
      a subtle flaw in this, because if loading the config files
      takes longer than 1 second, some of the config files will
      have a refresh timestamp that is 1 or more seconds different
      (newer) than is checked for. So we immediately purge a bunch
      of valid config files we just loaded.
      
      To avoid this flaw, we must pass the timestamp we record at
      the start of xenXMConfigCacheRefresh() into the
      xenXMConfigCacheAddFile() method, instead of letting the
      latter call time(NULL) again.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      427067f7
  9. 06 5月, 2015 1 次提交
    • J
      xen: Resolve Coverity FORWARD_NULL · c9a8e594
      John Ferlan 提交于
      Coverity found that xenXMConfigCacheAddFile has an error path in which
      no error message and a -1 was not returned which could have resulted in
      a NULL dereference in a VIR_DEBUG statement and of course an erroneous
      0 value returned!
      c9a8e594
  10. 16 3月, 2015 1 次提交
    • P
      conf: Replace access to def->mem.max_balloon with accessor functions · 4f9907cd
      Peter Krempa 提交于
      As there are two possible approaches to define a domain's memory size -
      one used with legacy, non-NUMA VMs configured in the <memory> element
      and per-node based approach on NUMA machines - the user needs to make
      sure that both are specified correctly in the NUMA case.
      
      To avoid this burden on the user I'd like to replace the NUMA case with
      automatic totaling of the memory size. To achieve this I need to replace
      direct access to the virDomainMemtune's 'max_balloon' field with
      two separate getters depending on the desired size.
      
      The two sizes are needed as:
      1) Startup memory size doesn't include memory modules in some
      hypervisors.
      2) After startup these count as the usable memory size.
      
      Note that the comments for the functions are future aware and document
      state that will be present after a few later patches.
      4f9907cd
  11. 21 2月, 2015 1 次提交
  12. 14 1月, 2015 1 次提交
    • D
      Give virDomainDef parser & formatter their own flags · 0ecd6851
      Daniel P. Berrange 提交于
      The virDomainDefParse* and virDomainDefFormat* methods both
      accept the VIR_DOMAIN_XML_* flags defined in the public API,
      along with a set of other VIR_DOMAIN_XML_INTERNAL_* flags
      defined in domain_conf.c.
      
      This is seriously confusing & error prone for a number of
      reasons:
      
       - VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_XML_MIGRATABLE and
         VIR_DOMAIN_XML_UPDATE_CPU are only relevant for the
         formatting operation
       - Some of the VIR_DOMAIN_XML_INTERNAL_* flags only apply
         to parse or to format, but not both.
      
      This patch cleanly separates out the flags. There are two
      distint VIR_DOMAIN_DEF_PARSE_* and VIR_DOMAIN_DEF_FORMAT_*
      flags that are used by the corresponding methods. The
      VIR_DOMAIN_XML_* flags received via public API calls must
      be converted to the VIR_DOMAIN_DEF_FORMAT_* flags where
      needed.
      
      The various calls to virDomainDefParse which hardcoded the
      use of the VIR_DOMAIN_XML_INACTIVE flag change to use the
      VIR_DOMAIN_DEF_PARSE_INACTIVE flag.
      0ecd6851
  13. 15 11月, 2014 1 次提交
  14. 29 4月, 2014 1 次提交
    • E
      drivers: use virDirRead API · ddcf4730
      Eric Blake 提交于
      Convert all remaining clients of readdir to use the new
      interface, so that we can ensure (unlikely) errors while
      reading a directory are reported.
      
      * src/openvz/openvz_conf.c (openvzAssignUUIDs): Use new
      interface.
      * src/parallels/parallels_storage.c (parallelsFindVolumes)
      (parallelsFindVmVolumes): Report readdir failures.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Ignore readdir
      failures.
      * src/secret/secret_driver.c (loadSecrets): Likewise.
      * src/qemu/qemu_hostdev.c
      (qemuHostdevHostSupportsPassthroughVFIO): Report readdir failures.
      * src/xen/xen_inotify.c (xenInotifyOpen): Likewise.
      * src/xen/xm_internal.c (xenXMConfigCacheRefresh): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ddcf4730
  15. 12 4月, 2014 1 次提交
    • E
      util: new virFileRelLinkPointsTo function · 91f349d8
      Eric Blake 提交于
      When checking if two filenames point to the same inode (whether
      by hardlink or symlink), sometimes one of the names might be
      relative.  This convenience function makes it easier to check.
      
      * src/util/virfile.h (virFileRelLinkPointsTo): New prototype.
      * src/util/virfile.c (virFileRelLinkPointsTo): New function.
      * src/libvirt_private.syms (virfile.h): Export it.
      * src/xen/xm_internal.c (xenXMDomainGetAutostart): Use it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      91f349d8
  16. 25 3月, 2014 1 次提交
  17. 21 3月, 2014 1 次提交
  18. 18 3月, 2014 1 次提交
  19. 10 3月, 2014 2 次提交
  20. 15 10月, 2013 1 次提交
    • E
      maint: avoid 'const fooPtr' in all remaining places · 33aec506
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up all remaining offenders.
      
      * src/lxc/lxc_process.c (virLXCProcessSetupInterfaceBridged): Drop
      needless const.
      * src/uml/uml_driver.c (umlMonitorCommand): Use intended type.
      (umlMonitorAddress): Fix fallout.
      * src/xen/xm_internal.c (xenXMDomainSearchForUUID): Use intended type.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      33aec506
  21. 11 7月, 2013 1 次提交
  22. 10 7月, 2013 1 次提交
  23. 23 5月, 2013 1 次提交
  24. 21 5月, 2013 10 次提交