1. 20 2月, 2019 1 次提交
    • E
      domain: Fix unknown flags diagnosis in virDomainGetXMLDesc · 27c8fd74
      Eric Blake 提交于
      Many drivers had a comment that they did not validate the incoming
      'flags' to virDomainGetXMLDesc() because they were relying on
      virDomainDefFormat() to do it instead. This used to be the case
      (at least since 461e0f1a and friends in 0.9.4 added unknown flag
      checking in general), but regressed in commit 0ecd6851 (1.2.12),
      when all of the drivers were changed to pass 'flags' through the
      new helper virDomainDefFormatConvertXMLFlags(). Since this helper
      silently ignores unknown flags, we need to implement flag checking
      in each driver instead.
      
      Annoyingly, this means that any new flag values added will silently
      be ignored when targeting an older libvirt, rather than our usual
      practice of loudly diagnosing an unsupported flag.  Add comments
      in domain_conf.[ch] to remind us to be extra vigilant about the
      impact when adding flags (a new flag to add data is safe if the
      older server omitting the requested data doesn't break things in
      the newer client; a new flag to suppress data rather than enhancing
      the existing VIR_DOMAIN_XML_SECURE may form a data leak or even a
      security hole).
      
      In the qemu driver, there are multiple callers all funnelling to
      qemuDomainDefFormatBufInternal(); many of them already validated
      flags (and often only a subset of the full set of possible flags),
      but for ease of maintenance, we can also check flags at the common
      helper function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      27c8fd74
  2. 16 8月, 2018 1 次提交
  3. 14 8月, 2018 1 次提交
  4. 13 8月, 2018 1 次提交
  5. 03 8月, 2018 1 次提交
  6. 23 7月, 2018 2 次提交
    • A
      src: Make virStr*cpy*() functions return an int · 6c0d0210
      Andrea Bolognani 提交于
      Currently, the functions return a pointer to the
      destination buffer on success or NULL on failure.
      
      Not only does this kind of error handling look quite
      alien in the context of libvirt, where most functions
      return zero on success and a negative int on failure,
      but it's also somewhat pointless because unless there's
      been a failure the returned pointer will be the same
      one passed in by the user, thus offering no additional
      value.
      
      Change the functions so that they return an int
      instead.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      6c0d0210
    • A
      src: Use virStrcpyStatic() to avoid truncation · c9d5f2d9
      Andrea Bolognani 提交于
      The way virStrncpy() is called here will never result in
      buffer overflow, but it won't prevent or detect truncation
      either, despite what the error message might suggest. Use
      virStrcpyStatic(), which does all of the above, instead.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      c9d5f2d9
  7. 11 7月, 2018 1 次提交
  8. 04 7月, 2018 2 次提交
  9. 03 7月, 2018 2 次提交
  10. 04 5月, 2018 1 次提交
  11. 12 4月, 2018 3 次提交
  12. 16 3月, 2018 1 次提交
  13. 22 2月, 2018 1 次提交
  14. 03 11月, 2017 1 次提交
    • A
      Remove backslash alignment attempts · 3e7db8d3
      Andrea Bolognani 提交于
      Right-aligning backslashes when defining macros or using complex
      commands in Makefiles looks cute, but as soon as any changes is
      required to the code you end up with either distractingly broken
      alignment or unnecessarily big diffs where most of the changes
      are just pushing all backslashes a few characters to one side.
      
      Generated using
      
        $ git grep -El '[[:blank:]][[:blank:]]\\$' | \
          grep -E '*\.([chx]|am|mk)$$' | \
          while read f; do \
            sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \
          done
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      3e7db8d3
  15. 04 9月, 2017 1 次提交
  16. 07 6月, 2017 1 次提交
  17. 03 4月, 2017 1 次提交
    • M
      virGetDomain: Set domain ID too · 5683b213
      Michal Privoznik 提交于
      So far our code is full of the following pattern:
      
        dom = virGetDomain(conn, name, uuid)
        if (dom)
            dom->id = 42;
      
      There is no reasong why it couldn't be just:
      
        dom = virGetDomain(conn, name, uuid, id);
      
      After all, client domain representation consists of tuple (name,
      uuid, id).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5683b213
  18. 22 11月, 2016 1 次提交
  19. 26 9月, 2016 1 次提交
  20. 23 9月, 2016 1 次提交
  21. 13 7月, 2016 1 次提交
    • T
      esx: Fetch snapshot info directly for filtering · 8ddc56e7
      Tomáš Golembiovský 提交于
      When fetching domains with virConnectListAllDomains() and when filtering
      by snapshot existence is requested the ESX driver first lists all the
      domains and then check one-by-one for snapshot existence. This process
      takes unnecessarily long time.
      
      To significantly improve the time necessary to finish the query we can
      request the snapshot related info directly when querying the list of
      domains from VMware.
      Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com>
      8ddc56e7
  22. 27 6月, 2016 1 次提交
    • L
      global: consistently use IP rather than Ip in identifiers · 22a6873a
      Laine Stump 提交于
      I'm tired of mistyping this all the time, so let's do it the same all
      the time (similar to how we changed all "Pci" to "PCI" awhile back).
      
      (NB: I've left alone some things in the esx and vbox drivers because
      I'm unable to compile them and they weren't obviously *not* a part of
      some API. I also didn't change a couple of variables named,
      e.g. "somethingIptables", because they were derived from the name of
      the "iptables" command)
      22a6873a
  23. 08 6月, 2016 1 次提交
  24. 07 6月, 2016 1 次提交
  25. 27 5月, 2016 1 次提交
    • D
      esx: do not store escaped password in esxVI_Context. · 3ef5e218
      Dawid Zamirski 提交于
      This patch fixes an issue where screenshot API call was failing when
      the esx/vcenter password contains special characters such as
      apostrophee. The reason for failures was that passwords were escaped
      for XML and stored in esxVI_Context which was then passed to raw CURL
      API calls where the password must be passed in original form to
      authenticate successfully. So this patch addresses this by storing
      original passwords in the esxVI_Context struct and escape only for
      esxVI_Login call.
      3ef5e218
  26. 05 2月, 2016 1 次提交
  27. 04 2月, 2016 1 次提交
  28. 09 12月, 2015 1 次提交
  29. 30 11月, 2015 1 次提交
    • M
      conf: Split virDomainObjList into a separate file · 90f3c0d7
      Michal Privoznik 提交于
      Our domain_conf.* files are big enough. Not only they contain XML
      parsing code, but they served as a storage of all functions whose
      name is virDomain prefixed. This is just wrong as it gathers not
      related functions (and modules) into one big file which is then
      harder to maintain. Split virDomainObjList module into a separate
      file called virdomainobjlist.[ch].
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      90f3c0d7
  30. 17 9月, 2015 1 次提交
    • M
      vmx: Expose datacenter path in domain XML · 636a9905
      Matthias Bolte 提交于
      Tool such as libguestfs need the datacenter path to get access to disk
      images. The ESX driver knows the correct datacenter path, but this
      information cannot be accessed using libvirt API yet. Also, it cannot
      be deduced from the connection URI in a robust way.
      
      Expose the datacenter path in the domain XML as <vmware:datacenterpath>
      node similar to the way the <qemu:commandline> node works. The new node
      is ignored while parsing the domain XML. In contrast to <qemu:commandline>
      it is output only.
      636a9905
  31. 04 6月, 2015 1 次提交
  32. 21 4月, 2015 3 次提交
  33. 03 4月, 2015 1 次提交
    • D
      esx: esxNodeGetFreeMemory return info from host. · 66fe31d1
      Dawid Zamirski 提交于
      Before this patch, when connected via vCenter, the free memory returned
      was from the resorcePool (usually a cluster). This is in conflict with
      e.g esxNodeGetInfo which always pulls info from the ESX host.
      Since libvirt ESX driver works primarily with ESX hosts, this patch
      changes esxNodeGetFreeMemory to pull that information from ESX host so
      it's consistent with behavior of esxNodeGetInfo.
      66fe31d1