1. 03 6月, 2015 7 次提交
    • L
      qemu: Need to return status of RNG device removal · 731d9cf2
      Luyao Huang 提交于
      Commit id '862473fa' neglected to return the status from the
      qemuDomainRemoveRNGDevice call in qemuDomainRemoveDevice causing
      the function to always fail when receiving an RNG device unplug
      event. Additionally the domain status/state would not be updated
      in the processDeviceDeletedEvent path.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      731d9cf2
    • L
      audit: Audit number of iothreads at domain startup · 038a03c7
      Luyao Huang 提交于
      If the domain has IOThreads defined, then audit the number started
      at domain startup time.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      038a03c7
    • E
      build: silence ar warnings on rawhide · 2db6a447
      Eric Blake 提交于
      Newer binutils 'ar' has added an option 'D' for deterministic
      builds, and at least on rawhide, this option is enabled by default.
      But it conflicts with the 'u' optimization where the linker only
      modifies libraries based on file timestamps, but can result in
      different library ordering based on which files were touched last.
      Thus, it results in some noisy compilation, for every CCLD line:
      
        CCLD     libvirt_driver_qemu_impl.la
        ar: `u' modifier ignored since `D' is the default (see `U')
      
      Upstream automake has decided that defaulting ARFLAGS to 'cru' is
      no longer beneficial, and that switching the default to 'cr' will
      both silence the noise and not penalize modern build systems.
      
      https://lists.gnu.org/archive/html/automake-patches/2015-06/msg00000.html
      
      But rather than wait for newer automake to propagate to all systems
      that already have newer binutils, we might as well just use the new
      default ourselves, even on older platforms.
      
      * configure.ac: Default AR[_]FLAGS to 'cr', not 'cru'.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2db6a447
    • L
      util: report all address range errors in virSocketAddrGetRange() · 55ace7c4
      Laine Stump 提交于
      There are now many more reasons that virSocketAddrGetRange() could
      fail, so it is much more informative to report the error there instead
      of in the caller. (one of the two callers was previously assuming
      success, which is almost surely safe based on the parsing that has
      already happened to the config by that time, but it still is nicer to
      account for an error "just in case")
      
      Part of fix for: https://bugzilla.redhat.com/show_bug.cgi?id=985653
      55ace7c4
    • L
      network: cleanup range loop in networkDnsmasqConfContents · 198d503c
      Laine Stump 提交于
      This loop had automatic variable definitions mixed with code. This
      patch moves the definitions to the top of the function and puts
      cleanup for them at the bottom. No functional change.
      
      Part of fix for: https://bugzilla.redhat.com/show_bug.cgi?id=985653
      198d503c
    • L
      network: validate DHCP ranges are completely within defined network · 1e334a0a
      Laine Stump 提交于
      virSocketAddrGetRange() has been updated to take the network address
      and prefix, and now checks that both the start and end of the range
      are within that network, thus validating that the entire range of
      addresses is in the network. For IPv4, it also checks that ranges to
      not start with the "network address" of the subnet, nor end with the
      broadcast address of the subnet (this check doesn't apply to IPv6,
      since IPv6 doesn't have a broadcast or network address)
      
      Negative tests have been added to the network update and socket tests
      to verify that bad ranges properly generate an error.
      
      This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=985653
      1e334a0a
    • L
      test: fix IP address range failure test · 48e8b95d
      Laine Stump 提交于
      This was revealed when I made a cut-paste mistake in an upgrade to
      virSocketAddrGetRange(), leading to failure to check for the end
      address being outside of the defined network, but a negative test case
      that should have caught the error instead returned success.
      
      The problem was that testRange in sockettest.c was written so that
      when it expected a failure, even an "unexpected success" would be
      considered as an "expected failure" because of the way the check in
      testRange was done. testRange had this:
      
       if (gotsize < 0 || gotsize != size) {
           return pass ? -1 : 0;
       } else {
           return pass ? 0 : -1;
       }
      
      but all the tests that expected a failure give "-1" as the expected
      size. So in a case where we expect a failure, we would have pass ==
      false and size == -1. If virSocketAddrGetRange() was incorrectly
      *successful* (returned some positive number), then "gotsize != size"
      would be, e.g. "276 != -1", so we would take the if clause and, since
      pass == false, we would return 0 (success i.e. expected failure).
      
      The solution is that in the case where we expect failure, we should
      just ignore size - virSocketAddrGetRange() must return -1 in order for
      us to report "expected failure == success".
      
      Part of fix for: https://bugzilla.redhat.com/show_bug.cgi?id=985653
      48e8b95d
  2. 02 6月, 2015 14 次提交
  3. 01 6月, 2015 8 次提交
  4. 29 5月, 2015 11 次提交
    • J
      Allocate priv->vioserialaddrs unconditionally · 0a2581a1
      Ján Tomko 提交于
      When attempting to hotplug a virtio-serial console to a domain
      that had no virtio-serial controllers (not even those that
      are added by libvirt when some devices need them) at daemon startup,
      report a user-friendly error:
      
      error: Failed to attach device from console.xml
      error: internal error: no virtio-serial controllers are available
      
      instead of crashing the daemon:
      
      Process terminating with default action of signal 11 (SIGSEGV): dumping core
       Access not within mapped region at address 0x8
         at 0x531028F: virDomainVirtioSerialAddrNext (domain_addr.c:916)
         by 0x531028F: virDomainVirtioSerialAddrAssign (domain_addr.c:1029)
         by 0x1CBF68: qemuDomainAttachChrDevice (qemu_hotplug.c:1565)
         by 0x1BCD5E: qemuDomainAttachDeviceLive (qemu_driver.c:7997)
         by 0x1BCD5E: qemuDomainAttachDeviceFlags (qemu_driver.c:8743)
      
      Introduced in v1.2.14-30-g59033788.
      0a2581a1
    • J
      Properly free the xmlDocPtr when loading pool state · 5aa72904
      Ján Tomko 提交于
      Use xmlFreeDoc instead of plain xmlFree.
      
      4 bytes in 1 blocks are definitely lost in loss record 9 of 1,084
          at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
          by 0x70730D6: xmlStrndup (in /usr/lib64/libxml2.so.2.9.2)
          by 0x701E3DC: xmlNewDoc (in /usr/lib64/libxml2.so.2.9.2)
          by 0x70C39F8: xmlSAX2StartDocument (in /usr/lib64/libxml2.so.2.9.2)
          by 0x7017245: xmlParseDocument (in /usr/lib64/libxml2.so.2.9.2)
          by 0x7017606: xmlDoRead (in /usr/lib64/libxml2.so.2.9.2)
          by 0x5309DAD: virXMLParseHelper (virxml.c:742)
          by 0x5367584: virStoragePoolLoadState (storage_conf.c:1863)
      5aa72904
    • J
      libxl: support QXL video device · 75d650dc
      Jim Fehlig 提交于
      libxl recently gained support for QXL video device.  Support
      it in the libxl driver too.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      75d650dc
    • J
      libxl: support SPICE graphics for HVM domains · 6baf8814
      Jim Fehlig 提交于
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      6baf8814
    • J
      libxl: change reservedVNCPorts to reservedGraphicsPorts · 5a10fb1d
      Jim Fehlig 提交于
      A later change will use the PortAllocator for SPICE too.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      5a10fb1d
    • J
      libxl: populate build_info vfb in separate function · 09f2faf9
      Jim Fehlig 提交于
      For HVM domains, vfb info must be populated in the libxl_domain_build_info
      struct.  Currently this is done in the libxlMakeVfbList function, but IMO
      it would be cleaner to populate the build_info vfb in a separate
      libxlMakeBuildInfoVfb function.  libxlMakeVfbList would then handle only
      vfb devices, simiar to the other libxlMake<device>List functions.
      
      A future patch will extend libxlMakeBuildInfoVfb to support SPICE.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      09f2faf9
    • J
      storage: Fix problem with disk backend pool allocation calculation · 6839b08b
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1224018
      
      The disk pool recalculates the pool allocation, capacity, and available
      values each time through processing a newly created disk partition. This
      created an issue with the allocation setting since the code used is shared
      with the refresh path. Each path calls virStorageBackendDiskReadPartitions
      which initializes the pool values and then processes the partition table
      from the 'libvirt_parthelper' utility output with the only difference being
      create passes a specific volume to be processed while refresh pass a NULL
      indicating to process all volumes. That passed volume is check during the
      virStorageBackendDiskMakeVol call to see if the current partition described
      by the volume key already exists. If it exists, then no adjustments are
      made to the allocation and the next entry in the output is checked.
      
      For the create path this resulted in only the most recently created
      partition size would be accounted for in the 'allocation' setting. This
      patch thus checks whether the incoming volume is NULL before clearing
      the pool allocation value.
      6839b08b
    • J
      storage: Don't adjust pool alloc/avail values for disk backend · 48809204
      John Ferlan 提交于
      Commit id '2ac0e647' for https://bugzilla.redhat.com/show_bug.cgi?id=1206521
      was meant to be a generic check for the CreateVol, CreateVolFrom, and
      DeleteVol paths to check if the storage backend's changed the pool's view
      of allocation or available values.
      
      Unfortunately as it turns out this caused a side effect when the disk backend
      created an extended partition there would be no actual storage removed from
      the pool, thus the changes would not find any change in allocation or
      available and incorrectly update the pool values using the size of the
      extended partition. A subsequent refresh of the pool would reset the
      values appropriately.
      
      This patch modifies those checks in order to specifically not update the
      pool allocation and available for only the disk backend rather than be
      generic before and after checks.
      48809204
    • J
      Revert "storage: Don't duplicate efforts of backend driver" · 6727bfd7
      John Ferlan 提交于
      This reverts commit 2ac0e647.
      6727bfd7
    • L
      debug: assure NULLSTR() around all %s args in debug at top of public APIs · e983e625
      Laine Stump 提交于
      There are also a couple that were very uninformatively just logging
      the value of the pointer rather than the string itself:
      
      * the "name" arg to virNodeDeviceLookupByName()
      * wwnn and wwpn args to virNodeDeviceLookupSCSIHostByWWN()
      
      All char*'s that make sense should now have their contents logged
      rather than the pointer, and all %s args should now be inside
      NULLSTR().
      e983e625
    • L
      node_device: more informative error log when device isn't found · 06a18bc8
      Laine Stump 提交于
      In a couple of cases, the node device driver (and the test node device
      driver which likely copied it) was only logging "Node device not
      found" when it couldn't find the requested device. This patch changes
      those cases to log the name (and in the case when it's relevant, the
      wwnn and wwpn) as well.
      06a18bc8