1. 16 8月, 2016 8 次提交
    • J
      conf: report an error message for non-existing USB hubs · ef66bd5d
      Ján Tomko 提交于
      If any of the devices referenced a USB hub that does not exist,
      defining the domain would either fail with:
      error: An error occurred, but the cause is unknown
      (if only the last hub in the path is missing)
      or crash.
      
      Return a proper error instead of crashing.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1367130
      ef66bd5d
    • J
      conf: free the ports array of a USB hub · d49f6853
      Ján Tomko 提交于
      The array needs to be freed too, not just its members.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1366097
      d49f6853
    • P
      qemu: setcpus: Report better errors · e96041ff
      Peter Krempa 提交于
      Mention whether it was the live or persistent definition which caused an
      error reported and explicitly error out in case when attempting to set
      maximum vcpu count for a live domain.
      e96041ff
    • D
      lxc: don't try to reference NULL when mounting filesystems · 57487085
      Daniel P. Berrange 提交于
        <filesystem type='ram' accessmode='passthrough'>
          <source usage='524288' units='KiB'/>
          <target dir='/dev/shm'/>
        </filesystem>
      
      would lead to lxcContainerMountAllFS calling STRPREFIX
      on a NLL pointer because it failed to check if fs->src->path
      was non-NULL. This is a regression caused by
      
        commit da665fbd
        Author: Olga Krishtal <okrishtal@virtuozzo.com>
        Date:   Thu Jul 14 16:52:38 2016 +0300
      
          filesystem: adds possibility to use storage pool as fs source
      Signed-off-by: NOlga Krishtal <okrishtal@virtuozzo.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      57487085
    • D
      lxc: don't try to resolve a NULL path for filesystems · 81aa4385
      Daniel P. Berrange 提交于
        <filesystem type='ram' accessmode='passthrough'>
          <source usage='524288' units='KiB'/>
          <target dir='/dev/shm'/>
        </filesystem>
      
      would lead to lxcContainerResolveSymlinks calling
      access(NULL) because it failed to check if fs->src->path
      was non-NULL. This is a regression caused by
      
        commit da665fbd
        Author: Olga Krishtal <okrishtal@virtuozzo.com>
        Date:   Thu Jul 14 16:52:38 2016 +0300
      
          filesystem: adds possibility to use storage pool as fs source
      Signed-off-by: NOlga Krishtal <okrishtal@virtuozzo.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      81aa4385
    • M
      libxl_driver: Indent LIBXL_VBD_SECTOR_SIZE macro correctly · 2140e3da
      Michal Privoznik 提交于
      Because of change in caaa1bd3 this macro is no under
      #ifdef block. That means it needs to be re-intended correctly.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2140e3da
    • R
      tests: fix domaincapstest linking for libxl · da5dfd0e
      Roman Bogorodskiy 提交于
      Commit 11567cf6 added some libxl tests into domaincapstest and
      added libvirt_driver_libxl_impl.la to domaincapstest_LDADD.
      
      This causes link fail on systems without GNU regex implementation:
      
      gmake[2]: Entering directory '/usr/home/novel/code/libvirt/tests'
        CCLD     domaincapstest
        ../src/.libs/libvirt_driver_libxl_impl.a(libvirt_driver_libxl_impl_la-libxl_capabilities.o):
        In function `libxlMakeCapabilities':
        libxl/libxl_capabilities.c:(.text+0x6b2): undefined reference to
        `rpl_regcomp'
        libxl/libxl_capabilities.c:(.text+0x6d0): undefined reference to
        `rpl_regerror'
        libxl/libxl_capabilities.c:(.text+0x803): undefined reference to
        `rpl_regexec'
        libxl/libxl_capabilities.c:(.text+0xa58): undefined reference to
        `rpl_regfree'
        clang-3.8: error: linker command failed with exit code 1 (use -v to
        see invocation)
      
      This happens because on these system it tries to use gnulib's builtin
      regex implementation, but doesn't link to gnulib.
      
      Fix by adding $(GNULIB_LIBS) along with libvirt_driver_libxl_impl.la to
      domaincapstest_LDADD.
      da5dfd0e
    • R
      libxl: fix unused functions · caaa1bd3
      Roman Bogorodskiy 提交于
      Commit eee7bd4e introduced two functions: libxlDiskPathToID and
      libxlDiskSectorSize.
      
      However, as they're used only by code under #ifdef __linux__,
      on non-Linux platforms it results in errors similar to this:
      
       CC       libxl/libvirt_driver_libxl_impl_la-libxl_driver.lo
      libxl/libxl_driver.c:5263:1: error: unused function 'libxlDiskPathToID' [-Werror,-Wunused-function]
      libxlDiskPathToID(const char *virtpath)
      ^
      libxl/libxl_driver.c:5312:1: error: unused function 'libxlDiskSectorSize' [-Werror,-Wunused-function]
      libxlDiskSectorSize(int domid, int devno)
      ^
      2 errors generated.
      
      Fix that by moving these functions under the #ifdef __linux__ block.
      caaa1bd3
  2. 15 8月, 2016 4 次提交
    • J
      Introduce node device update event as top level event · 43a6b37b
      Jovanka Gulicoska 提交于
      This event is emitted when a nodedev XML definition is updated,
      like when cdrom media is changed in a cdrom block device.
      
      Also includes node device update event implementation for udev
      backend, virsh nodedev-event support, and event-test support
      43a6b37b
    • J
      virsh: Fix core for cmdSecretGetValue · 18701e9d
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1366611
      
      When commit id 'cb2e3e50' reworked the cmdSecretGetValue call to use
      VIR_DISPOSE_STRING for base64, it neglected to initialize the base64
      value to NULL since the cleanup: label could be reached prior to the
      base64 value being set or not.  This resulted in a core dump, adding
      the initialization will avoid the issue.
      18701e9d
    • P
      qemu_command: don't modify heads for graphics device · ef11e770
      Pavel Hrdina 提交于
      Setting heads to 0 in case that *max_outputs* is not supported while building
      command line doesn't have any real effect.  It only removes *heads* attribute
      from live XML, but after restarting libvirt the default value is restored.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      ef11e770
    • M
      virschematest: Make sure that validator is initialized · cba18f8a
      Michal Privoznik 提交于
      It may happen that a developer wants to run just a specific
      subset of tests:
      
      tests $ VIR_TEST_RANGE=22 ../run ./virschematest
      
      This now fails miserably:
      
          ==6840== Invalid read of size 8
          ==6840==    at 0x4F397C0: virXMLValidatorValidate (virxml.c:1216)
          ==6840==    by 0x402B72: testSchemaFile (virschematest.c:53)
          ==6840==    by 0x403737: virTestRun (testutils.c:180)
          ==6840==    by 0x402CF5: testSchemaDir (virschematest.c:98)
          ==6840==    by 0x402EB1: testSchemaDirs (virschematest.c:131)
          ==6840==    by 0x40314D: mymain (virschematest.c:194)
          ==6840==    by 0x4051AF: virTestMain (testutils.c:982)
          ==6840==    by 0x4035A9: main (virschematest.c:217)
          ==6840==  Address 0x10 is not stack'd, malloc'd or (recently) free'd
      
      Problem is, we are trying to do two types of tests here: validate
      RNG schema itself, and validate XML files against RNG schemas.
      And the latter tries to re-use a resource allocated in the
      former. Therefore if the former is skipped (due to
      VIR_TEST_RANGE) we have to allocate the resource manually.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cba18f8a
  3. 13 8月, 2016 1 次提交
    • J
      cpu_x86: fix libvirtd crash when host cpu vendor is not available · 541e9ae6
      Jim Fehlig 提交于
      When starting a guest and copying host vendor cpuid to the guest
      cpu, libvirtd would crash if the host cpu contained a NULL vendor
      field. Avoid the crash by checking for a valid vendor in the host
      cpu before copying the cpuid to the guest cpu.
      
      For completeness, here is a backtrace from the crash
      
      (gdb) bt
      f0  0x00007ffff739bf33 in x86DataCpuid (cpuid=0x8, cpuid=0x8,
          data=data@entry=0x7fffb800ee78) at cpu/cpu_x86.c:287
      f1  virCPUx86DataAddCPUID (data=data@entry=0x7fffb800ee78, cpuid=0x8)
          at cpu/cpu_x86.c:355
      f2  0x00007ffff739ef47 in x86Compute (host=<optimized out>, cpu=0x7fffb8000cc0,
          guest=0x7fffecca7348, message=<optimized out>) at cpu/cpu_x86.c:1580
      f3  0x00007fffd2b38e53 in qemuBuildCpuModelArgStr (migrating=false,
          hasHwVirt=<synthetic pointer>, qemuCaps=0x7fffb8001040, buf=0x7fffecca7360,
          def=0x7fffc400ce20, driver=0x1c) at qemu/qemu_command.c:6283
      f4  qemuBuildCpuCommandLine (cmd=cmd@entry=0x7fffb8002f60,
          driver=driver@entry=0x7fffc80882c0, def=def@entry=0x7fffc400ce20,
          qemuCaps=qemuCaps@entry=0x7fffb8001040, migrating=<optimized out>)
          at qemu/qemu_command.c:6445
      (gdb) f2
      (gdb) p *host_model
      $23 = {name = 0x7fffb800ec50 "qemu64", vendor = 0x0, signature = 0, data = {
          len = 2, data = 0x7fffb800e720}}
      541e9ae6
  4. 12 8月, 2016 5 次提交
    • A
      qemu: command: Simplify USB controller model selection · f257a4ad
      Andrea Bolognani 提交于
      Since we now pick the default USB controller model when parsing
      the guest XML, we can get rid of some duplicated code so that
      the default model selection happens in one place only.
      
      Add some comments as well.
      f257a4ad
    • A
      qemu: domain: Drop piix3-ohci controller for migration · 31de0fab
      Andrea Bolognani 提交于
      Now that the default USB controller model is explicit rather
      than implicit for i440fx machines, we have to tweak the
      conditions for dropping it in order to keep migration towards
      libvirt <= 0.9.4 working.
      31de0fab
    • A
      qemu: domain: Reflect USB controller model in guest XML · f55eaccb
      Andrea Bolognani 提交于
      When the user doesn't specify any model for a USB controller,
      we use an architecture-dependent default, but we don't reflect
      it in the guest XML.
      
      Pick the default USB controller model when parsing the guest
      XML instead of when creating the QEMU command line, so that
      our choice is saved back to disk.
      f55eaccb
    • M
      virschematest: Initialize @data · f87cc927
      Michal Privoznik 提交于
      ==8630== Invalid read of size 8
      ==8630==    at 0x4EA4F0F: virFree (viralloc.c:582)
      ==8630==    by 0x4F398F0: virXMLValidatorFree (virxml.c:1257)
      ==8630==    by 0x40305C: mymain (virschematest.c:191)
      ==8630==    by 0x405159: virTestMain (testutils.c:982)
      ==8630==    by 0x403553: main (virschematest.c:215)
      ==8630==  Address 0xcd72243 is 131 bytes inside a block of size 177 free'd
      ==8630==    at 0x4C2B1F0: free (vg_replace_malloc.c:473)
      ==8630==    by 0x4EA4F19: virFree (viralloc.c:582)
      ==8630==    by 0x4ED0973: virFindFileInPath (virfile.c:1646)
      ==8630==    by 0x405149: virTestMain (testutils.c:980)
      ==8630==    by 0x403553: main (virschematest.c:215)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f87cc927
    • M
      schema: Don't validate paths · c4b92f1a
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1353296
      
      On UNIX like systems there are no constraints on what characters
      can be in file/dir names (except for NULL, obviously). Moreover,
      some values that we think of as paths (e.g. disk source) are not
      necessarily paths at all. For instance, some hypervisors take
      that as an arbitrary identifier and corresponding file is then
      looked up by hypervisor in its table. Instead of trying to fix
      our regular expressions (and forgetting to include yet another
      character there), lets drop the validation completely.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c4b92f1a
  5. 10 8月, 2016 14 次提交
  6. 09 8月, 2016 3 次提交
  7. 08 8月, 2016 3 次提交
    • M
      docs: Distribute subsite.xsl · e396de03
      Michal Privoznik 提交于
      So, I've ran into very interesting problem lately. When doing the
      following, I've encountered an error:
      
        libvirt.git $ make dist && tar -xJf libvirt-2.2.0.tar.xz && \
                      cd libvirt-2.2.0 && ./configure && \
                      rm docs/formatdomain.html && make -C docs
      
        make: Entering directory 'docs'
        make: *** No rule to make target 'formatdomain.html', needed by 'web'.  Stop.
        make: Leaving directory 'docs'
      
      I had no idea what was going on, so I've nailed down the commit
      that "broke it" via running git-bisect. It was this one:
      7659bd92. But that shed no more light until I realized
      that the commit might actually just exposed a problem we had. And
      guess what - I've nailed it down. Of course we are not
      distributing subsite.xsl that's why make prints error message.
      Very misleading one I must say.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e396de03
    • M
      virsystemd: Fix error check · cdf06553
      Marc Hartmayer 提交于
      Commit b3e4401d introduced a check to ignore an error if the guest
      is already terminated. However the check accidentally compared
      error.code with VIR_ERR_ERROR, which is an error level, not an error
      code. Because of this, almost every error got silently ignored.
      
      Fixes: b3e4401d ("systemd: don't report an error if the guest is
      already terminated")
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      cdf06553
    • K
      nsslinktest: also build virAtomic.h · 7e1ca80d
      Kai Kang 提交于
      When build for architecture that don't use gcc atomic ops but pthread,
      it fails to build for armel:
      
      | ../tools/nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virobject.o): In function `virClassNew':
      | /buildarea2/kkang/builds/qemuarm-Aug03/bitbake_build/tmp/work/armv5e-wrs-linux-gnueabi/libvirt/1.3.5-r0/build/src/../../libvirt-1.3.5/src/util/virobject.c:153: undefined reference to `virAtomicLock'
      | ../tools/nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virobject.o): In function `virObjectNew':
      | /buildarea2/kkang/builds/qemuarm-Aug03/bitbake_build/tmp/work/armv5e-wrs-linux-gnueabi/libvirt/1.3.5-r0/build/src/../../libvirt-1.3.5/src/util/virobject.c:205: undefined reference to `virAtomicLock'
      | ../tools/nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virobject.o): In function `virObjectUnref':
      | /buildarea2/kkang/builds/qemuarm-Aug03/bitbake_build/tmp/work/armv5e-wrs-linux-gnueabi/libvirt/1.3.5-r0/build/src/../../libvirt-1.3.5/src/util/virobject.c:277: undefined reference to `virAtomicLock'
      | ../tools/nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virobject.o): In function `virObjectRef':
      | /buildarea2/kkang/builds/qemuarm-Aug03/bitbake_build/tmp/work/armv5e-wrs-linux-gnueabi/libvirt/1.3.5-r0/build/src/../../libvirt-1.3.5/src/util/virobject.c:298: undefined reference to `virAtomicLock'
      | collect2: error: ld returned 1 exit status
      
      It is similar with:
      
      http://libvirt.org/git/?p=libvirt.git;a=commit;h=12dc729Signed-off-by: NKai Kang <kai.kang@windriver.com>
      7e1ca80d
  8. 07 8月, 2016 2 次提交