1. 16 1月, 2020 3 次提交
    • M
    • M
      virchrdev: Don't leak mutex if virChrdevAlloc() fails · 15b82112
      Michal Privoznik 提交于
      This is only a theoretical leak, but in virChrdevAlloc() we
      initialize a mutex and if creating a hash table fails,
      then virChrdevFree() is called which because of incorrect check
      doesn't deinit the mutex.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      15b82112
    • M
      virchrdev: Don't leak @dev member of virChrdevHashEntry struct · aab37799
      Michal Privoznik 提交于
      When opening a console to a domain, we put a tuple of {path,
      virStreamPtr} into a hash table that's private to the domain.
      This is to ensure only one client at most has the console stream
      open. Later, when the console is closed, the tuple is removed
      from the hash table and freed. Except, @path won't be freed.
      
      ==234102== 60 bytes in 5 blocks are definitely lost in loss record 436 of 651
      ==234102==    at 0x4836753: malloc (vg_replace_malloc.c:307)
      ==234102==    by 0x5549110: g_malloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
      ==234102==    by 0x5562D1E: g_strdup (in /usr/lib64/libglib-2.0.so.0.6000.6)
      ==234102==    by 0x4A5A917: virChrdevOpen (virchrdev.c:412)
      ==234102==    by 0x17B64645: qemuDomainOpenConsole (qemu_driver.c:17309)
      ==234102==    by 0x4BC8031: virDomainOpenConsole (libvirt-domain.c:9662)
      ==234102==    by 0x13F854: remoteDispatchDomainOpenConsole (remote_daemon_dispatch_stubs.h:9211)
      ==234102==    by 0x13F72F: remoteDispatchDomainOpenConsoleHelper (remote_daemon_dispatch_stubs.h:9178)
      ==234102==    by 0x4AB0685: virNetServerProgramDispatchCall (virnetserverprogram.c:430)
      ==234102==    by 0x4AB01F0: virNetServerProgramDispatch (virnetserverprogram.c:302)
      ==234102==    by 0x4AB700B: virNetServerProcessMsg (virnetserver.c:136)
      ==234102==    by 0x4AB70CB: virNetServerHandleJob (virnetserver.c:153)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      aab37799
  2. 22 11月, 2019 2 次提交
  3. 12 11月, 2019 1 次提交
  4. 21 10月, 2019 1 次提交
  5. 15 10月, 2019 1 次提交
  6. 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
  7. 27 3月, 2017 1 次提交
  8. 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
  9. 04 6月, 2015 1 次提交
  10. 03 12月, 2014 1 次提交
    • J
      Replace virStreamFree with virObjectUnref · 1725a468
      John Ferlan 提交于
      Since virStreamFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      1725a468
  11. 25 3月, 2014 1 次提交
  12. 21 3月, 2014 1 次提交
    • R
      Introduce virFDStreamOpenPTY · 4dae396f
      Roman Bogorodskiy 提交于
      Add virFDStreamOpenPTY() function which is a wrapper around
      virFDStreamOpenFileInternal() with putting the device it opens into a
      raw mode.
      
      Make virChrdevOpen() use virFDStreamOpenPTY() for
      VIR_DOMAIN_CHR_TYPE_PTY devices.
      
      This fixes mangled console output when libvirt runs on FreeBSD as it
      requires device it opens to be placed into a raw mode explicitly.
      4dae396f
  13. 18 3月, 2014 1 次提交
  14. 10 7月, 2013 1 次提交
  15. 24 5月, 2013 1 次提交
  16. 23 5月, 2013 2 次提交
  17. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  18. 05 1月, 2013 3 次提交
  19. 21 12月, 2012 4 次提交
  20. 21 9月, 2012 1 次提交
  21. 04 8月, 2012 1 次提交
    • P
      conf: Remove console stream callback only when freeing console helper · 45edefc7
      Peter Krempa 提交于
      Commit ba226d33 tried to fix crash of
      the daemon when a domain with an open console was destroyed. The fix was
      wrong as it tried to remove the callback also when the stream was
      aborted, where at that point the fd stream driver was already freed and
      removed.
      
      This patch clears the callbacks with a helper right before the hash is
      freed, so that it doesn't interfere with other codepaths where the
      stream object is freed.
      45edefc7
  22. 30 7月, 2012 2 次提交
  23. 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
  24. 19 7月, 2012 1 次提交
  25. 27 2月, 2012 1 次提交
    • P
      util: Add helpers for safe domain console operations · 3f4238d7
      Peter Krempa 提交于
      This patch adds a set of functions used in creating console streams for
      domains using PTYs and ensures mutually exclusive access to the PTYs.
      
      If mutually exclusive access is not used, two clients may open the same
      console, which results in corruption on both clients as both of them
      race to read data from the PTY.
      
      Two approaches are used to ensure this:
      1) Internal data structure holding open PTYs.
              This is used internally and enables the user to forcibly
              terminate another console connection eg. when somebody leaves
              the console open on another host.
      
      2) UUCP style lock files:
              This uses UUCP lock files according to the  FHS
              ( http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES )
              to check if other programs (like minicom) are not using the pty
              device of the console.
      
              This feature is disabled by default and may be enabled using
              configure parameter
              --with-console-lock-files=/path/to/lock/file/directory
              or --with-console-lock-files=auto (which tries to infer the
              location from OS used (currently only linux).
      
              On usual linux systems, normal users may not write to the
              /var/lock directory containing the locks. This poses problems
              while in session mode. If the current user has no access to the
              lockfile directory, check for presence of the file is still
              done, but no lock file is created. This does NOT result in an
              error.
      3f4238d7