1. 01 6月, 2015 2 次提交
  2. 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
  3. 28 5月, 2015 5 次提交
  4. 27 5月, 2015 6 次提交
  5. 26 5月, 2015 9 次提交
    • J
      qemu: Add libvirt version check to refresh capabilities algorithm · a14eff38
      John Ferlan 提交于
      Rather than an algorithm based solely on libvirtd ctime to refresh the
      capabilities add the element of the libvirt build version into the equation.
      Since that version wouldn't be there prior to this code being run - don't
      fail on reading the capabilities if not found. In this case, the cache
      will always be rebuilt when a new libvirt version is installed.
      a14eff38
    • J
      qemu: Force capabilities cache refresh if libvirtd date is different · 0b4211f9
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1195882
      
      Original commit id 'cbde3589' indicates that the cache file would be
      discarded if either the QEMU binary or libvirtd 'ctime' changes; however,
      the code only discarded if the QEMU binary time didn't match or if the
      new libvirtd ctime was later than what created the cache file.
      
      Since many factors come into play with 'ctime' adjustments (including
      perhaps turning back the hands of time), change the logic to also force
      a refresh if the ctime of libvirt is different than what's in the cache.
      0b4211f9
    • J
      qemu: Resolve Coverity RESOURCE_LEAK · 2f9f7b5f
      John Ferlan 提交于
      Recent changes to the -M/--machine processing code in qemuParseCommandLine
      caused Coverity to determine there was a possible resource leak with how
      the 'list' is managed. Rather than try to add virStringFreeList calls
      everywhere - just promote list to the top of the variables and free it
      within the error processing code. Also required a couple of other tweaks
      in order to avoid double free's.
      2f9f7b5f
    • J
      conf: Resolve Coverity NEGATIVE_RETURNS · c214f56a
      John Ferlan 提交于
      Commit id '73eda710' added virDomainKeyWrapDefParseXML which uses
      virXPathNodeSet, but does not handle a -1 return thus causing a possible
      loop condition exit problem later when the return value is used.
      
      Change the logic to return the value from virXPathNodeSet if <= 0
      c214f56a
    • C
      storage: fs: Only force directory permissions if required · db1140f1
      Cole Robinson 提交于
      Only set directory permissions at pool build time, if:
      
      - User explicitly requested a mode via the XML
      - The directory needs to be created
      - We need to do the crazy NFS root-squash workaround
      
      This allows qemu:///session to call build on an existing directory
      like /tmp.
      db1140f1
    • C
      conf: storage: Don't emit empty <permissions> block · 42dd6a99
      Cole Robinson 提交于
      42dd6a99
    • C
      storage: conf: Don't set any default <mode> in the XML · 7c2d65dd
      Cole Robinson 提交于
      The XML parser sets a default <mode> if none is explicitly passed in.
      This is then used at pool/vol creation time, and unconditionally reported
      in the XML.
      
      The problem with this approach is that it's impossible for other code
      to determine if the user explicitly requested a storage mode. There
      are some cases where we want to make this distinction, but we currently
      can't.
      
      Handle <mode> parsing like we handle <owner>/<group>: if no value is
      passed in, set it to -1, and adjust the internal consumers to handle
      it.
      7c2d65dd
    • M
      parallels: fix possible crash in case of errors in prlsdkLoadDomain · 55714f78
      Maxim Nestratov 提交于
      Cleanup code in prlsdkLoadDomain doesn't take into account the fact
      if private domain structure along with freeing function is assigned
      or not. In case it is, we shouldn't call it manually because
      virDomainObjListRemove calls it and frees pdom.
      Also, allocated def structure should be freed only if it's not
      assigned to domain. Otherwise it will be called twice: one time by
      virDomainObjListRemove and the second by prlsdkLoadDomain itself.
      Signed-off-by: NMaxim Nestratov <mnestratov@parallels.com>
      55714f78
    • M
      parallels: move up updating parameter in prlsdkLoadDomain · dc58e742
      Maxim Nestratov 提交于
      It is better to get all necessary parameters and check them on newly
      created configuration before actually creating a domain with them or
      applying them to an existing domain.
      Signed-off-by: NMaxim Nestratov <mnestratov@parallels.com>
      dc58e742
  6. 24 5月, 2015 5 次提交
    • J
      network: Resolve Coverity FORWARD_NULL · 38f0fc19
      John Ferlan 提交于
      To silence Coverity just add a 'p &&' in front of the check in
      networkFindUnusedBridgeName after the strchr() call.  Even though
      we know it's not possible to have strchr return NULL since the only
      way into the function is if there is a '%' in def->bridge or it's NULL.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      38f0fc19
    • J
      conf: Resolve Coverity FORWARD_NULL · 264965d9
      John Ferlan 提交于
      Even though it's been pointed out they are false positives:
      
      http://www.redhat.com/archives/libvir-list/2015-May/msg00301.html
      
      and
      
      http://www.redhat.com/archives/libvir-list/2015-May/msg00302.html
      
      these still show up as Coverity issues. In order to silence Coverity
      add an 'sa_assert' prior to check failure.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      264965d9
    • J
      storage: Resolve Coverity FORWARD_NULL · 2d0243f4
      John Ferlan 提交于
      Coverity points out it's possible for one of the virCommand{Output|Error}*
      API's to have not allocated 'output' and/or 'error' in which case the
      strstr comparison will cause a NULL deref
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      2d0243f4
    • R
      bhyve: fix build with gcc48 · fcac0cf7
      Roman Bogorodskiy 提交于
      Build with gcc 4.8 fails with:
      
      bhyve/bhyve_monitor.c: In function 'bhyveMonitorIO':
      bhyve/bhyve_monitor.c:51:18: error: missing initializer for field 'tv_sec' of 'const struct timespec' [-Werror=missing-field-initializers]
           const struct timespec zerowait = {};
      
      Explicitly initialize zerowait to fix the build.
      fcac0cf7
    • P
      Add missing XDR_FLAGS · dd42ff07
      Pavel Fedin 提交于
      Fixes build problems on x86_64-cygwin host for aarch64 target:
        CC       lxc/libvirt_driver_lxc_impl_la-lxc_monitor_protocol.lo
      In file included from lxc/lxc_monitor_protocol.c:7:0:
      lxc/lxc_monitor_protocol.h:9:21: fatal error: rpc/rpc.h: No such file or directory
      
        CC       rpc/libvirt_setuid_rpc_client_la-virnetmessage.lo
      In file included from rpc/virnetmessage.h:24:0,
                       from rpc/virnetmessage.c:26:
      rpc/virnetprotocol.h:9:21: fatal error: rpc/rpc.h: No such file or directory
      
        CC       lxc/libvirt_lxc-lxc_monitor_protocol.o
      In file included from lxc/lxc_monitor_protocol.c:7:0:
      lxc/lxc_monitor_protocol.h:9:21: fatal error: rpc/rpc.h: No such file or directory
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      dd42ff07
  7. 22 5月, 2015 2 次提交
    • L
      util: better error message after failure to initialize firewall backend · a9c53462
      Laine Stump 提交于
      If the firewalld backend wasn't available and libvirt decides to try
      setting up a "direct" backend, it checks for the presence of iptables,
      ip6tables, and ebtables. If they are not found, a message like this is logged:
      
        error : virFirewallValidateBackend:193 : direct firewall backend
                requested, but /usr/sbin/ip6tables is not available:
                No such file or directory
      
      But then at a later time if an attempt is made to use the virFirewall
      API, failure will be indicated with:
      
        error : virFirewallApply:936 : out of memory
      
      This patch changes virFirewallApply to first check if a firewall
      backend hadn't been successfully setup, and logs a slightly more
      informative message in that case:
      
        error : virFirewallApply:940 : internal error:
                Failed to initialize a valid firewall backend
      
      This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1223876
      a9c53462
    • L
      netdev: fail when setting up an SRIOV VF if PF is offline · 474523fa
      Laine Stump 提交于
      If an SRIOV PF is offline, the kernel won't complain if you set the
      mac address and vlan tag for a VF via this PF, and it will even let
      you assign the VF to a guest using PCI device assignment or macvtap
      passthrough. But in this case (the PF isn't online), the device won't
      be usable in the guest.
      
      Silently setting the PF online would solve the connectivity problem,
      but as pointed out by Dan Berrange, when an interface is set online
      with no associated config, the kernel will by default turn on IPv6
      autoconf, which could create unexpected security problems for the
      host. For this reason, this patch instead logs an error and fails the
      operation.
      
      This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=893738
      
      Originally filed against RHEL6, but present in every version of
      libvirt until today.
      474523fa