1. 04 5月, 2015 4 次提交
  2. 01 5月, 2015 2 次提交
  3. 30 4月, 2015 6 次提交
  4. 29 4月, 2015 11 次提交
  5. 28 4月, 2015 17 次提交
    • M
    • M
      922563e7
    • Z
      tests: free ChardevInfo correctly in qemumonitorjsontest · e6bb6220
      Zhang Bo 提交于
      The free callback should be qemuMonitorChardevInfoFree rather
      than just 'free' when virHashCreate'ing the chardevInfo hash.
      
      ==29959== 24 bytes in 2 blocks are definitely lost in loss record 19 of 53
      ==29959==    at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==29959==    by 0xB95C679: strdup (in /lib64/libc-2.20.so)
      ==29959==    by 0x63C6546: virStrdup (virstring.c:709)
      ==29959==    by 0x4805ED: qemuMonitorJSONExtractChardevInfo (qemu_monitor_json.c:3429)
      ==29959==    by 0x4807A5: qemuMonitorJSONGetChardevInfo (qemu_monitor_json.c:3479)
      ==29959==    by 0x434AEC: testQemuMonitorJSONqemuMonitorJSONGetChardevInfo (qemumonitorjsontest.c:1824)
      ==29959==    by 0x436F2F: virtTestRun (testutils.c:211)
      ==29959==    by 0x436932: mymain (qemumonitorjsontest.c:2404)
      ==29959==    by 0x4382EA: virtTestMain (testutils.c:863)
      ==29959==    by 0x436B27: main (qemumonitorjsontest.c:2423)
      Signed-off-by: NZhang Bo <oscar.zhangbo@huawei.com>
      Signed-off-by: NZhou Yimin <zhouyimin@huawei.com>
      e6bb6220
    • Z
      qemu: make qemuMonitorChardevInfoFree non-static · 6f5d29f4
      Zhang Bo 提交于
      It would be used in qemumonitorjsontest, thus we make it non-static.
      Signed-off-by: NZhang Bo <oscar.zhangbo@huawei.com>
      Signed-off-by: NZhou Yimin <zhouyimin@huawei.com>
      6f5d29f4
    • C
      storage: fs: Ignore volumes that fail to open with EACCESS/EPERM · 56476f6a
      Cole Robinson 提交于
      Trying to use qemu:///session to create a storage pool pointing at
      /tmp will usually fail with something like:
      
      $ virsh pool-start tmp
      error: Failed to start pool tmp
      error: cannot open volume '/tmp/systemd-private-c38cf0418d7a4734a66a8175996c384f-colord.service-kEyiTA': Permission denied
      
      If any volume in an FS pool can't be opened by the daemon, the refresh
      fails, and the pool can't be used.
      
      This causes pain for virt-install/virt-manager though. Imaging a user
      downloads a disk image to /tmp. virt-manager wants to import /tmp as
      a storage pool, so we can detect what disk format it is, and set the
      XML correctly. However this case will likely fail as explained above.
      
      Change the logic here to skip volumes that fail to open. This could
      conceivably cause user complaints along the lines of 'why doesn't
      libvirt show $ROOT-OWNED-VOLUME-FOO', but figuring that currently
      the pool won't even startup, I don't think there are any current
      users that care about that case.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1103308
      56476f6a
    • C
      storage: If driver startup state syncing fails, delete statefile · 65fc8246
      Cole Robinson 提交于
      If you end up with a state file for a pool that no longer starts up
      or refreshes correctly, the state file is never removed and adds
      noise to the logs everytime libvirtd is started.
      
      If the initial state syncing fails, delete the statefile.
      65fc8246
    • C
      storage: Break out storageDriverLoadPoolState · af9dc75c
      Cole Robinson 提交于
      Will simplify a future patch
      af9dc75c
    • C
      storage: Don't leave stale state file if pool startup fails · c180a3dc
      Cole Robinson 提交于
      After pool startup we call refreshPool(). If that fails, we leave
      a stale pool state file hanging around.
      
      Hit this trying to create a pool with qemu:///session containing
      root owned files.
      c180a3dc
    • C
      storage: Fix autostart dir for qemu:///session · b29aff32
      Cole Robinson 提交于
      b29aff32
    • J
      qemu: Remove need for qemuMonitorIOThreadInfoFree · b515339f
      John Ferlan 提交于
      Replace with just VIR_FREE.
      b515339f
    • J
      qemu: qemuProcessDetectIOThreadPIDs invert checks · 69b16513
      John Ferlan 提交于
      If we received zero iothreads from the monitor, but were perhaps
      expecting to receive something, then the code was skipping the check
      to ensure what's in the monitor matches our expectations.  So invert
      the checks to check that what we get back matches expectations and
      then check there are zero iothreads returned.
      69b16513
    • J
      qemu: Remove need for qemuDomainParseIOThreadAlias · 4c2ca566
      John Ferlan 提交于
      Rather than have a separate routine to parse the alias of an iothread
      returned from qemu in order to get the iothread_id value, parse the alias
      when returning and just return the iothread_id in qemuMonitorIOThreadInfoPtr
      
      This set of patches removes the function, changes the "char *name" to
      "unsigned int" and handles all the fallout.
      4c2ca566
    • J
      conf: Resolve some Coverity errors · e505591e
      John Ferlan 提交于
      Resolve some Coverity errors with IOThread changes
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      e505591e
    • R
      conf: explicitly initialize 'cpumask' variable · fb9da19e
      Roman Bogorodskiy 提交于
      Build with clang fails with:
      
        CC       conf/libvirt_conf_la-domain_conf.lo
        conf/domain_conf.c:13377:9: error: variable 'cpumask' is used
        uninitialized whenever 'if' condition is true
        [-Werror,-Wsometimes-uninitialized]
            if (!(tmp = virXMLPropString(node, "cpuset"))) {
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      and many other similar errors regarding the 'cpuset' variable.
      
      Fix by explicitly initializing it with NULL.
      fb9da19e
    • L
      network: check newDef for used bridge names in addition to def · 06313277
      Laine Stump 提交于
      If someone has updated a network to change its bridge name, but the
      network is still active (so that bridge name hasn't taken effect yet),
      we still want to disallow another network from taking that new name.
      06313277
    • L
      network: check for bridge name conflict with existing devices · 37b8bc6f
      Laine Stump 提交于
      Since some people use the same naming convention as libvirt for bridge
      devices they create outside the context of libvirt, it is much nicer
      if we check for those devices when looking for a bridge device name to
      auto-assign to a new network.
      37b8bc6f
    • L
      network: move auto-assign of bridge name from XML parser to net driver · a28d3e48
      Laine Stump 提交于
      We already check that any auto-assigned bridge device name for a
      virtual network (e.g. "virbr1") doesn't conflict with the bridge name
      for any existing libvirt network (via virNetworkSetBridgeName() in
      conf/network_conf.c).
      
      We also want to check that the name doesn't conflict with any bridge
      device created on the host system outside the control of libvirt
      (history: possibly due to the ploriferation of references to libvirt's
      bridge devices in HOWTO documents all around the web, it is not
      uncommon for an admin to manually create a bridge in their host's
      system network config and name it "virbrX"). To add such a check to
      virNetworkBridgeInUse() (which is called by virNetworkSetBridgeName())
      we would have to call virNetDevExists() (from util/virnetdev.c); this
      function calls ioctl(SIOCGIFFLAGS), which everyone on the mailing list
      agreed should not be done from an XML parsing function in the conf
      directory.
      
      To remedy that problem, this patch removes virNetworkSetBridgeName()
      from conf/network_conf.c and puts an identically functioning
      networkBridgeNameValidate() in network/bridge_driver.c (because it's
      reasonable for the bridge driver to call virNetDevExists(), although
      we don't do that yet because I wanted this patch to have as close to 0
      effect on function as possible).
      
      There are a couple of inevitable changes though:
      
      1) We no longer check the bridge name during
         virNetworkLoadConfig(). Close examination of the code shows that
         this wasn't necessary anyway - the only *correct* way to get XML
         into the config files is via networkDefine(), and networkDefine()
         will always call networkValidate(), which previously called
         virNetworkSetBridgeName() (and now calls
         networkBridgeNameValidate()). This means that the only way the
         bridge name can be unset during virNetworkLoadConfig() is if
         someone edited the config file on disk by hand (which we explicitly
         prohibit).
      
      2) Just on the off chance that somebody *has* edited the file by hand,
         rather than crashing when they try to start their malformed
         network, a check for non-NULL bridge name has been added to
         networkStartNetworkVirtual().
      
         (For those wondering why I don't instead call
         networkValidateBridgeName() there to set a bridge name if one
         wasn't present - the problem is that during
         networkStartNetworkVirtual(), the lock for the network being
         started has already been acquired, but the lock for the network
         list itself *has not* (because we aren't adding/removing a
         network). But virNetworkBridgeInuse() iterates through *all*
         networks (including this one) and locks each network as it is
         checked for a duplicate entry; it is necessary to lock each network
         even before checking if it is the designated "skip" network because
         otherwise some other thread might acquire the list lock and delete
         the very entry we're examining. In the end, permitting a setting of
         the bridge name during network start would require that we lock the
         entire network list during any networkStartNetwork(), which
         eliminates a *lot* of parallelism that we've worked so hard to
         achieve (it can make a huge difference during libvirtd startup). So
         rather than try to adjust for someone playing against the rules, I
         choose to instead give them the error they deserve.)
      
      3) virNetworkAllocateBridge() (now removed) would leak any "template"
         string set as the bridge name. Its replacement
         networkFindUnusedBridgeName() doesn't leak the template string - it
         is properly freed.
      a28d3e48