1. 27 10月, 2014 1 次提交
    • L
      util: eliminate "use after free" in callers of virNetDevLinkDump · f9f9699f
      Laine Stump 提交于
      virNetDevLinkDump() gets a message from netlink into "resp", then
      calls nlmsg_parse() to fill the table "tb" with pointers into resp. It
      then returns tb to its caller, but not before freeing the buffer at
      resp. That means that all the callers of virNetDevLinkDump() are
      examining memory that has already been freed. This can be verified by
      filling the buffer at resp with garbage prior to freeing it (or, I
      suppose, just running libvirtd under valgrind) then performing some
      operation that calls virNetDevLinkDump().
      
      The code has been like this ever since virNetDevLinkDump() was written
      - the original author didn't notice it, and neither did later
      additional users of the function. It has only been pure luck (or maybe
      a lack of heavy load, and/or maybe an allocation algorithm in malloc()
      that delays re-use of just-freed memory) that has kept this from
      causing errors, for example when configuring a PCI passthrough or
      macvtap passthrough network interface.
      
      The solution taken in this patch is the simplest - just return resp to
      the caller along with tb, then have the caller free it after they are
      finished using the data (pointers) in tb. I alternately could have
      made a cleaner interface by creating a new struct that put tb and resp
      together along with a vir*Free() function for it, but this function is
      only used in a couple places, and I'm not sure there will be
      additional new uses of virNetDevLinkDump(), so the value of adding a
      new type, extra APIs, etc. is dubious.
      f9f9699f
  2. 25 10月, 2014 16 次提交
    • J
      tests: Add SELINUX_LIBS to fix viridentitytest linker bug · f2a2d0e9
      Julio Faracco 提交于
      In a clean build system (Ubuntu 14.04), the viridentitytest failed to compile.
      Even if all the SELINUX libraries and depedencies are installed. See the error
      message below:
      
      [...]
        CC       viridentitytest.o
        CCLD     viridentitytest
      /usr/bin/ld: viridentitytest.o: undefined reference to symbol
                                                             'security_disable'
      //lib/x86_64-linux-gnu/libselinux.so.1: error adding symbols: DSO missing
                                                                 from command line
      collect2: error: ld returned 1 exit status
      make: *** [viridentitytest] Error 1
      
      Simply adding the variable SELINUX_LIBS in viridentitytest rules of
      Makefile.am to include SELINUX libraries into viridentitytest solved that
      compilation issue.
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f2a2d0e9
    • S
      vbox: network: make sure driver is not NULL in virRegisterNetworkDriver · 22b18534
      Shanzhi Yu 提交于
      libvirtd will report below error if it does not make sure driver was not NULL
      in virRegisterNetworkDriver
      
      $ libvirtd
      2014-10-24 09:24:36.443+0000: 28876: info : libvirt version: 1.2.10
      2014-10-24 09:24:36.443+0000: 28876: error : virRegisterNetworkDriver:549 : driver in virRegisterNetworkDriver must not be NULL
      2014-10-24 09:24:36.443+0000: 28876: error : virDriverLoadModule:99 : Failed module registration vboxNetworkRegister
      Signed-off-by: NShanzhi Yu <shyu@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      22b18534
    • D
      Add new driver-*.h files to DRIVER_SOURCES · e8656ce1
      Daniel P. Berrange 提交于
      The recently added driver-*.h files were not listed in the
      Makefile.am causing them to be missed when creating dists.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      e8656ce1
    • D
      Fix indentation of sysinfo data · 0d36a5d0
      Daniel P. Berrange 提交于
      The <sysinfo> data block was indented by 2 spaces too many.
      This was missed because we never had any test validating
      the XML formatting.
      0d36a5d0
    • D
      Fix preprocessor indentation in libvirt.h.in · a0b6c98d
      Daniel P. Berrange 提交于
      The cfg.mk rule for checking preprocessor indentation was
      mistakenly missing the libvirt.h.in file due to bad file
      extension matching rule. Fix that and the resolve the
      incorrect indentation that is identified.
      a0b6c98d
    • D
      Move virConnect related APIs out of libvirt.h.in · bcec07b9
      Daniel P. Berrange 提交于
      Create a new libvirt-host.h file to hold the public
      API definitions for the virConnect type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      bcec07b9
    • D
      Move virDomain related APIs out of libvirt.h.in · 653a5e49
      Daniel P. Berrange 提交于
      Create a new libvirt-domain.h file to hold the public
      API definitions for the virDomain type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      653a5e49
    • D
      Move virEvent related APIs out of libvirt.h.in · 6d9c5f37
      Daniel P. Berrange 提交于
      Create a new libvirt-event.h file to hold the public
      API definitions for the virEvent type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      6d9c5f37
    • D
      Move virStoragePool/Vol related APIs out of libvirt.h.in · c9456e1a
      Daniel P. Berrange 提交于
      Create a new libvirt-storage.h file to hold the public
      API definitions for the virStorage/Vol type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      c9456e1a
    • D
      Move virStream related APIs out of libvirt.h.in · 2805ddb2
      Daniel P. Berrange 提交于
      Create a new libvirt-stream.h file to hold the public
      API definitions for the virStream type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      
      Note the definition of virStreamPtr is not moved, since that
      must be declared early for all other libvirt APIs to be able
      to reference it.
      2805ddb2
    • D
      Move virSecret related APIs out of libvirt.h.in · 75ff42fe
      Daniel P. Berrange 提交于
      Create a new libvirt-secret.h file to hold the public
      API definitions for the virSecret type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      75ff42fe
    • D
      Move virNodeDevice related APIs out of libvirt.h.in · 0147d6b8
      Daniel P. Berrange 提交于
      Create a new libvirt-nodedev.h file to hold the public
      API definitions for the virNodeDevice type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      0147d6b8
    • D
      Move virNWFilter related APIs out of libvirt.h.in · 40741984
      Daniel P. Berrange 提交于
      Create a new libvirt-nwfilter.h file to hold the public
      API definitions for the virNWFilter type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      40741984
    • D
      Move virInterface related APIs out of libvirt.h.in · fc964bfc
      Daniel P. Berrange 提交于
      Create a new libvirt-interface.h file to hold the public
      API definitions for the virInterface type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      fc964bfc
    • D
      Move virNetwork related APIs out of libvirt.h.in · 5c9789d2
      Daniel P. Berrange 提交于
      Create a new libvirt-network.h file to hold the public
      API definitions for the virNetwork type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      5c9789d2
    • D
      Move virDomainSnapshot related APIs out of libvirt.h.in · 84783d9d
      Daniel P. Berrange 提交于
      Create a new libvirt-domain-snapshot.h file to hold the public
      API definitions for the virDomainSnapshot type. This header
      file is not self-contained, so applications will not directly
      include it. They will continue to #include <libvirt/libvirt.h>
      84783d9d
  3. 24 10月, 2014 12 次提交
  4. 23 10月, 2014 3 次提交
  5. 22 10月, 2014 7 次提交
    • P
      qemu: migration: Make check for empty hook XML robust · 19b1ee42
      Peter Krempa 提交于
      Also consider whitespace only strings returned from the hook as empty
      result.
      19b1ee42
    • P
      qemu: restore: Fix restoring of VM when the restore hook returns empty XML · e3867799
      Peter Krempa 提交于
      The documentation for the restore hook states that returning an empty
      XML is equivalent with copying the input. There was a bug in the code
      checking the returned string by checking the string instead of the
      contents. Use the new helper to check if the string is empty.
      e3867799
    • P
      util: string: Add helper to check whether string is empty · 0eeafeed
      Peter Krempa 提交于
      The helper checks whether a string contains only whitespace or is NULL.
      This will be helpful to skip cases where a user string is optional, but
      may be provided empty with the same meaning.
      0eeafeed
    • P
      doc: HACKING: Regenerate after recent change · 5de9e082
      Peter Krempa 提交于
      5de9e082
    • R
      Add support for /run/initctl · 7e037f64
      Rick Harris 提交于
      Newer versions of Debian use '/run/initctl' instead of '/dev/initctl'.
      This patch updates the code to search for the FIFO from a list of
      well-known locations.
      7e037f64
    • C
      docs: fix an improper git browsable address · 966d07b9
      Chen Hanxiao 提交于
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      966d07b9
    • R
      Fix cast errors with clang · 82e4f85c
      Roman Bogorodskiy 提交于
      Build with clang fails with:
      
        CC       util/libvirt_util_la-virsocketaddr.lo
      util/virsocketaddr.c:904:17: error: cast from 'struct sockaddr *' to
      'struct sockaddr_in *' increases required alignment from 1 to 4
      [-Werror,-Wcast-align]
              inet4 = (struct sockaddr_in*) res->ai_addr;
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      util/virsocketaddr.c:909:17: error: cast from 'struct sockaddr *' to
      'struct sockaddr_in6 *' increases required alignment from 1 to 4
      [-Werror,-Wcast-align]
              inet6 = (struct sockaddr_in6*) res->ai_addr;
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      2 errors generated.
      
      Fix that by replacing virSocketAddrParseInternal() call with
      virSocketAddrParse() in the virSocketAddrIsNumericLocalhost() function.
      virSocketAddrParse stores an address in virSocketAddr.
      virSocketAddr uses a union to store an address, so it doesn't
      need casting.
      82e4f85c
  6. 21 10月, 2014 1 次提交