1. 31 Jan, 2019 3 commits
    • Daniel P. Berrangé's avatar
      Ensure nul termination of hostname · d7684186
      Daniel P. Berrangé authored
      Newest GCC warns that the string copying is potentially truncated and
      thus not nul terminated.
      
      In file included from /usr/include/string.h:494,
                       from ../../src/Virt_HostSystem.c:23:
      In function ‘strncpy’,
          inlined from ‘resolve_host’ at ../../src/Virt_HostSystem.c:55:28,
          inlined from ‘get_fqdn’ at ../../src/Virt_HostSystem.c:92:23,
          inlined from ‘set_host_system_properties’ at ../../src/Virt_HostSystem.c:109:13:
      /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘resolve_host’ at ../../src/Virt_HostSystem.c:67:17,
          inlined from ‘get_fqdn’ at ../../src/Virt_HostSystem.c:92:23,
          inlined from ‘set_host_system_properties’ at ../../src/Virt_HostSystem.c:109:13:
      /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cc1: all warnings being treated as errors
      Signed-off-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
      d7684186
    • Daniel P. Berrangé's avatar
      No need to tell us we can run make · 7b2725ba
      Daniel P. Berrangé authored
      When running autogen.sh we get told twice
      
         "You may now run make"
      
      Anyone who knows that they must run configure, already knows that they
      must run make too. There's no need to tell them, twice.
      Signed-off-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
      7b2725ba
    • Daniel P. Berrangé's avatar
      Update description of DMTF schema distribution terms · a35bb08e
      Daniel P. Berrangé authored
      The schema files that we actually download & bundle in the tar.gz dist
      have removed the clause "for uses consistent with this purpose" which
      is good because that clause might be considered a distribution
      restriction which could make it a non-free license.
      Signed-off-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
      a35bb08e
  2. 24 Apr, 2018 1 commit
    • Daniel P. Berrangé's avatar
      git: add config file telling git-publish how to send patches · 9c55cc69
      Daniel P. Berrangé authored
      The "git-publish" tool is a useful git extension for sending patch
      series for code review. It automatically creates versioned tags
      each time code on a branch is sent, so that there is a record of
      each version. It also remembers the cover letter so it does not
      need re-entering each time the series is reposted.
      
      With this config file present it is now sufficient[1] to run
      
        $ git publish
      
      to send all patches in a branch to the list for review, with the
      correct subject prefix added for this non-core libvirt module.
      
      [1] Assuming your $HOME/.gitconfig has an SMTP server listed
      at least e.g.
      
         [sendemail]
              smtpserver = smtp.example.com
      Signed-off-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
      9c55cc69
  3. 16 Nov, 2017 3 commits
  4. 22 Sep, 2017 2 commits
  5. 28 Apr, 2015 1 commit
    • Michal Privoznik's avatar
      list_util.h: Drop inline modifiers · 63acad05
      Michal Privoznik authored
      There's no need to mark a function as inline in the function
      declaration. In fact, it causes a compilation error:
      
        CC       xmlgen.lo
      In file included from acl_parsing.h:29:0,
                       from xmlgen.h:26,
                       from capability_parsing.c:37:
      list_util.h:67:21: error: inline function ‘list_node_prev_node’ declared but never defined [-Werror]
       inline list_node_t *list_node_prev_node(list_node_t *node);
                           ^
      list_util.h:66:14: error: inline function ‘list_node_prev’ declared but never defined [-Werror]
       inline void        *list_node_prev(list_node_t *node);
                    ^
      list_util.h:64:21: error: inline function ‘list_node_next_node’ declared but never defined [-Werror]
       inline list_node_t *list_node_next_node(list_node_t *node);
                           ^
      list_util.h:63:14: error: inline function ‘list_node_next’ declared but never defined [-Werror]
       inline void        *list_node_next(list_node_t *node);
                    ^
      list_util.h:61:21: error: inline function ‘list_last_node’ declared but never defined [-Werror]
       inline list_node_t *list_last_node(list_t *list);
                           ^
      list_util.h:60:14: error: inline function ‘list_last’ declared but never defined [-Werror]
       inline void        *list_last(list_t *list);
                    ^
      list_util.h:58:21: error: inline function ‘list_first_node’ declared but never defined [-Werror]
       inline list_node_t *list_first_node(list_t *list);
                           ^
      list_util.h:57:14: error: inline function ‘list_first’ declared but never defined [-Werror]
       inline void        *list_first(list_t *list);
                    ^
      list_util.h:55:13: error: inline function ‘list_node_data_set’ declared but never defined [-Werror]
       inline void  list_node_data_set(list_node_t *node, void *data);
                   ^
      list_util.h:54:14: error: inline function ‘list_node_data_get’ declared but never defined [-Werror]
       inline void *list_node_data_get(list_node_t *node);
                    ^
      list_util.h:52:21: error: inline function ‘list_count’ declared but never defined [-Werror]
       inline unsigned int list_count(list_t *list);
                           ^
      cc1: all warnings being treated as errors
      Makefile:499: recipe for target 'capability_parsing.lo' failed
      make[2]: *** [capability_parsing.lo] Error 1
      make[2]: *** Waiting for unfinished jobs....
      Signed-off-by: 's avatarMichal Privoznik <mprivozn@redhat.com>
      63acad05
  6. 16 Jun, 2014 1 commit
  7. 11 Jun, 2014 1 commit
    • Xu Wang's avatar
      Add disk device='lun' support · 5787acc1
      Xu Wang authored
      Besides 'disk', 'cdrom', 'floppy' and 'filesystem', there is one
      more value 'lun' should be supported by value of device field in
      the disk device. So this patch adds it into libvirt-cim. Now device
      like <disk type='block' device='lun'> could be operated by class.
      Signed-off-by: 's avatarXu Wang <gesaint@linux.vnet.ibm.com>
      5787acc1
  8. 07 May, 2014 1 commit
  9. 04 Apr, 2014 3 commits
  10. 27 Mar, 2014 3 commits
  11. 26 Mar, 2014 4 commits
  12. 18 Feb, 2014 1 commit
  13. 05 Feb, 2014 7 commits
    • John Ferlan's avatar
      Adjust sscanf format string · fb5d2fcf
      John Ferlan authored
      Currently the sscanf() calls use "%as" or "%a[" in order to allocate and
      return strings for read fields.  It was pointed out to me that this is an
      older and non-portable method.  Instead the "%ms" or "%m[" should be used.
      fb5d2fcf
    • John Ferlan's avatar
      EAFP: Coverity cleanup · 8eb5c1e7
      John Ferlan authored
      A new version of Coverity found:
      
      get_dev_from_pool(): RESOURCE_LEAK
        - Because the code is run within a for() loop Coverity complains
          that the returned 'poolid' is not free'd during each pass through
          the loop.  So even though it may not be fetched again, just free()
          and reinitialize 'poolid' after usage
      8eb5c1e7
    • John Ferlan's avatar
      RAFP: Coverity cleanup · 55d3f9fc
      John Ferlan authored
      A new version of Coverity found:
      
      filter_by_pool(): RESOURCE_LEAK
        - Because the code is run within a for() loop Coverity complains
          that the returned 'poolid' is not free'd during each pass through
          the loop.  So even though it may not be fetched again, just free()
          and reinitialize 'poolid' after usage
      55d3f9fc
    • John Ferlan's avatar
      libxkutil/xml_parse_test: Coverity cleanup · a6cbafc6
      John Ferlan authored
      A new version of Coverity found:
      
      print_domxml(): RESOURCE_LEAK
        - The 'xml' variable needs to be free()'d
      a6cbafc6
    • John Ferlan's avatar
      libxkutil:device_parsing: Coverity cleanups · 4013f9a0
      John Ferlan authored
      A new version of Coverity found a number of issues:
      
      parse_os(): RESOURCE_LEAK
        - A benign issue due to using a for() loop in order to process the
          XML fields.  Although it's not possible to have a second entry with
          the same text, Coverity doesn't know that so flagged each of the
          get_attr_value() calls with a possible overwrite of allocated memory.
          In order to "fix' that - just check for each being NULL prior to
          the setting - a benign fix that shuts Coverity up
      
        - A real issue was found - the 'loader' variable wasn't free()'d
      
      parse_console_device(): RESOURCE_LEAK
      
        - A benign issue due to using a for() loop in order to process the
          XML fields results in 'target_port_ID' and 'udp_source_mode' being
          flagged for possible overwrites. For the 'udp_source_mode' changed
          the code to declare, use, free only within the scope of the case.
      4013f9a0
    • John Ferlan's avatar
      libxkutil:pool_parsing: Coverity cleanups · 7f3288be
      John Ferlan authored
      A new version of Coverity found a number of issues:
      
      get_pool_from_xml(): FORWARD_NULL
      parse_disk_pool(): RESOURCE_LEAK
        - If parse_disk_pool() returned name == NULL, then the strdup() of
          name into pool->id would dereference the NULL pointer leading to
          a segfault.
      
          Furthermore parse_disk_pool() had a few issues.  First the 'type_str'
          could be NULL, so that needs to be checked.  Second, 'type_str' was
          never free()'d (the get_attr_value returns a strdup()'d value).
      
          Realizing all that resulted in a few extra changes to not strdup()
          a value that we strdup()'d
      
          Eventually get_pool_from_xml() will return to get_disk_pool() which
          returns to diskpool_set_capacity() or _new_volume_template() which
          both error out when return value != 0 (although, I did change the
          latter to be more explicit and match the former).
      
          Finally, even though the parsing of the element will only ever have
          one "name" value - Coverity doesn't know that, so as a benign fix be
          sure to not overwrite 'name' if "name" isn't already set.
      Signed-off-by: 's avatarJohn Ferlan <jferlan@redhat.com>
      7f3288be
    • John Ferlan's avatar
      VSMS: Coverity cleanups · f9fc5821
      John Ferlan authored
      A new version of Coverity found a number of issues:
      
      parse_ip_address(): FORWARD_NULL
        - Benign issue regarding how 'tmp_ip' was compared against NULL for
          the IPv6 processing and then used blindly later when strdup()'ing
          into *ip. Rather than use NULL check, compare against return of 1
          or more which indicates that something is there
      
      update_system_settings(): RESOURCE_LEAK
        - The 'uuid' value was being leaked if strdup()'d.  Also rather than
          strdup()'g and strdup()'d value and risking failure, just assign the
          initially strdup()'d value and reinitialize uuid to NULL
      
      fv_vssd_to_domain(): USE_AFTER_FREE
        - The domain->os_info.fv.arch is free()'d only to be potentially
          strdup()'d after processing the 'cu_get_str_prop()' for "Arch".
          The complaint was that it was possible to not strdup() a new value
          and thus possible to pass a free()'d value to get_default_machine().
          Passing a NULL is not an issue as that is checked.
      
          Additionally found by inspection, 'val' was not initialized to NULL,
          so the setting of os_info.fv.arch may not be what was expected. Also,
          after processing "Arch" it was not reinitialized to NULL so its
          contents could potentially have been saved in os_info.fv.machine.
      Signed-off-by: 's avatarJohn Ferlan <jferlan@redhat.com>
      f9fc5821
  14. 21 Jan, 2014 1 commit
    • John Ferlan's avatar
      spec: Fix docs/*.html packaging issue · 54778c78
      John Ferlan authored
      Using a more recent rpmbuild on f20, I found that the 'make rpm' was failing:
      
        Installed (but unpackaged) file(s) found:
        /usr/share/doc/libvirt-cim-0.6.3/html/architecture.html
        /usr/share/doc/libvirt-cim-0.6.3/html/downloads.html
        /usr/share/doc/libvirt-cim-0.6.3/html/index.html
        /usr/share/doc/libvirt-cim-0.6.3/html/intro.html
        /usr/share/doc/libvirt-cim-0.6.3/html/libvirt-cim.html
        /usr/share/doc/libvirt-cim-0.6.3/html/news.html
        /usr/share/doc/libvirt-cim-0.6.3/html/patches.html
        /usr/share/doc/libvirt-cim-0.6.3/html/platforms.html
        /usr/share/doc/libvirt-cim-0.6.3/html/schema.html
        make: *** [rpm] Error 1
      
      After a bit of research - I found the following page that describes a
      workaround to add "%define _unpackaged_files_terminate_build 0" to the
      spec file:
      
      http://www.oldrpm.org/hintskinks/unpackaged/
      
      However, figuring that wasn't a great solution - I found a libvirt change
      that provided a way to work around what was being seen, see:
      
      http://www.redhat.com/archives/libvir-list/2013-November/msg00441.html
      
      It seems as though having that %doc doc/*.html is not proper any more.
      With this change I can once again build RPM packages
      Signed-off-by: 's avatarJohn Ferlan <jferlan@redhat.com>
      54778c78
  15. 21 Nov, 2013 1 commit
  16. 13 Nov, 2013 7 commits