1. 17 8月, 2016 1 次提交
    • A
      util: Make virStringArrayHasString() const-correct · 3edcf834
      Andrea Bolognani 提交于
      The first argument should be const char ** instead of
      char **, because this is a search function and as such it
      doesn't, and shouldn't, alter the haystack in any way.
      
      This change means we no longer have to cast arrays of
      immutable strings to arrays of mutable strings; we still
      have to do the opposite, though, but that's reasonable.
      3edcf834
  2. 16 8月, 2016 13 次提交
  3. 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
  4. 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
  5. 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
  6. 10 8月, 2016 14 次提交
  7. 09 8月, 2016 2 次提交