1. 14 12月, 2018 1 次提交
    • D
      Remove all Author(s): lines from source file headers · 60046283
      Daniel P. Berrangé 提交于
      In many files there are header comments that contain an Author:
      statement, supposedly reflecting who originally wrote the code.
      In a large collaborative project like libvirt, any non-trivial
      file will have been modified by a large number of different
      contributors. IOW, the Author: comments are quickly out of date,
      omitting people who have made significant contribitions.
      
      In some places Author: lines have been added despite the person
      merely being responsible for creating the file by moving existing
      code out of another file. IOW, the Author: lines give an incorrect
      record of authorship.
      
      With this all in mind, the comments are useless as a means to identify
      who to talk to about code in a particular file. Contributors will always
      be better off using 'git log' and 'git blame' if they need to  find the
      author of a particular bit of code.
      
      This commit thus deletes all Author: comments from the source and adds
      a rule to prevent them reappearing.
      
      The Copyright headers are similarly misleading and inaccurate, however,
      we cannot delete these as they have legal meaning, despite being largely
      inaccurate. In addition only the copyright holder is permitted to change
      their respective copyright statement.
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      60046283
  2. 20 9月, 2018 1 次提交
  3. 17 9月, 2018 1 次提交
  4. 16 8月, 2018 1 次提交
  5. 14 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: Don't rely on strncpy()-like behavior · 583bdfa6
      Andrea Bolognani 提交于
      The strncpy() function has this quirk where it will copy
      *up* to the requested number of bytes, that is, it will
      stop early if it encounters a NULL byte in the source
      string.
      
      This makes it legal to pass the size of the destination
      buffer (minus one byte needed for the string terminator)
      as the number of bytes to copy and still get something
      somewhat reasonable out of the operation; unfortunately,
      it also makes the function difficult to reason about
      and way too easy to misuse.
      
      We want to move away from the way strncpy() behaves and
      towards better defined semantics, where virStrncpy()
      will always copy *exactly* the number of bytes it's
      been asked to copy; before we can do that, though, we
      have to change a few of the callers.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      583bdfa6
  7. 12 4月, 2018 2 次提交
  8. 07 6月, 2017 1 次提交
  9. 05 6月, 2017 1 次提交
  10. 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
  11. 22 11月, 2016 1 次提交
  12. 26 9月, 2016 3 次提交
  13. 11 7月, 2016 1 次提交
    • P
      conf: Add private data for virDomainVcpuDef · 5fe0b6b0
      Peter Krempa 提交于
      Allow to store driver specific data on a per-vcpu basis.
      
      Move of the virDomainDef*Vcpus* functions was necessary as
      virDomainXMLOptionPtr was declared below this block and I didn't want to
      split the function headers.
      5fe0b6b0
  14. 08 6月, 2016 1 次提交
  15. 07 6月, 2016 1 次提交
  16. 02 5月, 2016 1 次提交
    • C
      conf: domain: reject name containing '/' · b1fc6a7b
      Cole Robinson 提交于
      Trying to define a domain name containing an embedded '/'
      will immediately fail when trying to write the XML to disk for
      our stateful drivers. This patch explicitly rejects names
      containing a '/', and provides an xmlopt feature for drivers
      to avoid this validation check, which is enabled in every
      non-stateful driver that already has xmlopt handling wired up.
      
      (Technically this could reject a previously accepted vmname like
       '/foo', however at least for the qemu driver that falls over
       later when starting qemu)
      
      https://bugzilla.redhat.com/show_bug.cgi?id=639923
      b1fc6a7b
  17. 09 3月, 2016 1 次提交
    • P
      conf: refactor checking for unsupported memory devices · 185d13b1
      Peter Krempa 提交于
      Introduce a helper to check supported device and domain config and move
      the memory hotplug checks to it.
      
      The advantage of this approach is that by default all new features are
      considered unsupported by all hypervisors unless specifically changed
      rather than the previous approach where every hypervisor would need to
      declare that a given feature is unsupported.
      185d13b1
  18. 04 2月, 2016 2 次提交
  19. 27 1月, 2016 1 次提交
    • P
      device: cleanup input device code · 36785c7e
      Pavel Hrdina 提交于
      The current code was a little bit odd.  At first we've removed all
      possible implicit input devices from domain definition to add them later
      back if there was any graphics device defined while parsing XML
      description.  That's not all, while formating domain definition to XML
      description we at first ignore any input devices with bus different to
      USB and VIRTIO and few lines later we add implicit input devices to XML.
      
      This seems to me as a lot of code for nothing.  This patch may look
      to be more complicated than original approach, but this is a preferred
      way to modify/add driver specific stuff only in those drivers and not
      deal with them in common parsing/formating functions.
      
      The update is to add those implicit input devices into config XML to
      follow the real HW configuration visible by guest OS.
      
      There was also inconsistence between our behavior and QEMU's in the way,
      that in QEMU there is no way how to disable those implicit input devices
      for x86 architecture and they are available always, even without graphics
      device.  This applies also to XEN hypervisor.  VZ driver already does its
      part by putting correct implicit devices into live XML.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      36785c7e
  20. 11 1月, 2016 1 次提交
  21. 09 12月, 2015 2 次提交
  22. 24 11月, 2015 1 次提交
  23. 22 9月, 2015 1 次提交
  24. 21 4月, 2015 4 次提交
  25. 23 3月, 2015 2 次提交
    • P
      conf: Add interface to parse and format memory device information · 3e4230d2
      Peter Krempa 提交于
      This patch adds code that parses and formats configuration for memory
      devices.
      
      A simple configuration would be:
      <memory model='dimm'>
        <target>
          <size unit='KiB'>524287</size>
          <node>0</node>
        </target>
      </memory>
      
      A complete configuration of a memory device:
      <memory model='dimm'>
        <source>
          <pagesize unit='KiB'>4096</pagesize>
          <nodemask>1-3</nodemask>
        </source>
        <target>
          <size unit='KiB'>524287</size>
          <node>1</node>
        </target>
      </memory>
      
      This patch preemptively forbids use of the <memory> device in individual
      drivers so the users are warned right away that the device is not
      supported.
      3e4230d2
    • P
      conf: Add support for parsing and formatting max memory and slot count · bffb9163
      Peter Krempa 提交于
      Add a XML element that will allow to specify maximum supportable memory
      and the count of memory slots to use with memory hotplug.
      
      To avoid possible confusion and misuse of the new element this patch
      also explicitly forbids the use of the maxMemory setting in individual
      drivers's post parse callbacks. This limitation will be lifted when the
      support is implemented.
      bffb9163
  26. 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
  27. 12 3月, 2015 3 次提交
    • J
      xenapi: Resolve Coverity REVERSE_INULL · eab968c7
      John Ferlan 提交于
      Coverity notes in xenapiDomainGetXMLDesc that 'vms' is dereferenced
      a few times before a "if (vms) xen_vm_set_free(vms);" call is made.
      Since we'd exit out much sooner if the fetch of the vms failed, just
      remove the unnecessary "if (vms)" check.
      eab968c7
    • J
      xenapi: Resolve Coverity NULL_RETURNS · b193a1d6
      John Ferlan 提交于
      Coverity points out that the return from virDomainDefParseString is
      not checked in xenapiDomainCreateXML like it should be which could
      end up in a NULL pointer dereference
      b193a1d6
    • J
      xenapi: Resolve Coverity FORWARD_NULL · 500d77f1
      John Ferlan 提交于
      Since inception.  Coverity complains that the code checks "(record ==
      NULL && !session->ok)", but doesn't check (record != NULL) before
      dereferencing at "record->is_a_template"
      500d77f1
  28. 06 2月, 2015 1 次提交