1. 23 6月, 2014 12 次提交
    • 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
  2. 21 6月, 2014 2 次提交
  3. 20 6月, 2014 17 次提交
  4. 19 6月, 2014 9 次提交
    • 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
    • M
      virsh: Expose virNodeGetFreePages · 9e3efe53
      Michal Privoznik 提交于
      The new API is exposed under 'freepages' command.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      9e3efe53
    • M
      Introduce virNodeGetFreePages · 34f2d031
      Michal Privoznik 提交于
      The aim of the API is to get information on number of free pages
      on the system. The API behaves similar to the
      virNodeGetCellsFreeMemory(). User passes starting NUMA cell, the
      count of nodes that he's interested in, pages sizes (yes,
      multiple sizes can be queried at once) and the counts are
      returned in an array.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      34f2d031
    • M
      virCaps: expose pages info · 02129b7c
      Michal Privoznik 提交于
      There are two places where you'll find info on page sizes. The first
      one is under <cpu/> element, where all supported pages sizes are
      listed. Then the second one is under each <cell/> element which refers
      to concrete NUMA node. At this place, the size of page's pool is
      reported. So the capabilities XML looks something like this:
      
      <capabilities>
      
        <host>
          <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid>
          <cpu>
            <arch>x86_64</arch>
            <model>Westmere</model>
            <vendor>Intel</vendor>
            <topology sockets='1' cores='1' threads='1'/>
            ...
            <pages unit='KiB' size='4'/>
            <pages unit='KiB' size='2048'/>
            <pages unit='KiB' size='1048576'/>
          </cpu>
          ...
          <topology>
            <cells num='4'>
              <cell id='0'>
                <memory unit='KiB'>4054408</memory>
                <pages unit='KiB' size='4'>1013602</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>4071072</memory>
                <pages unit='KiB' size='4'>1017768</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
                </cpus>
              </cell>
              ...
            </cells>
          </topology>
          ...
        </host>
      
        <guest/>
      
      </capabilities>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      02129b7c
    • M
      virnuma: Introduce pages helpers · 35f1095e
      Michal Privoznik 提交于
      For future work we need two functions that fetches total number of
      pages and number of free pages for given NUMA node and page size
      (virNumaGetPageInfo()).
      
      Then we need to learn pages of what sizes are supported on given node
      (virNumaGetPages()).
      
      Note that system page size is disabled at the moment as there's one
      issue connected. If you have a NUMA node with huge pages allocated the
      kernel would return the normal size of memory for that node. It
      basically ignores the fact that huge pages steal size from the system
      memory. Until we resolve this, it's safer to not confuse users and
      hence not report any system pages yet.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      35f1095e
    • M
      nodeinfo: Rename nodeGetFreeMemory to nodeGetMemory · 99a63aed
      Michal Privoznik 提交于
      For future work we want to get info for not only the free memory
      but overall memory size too. That's why the function must have
      new signature too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      99a63aed