1. 24 6月, 2014 3 次提交
    • P
      util: string: Add helper to free non-NULL terminated string arrays · 5d4a4825
      Peter Krempa 提交于
      To free string lists with some strings stolen from the middle we need to
      walk the complete array. Introduce a new helper that takes the string
      list size to free such string lists.
      5d4a4825
    • J
      libxl: prefer qdisk for <driver name='file'> · 48d81cef
      Jim Fehlig 提交于
      The libxl driver currently sets the disk backend to
      LIBXL_DISK_BACKEND_TAP when <driver name='file'> is specified
      in the <disk> config.  qdisk should be prefered with this
      configuration, otherwise existing configuration such as the
      following, which worked with the old Xen driver, will not work
      with the libxl driver
      
        <disk type='file' device='cdrom'>
          <driver name='file'/>
          <source file='/path/to/some/iso'/>
          <target dev='hdc' bus='ide'/>
          <readonly/>
        </disk>
      
      In addition, tap performs poorly compared to qdisk.
      48d81cef
    • M
      cmdFreepages: initialize @tmp · 8d8e1d9d
      Michal Privoznik 提交于
      In the 404bac14 the @tmp variable was introduced. It's purpose is to
      avoid typecasting when parsing --pagesize argument. However, if the
      argument is not presented, tmp may be used uninitialized resulting in
      bogus virNodeGetFreePages() API call:
      
      virsh freepages --cellno 2
      error: Failed to open file '/sys/devices/system/node/node2/hugepages/hugepages-4294967295kB/free_hugepages': No such file or directory
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8d8e1d9d
  2. 23 6月, 2014 14 次提交
    • R
      Fix closedir usage in virNumaGetPages · 4a82ef92
      Roman Bogorodskiy 提交于
      virNumaGetPages calls closedir(dir) in cleanup and dir could
      be NULL if we jump there from the failed opendir() call.
      
      While it's not harmful on Linux, FreeBSD libc crashes [1], so
      make sure that dir is not NULL before calling closedir.
      
      1: http://lists.freebsd.org/pipermail/freebsd-standards/2014-January/002704.html
      4a82ef92
    • D
      Add pkg-config files to allow deps to build against source tree · 60c343f6
      Daniel P. Berrange 提交于
      When testing language bindings it is useful to be able to build
      them against an uninstalled libvirt source tree. Add a dummy
      set of pkg-config files to allow for this. This can be used by
      setting
      
        export PKG_CONFIG_PATH=/path/to/libvirt/git/src
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      60c343f6
    • D
      Add pkg-config files for libvirt-qemu & libvirt-lxc · 65d8c92a
      Daniel P. Berrange 提交于
      For some reason there have never been pkg-config files created
      for the libvirt-qemu.so and libvirt-lxc.so libraries.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      65d8c92a
    • D
      Don't include @libs@ in libvirt.pc.in file · 1167751f
      Daniel P. Berrange 提交于
      The libvirt.pc file we install is ending up polluted with a
      load of compiler flags that should be private to the libvirt
      build. eg
      
      Libs: -L${libdir} -lvirt -ldl -O2 -g -pipe -Wall \
            -Wp,-D_FORTIFY_SOURCE=2 -fexceptions \
            -fstack-protector-strong --param=ssp-buffer-size=4 \
            -grecord-gcc-switches  -m64 -mtune=generic
      
      this is caused by including @libs@ in the Libs: line of the
      pkgconfig.pc.in file.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1167751f
    • M
      virnuma: Actually build huge page code · 9e72691b
      Michal Privoznik 提交于
      One of previous commits (e6258a33) tried to build the huge page code
      only on Linux since it's Linux centric indeed. But it failed miserably
      as it used 'WITH_LINUX' which is an automake conditional not a gcc
      one. In the sources we need to use __linux__.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      9e72691b
    • L
      qemu: parse -device virtio-balloon · ef016226
      Laine Stump 提交于
      There are no options to parse here other than the name of the device,
      and all three possible device names have the same prefix
      ("virtio-balloon" with "-ccw", "-pci", or "-device" appended), so the
      code is fairly simple. It has been implemented such that it will be
      easier to add handling for other -device entries that aren't otherwise
      recognized - just add another "else if (STRPREFIX(opts, ....)" clause.
      
      qemuParseCommandLineString() previously would always add a <memballoon
      model='virtio'/> to every result (the comments erroneously say that it
      is adding a <memballoon model='none'/>) This has been changed to add
      model='none', and 84 test case xml's updated accordingly (so that
      qemuxml2argvtest won't fail).
      
      Now that the memballoon device is properly parsed, we can safely add a
      test for properly ignoring -nodefconfig and -nodefaults. Rather than
      adding an entire new test case for this (and memballoon), we just
      randomly pick the clock-utc test and modify it slightly to fulfill the
      purpose.
      ef016226
    • J
      Report correct error in virNetDevTapCreate · f8a33815
      Ján Tomko 提交于
      ioctl returns -1, not the errno value
      f8a33815
    • J
      Do not call closedir with NULL argument · 10af0a19
      Ján Tomko 提交于
      Only three other callers possibly call closedir on a NULL argument.
      Even though these probably won't be used on FreeBSD where this crashes,
      let's be nice and only call closedir on an actual directory stream.
      10af0a19
    • J
      Fix invalid write in virNumaGetDistances · 9a2e523e
      Ján Tomko 提交于
      ==== Invalid write of size 4
      ====    at 0x52E678C: virNumaGetDistances (virnuma.c:479)
      ====    by 0x5396890: nodeCapsInitNUMA (nodeinfo.c:1796)
      ====    by 0x203C2B: virQEMUCapsInit (qemu_capabilities.c:960)
      ====  Address 0xe10a1e0 is 0 bytes after a block of size 0 alloc'd
      ====    at 0x4C2A6D0: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ====    by 0x52A10D6: virAllocN (viralloc.c:191)
      ====    by 0x52E674D: virNumaGetDistances (virnuma.c:470)
      ====    by 0x5396890: nodeCapsInitNUMA (nodeinfo.c:1796)
      ====    by 0x203C2B: virQEMUCapsInit (qemu_capabilities.c:960)
      9a2e523e
    • P
      util: numa: Stub out hugepage code on non-Linux platforms · e6258a33
      Peter Krempa 提交于
      The hugepage sizing and counting code gathers the information from sysfs
      and thus isn't portable. Stub it out for non-Linux so that we can report
      a better error. This patch also avoids calling sysinfo() on Mingw where
      it isn't supported.
      e6258a33
    • P
      util: numa: Catch readdir errors in virNumaGetPages · 00b2317a
      Peter Krempa 提交于
      Don't return possibly incomplete result if virDirRead fails.
      00b2317a
    • P
      tests: Fix syntax-check after cdd11151 · 42d75b44
      Peter Krempa 提交于
      makefile_conditionals
      tests/Makefile.am:293:endif
      maint.mk: match "if FOO" with "endif FOO" in Makefiles
      make: *** [sc_makefile_conditionals] Error 1
      42d75b44
    • P
      test: Disable storage test when FS backend isn't compiled in · cdd11151
      Peter Krempa 提交于
      'virstoragetest' accesses backing chains of files on local storage with
      the help of the storage driver. Disable the test on builds without the
      storage driver as the test is crashing otherwise.
      
      Reported by: Roman Bogorodskiy
      cdd11151
    • J
      Properly check the return value of CCWAddressAsString · 3fe9d75a
      Ján Tomko 提交于
      It returns NULL on failure. Checking if the negation of it
      is less than zero makes no sense. (Found by coverity after moving
      the code)
      
      In another case, the return value wasn't checked at all.
      3fe9d75a
  3. 21 6月, 2014 2 次提交
  4. 20 6月, 2014 17 次提交
  5. 19 6月, 2014 4 次提交
    • E
      virsh: fix broken code in freepages · 404bac14
      Eric Blake 提交于
      Commit 9e3efe53 broke the build under valgrind or clang, by writing
      8 bytes through an allocation of 4 bytes.  It also risks multiplication
      overflow when mallocing (that's a pervasive problem that needs an
      audit in the rest of the code, but we might as well fix this one while
      we are here), and had a typo.
      
      * tools/virsh-host.c (cmdFreepages): Avoid integer overflow and
      undefined behavior.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      404bac14
    • L
      interface: allow reordering of elements in xml · a341fc73
      Laine Stump 提交于
      The interface xml schema was written with strict rules about the
      ordering of the elements. This was never intentional, but just due to
      omission of <interleave> in the appropriate places. This patch just
      adds in <interleave> wherever there is more than one element, and
      re-indents everything else appropriately.
      a341fc73
    • J
      docs: fix some typos in formatdomain.html · d98a60c2
      Jincheng Miao 提交于
      In section "Block / character devices" of "Host device assignment",
      the description of hostdev element has some error:
      
      For a block device, the type should be "storage", not "block";
      For a character device, the type should be "misc", not "char".
      Signed-off-by: NJincheng Miao <jmiao@redhat.com>
      d98a60c2
    • M
      nodeinfo: Implement nodeGetFreePages · 38fa03f4
      Michal Privoznik 提交于
      And add stubs to other drivers like: lxc, qemu, uml and vbox.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      38fa03f4