1. 17 9月, 2014 2 次提交
  2. 16 9月, 2014 23 次提交
    • P
      qemu: time: Report errors if agent command fails · 98fd3b7f
      Peter Krempa 提交于
      Commit b606bbb4 broke reporting of errors when setting of guest time
      fails via the guest agent as the return value is not checked and later
      overwritten by the return value qemuMonitorRTCResetReinjection();
      
      Fix this by checking the return value before resetting the RTC
      reinjection.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1142294
      98fd3b7f
    • J
      Wire up the interface backend options · b20d39a5
      Ján Tomko 提交于
      Pass the user-specified tun path down when creating tap device
      when called from the qemu driver.
      
      Also honor the vhost device path specified by user.
      b20d39a5
    • J
      conf: add backend element to interfaces · af8b4a2e
      Ján Tomko 提交于
      For tuning the network, alternative devices
      for creating tap and vhost devices can be specified via:
      <backend tap='/dev/net/tun' vhost='/dev/net-vhost'/>
      af8b4a2e
    • J
      conf: remove redundant local variable · 0ece766b
      Ján Tomko 提交于
      Use just one int variable for all the FromString calls.
      0ece766b
    • J
      conf: split out virtio net driver formatting · fb78d1ce
      Ján Tomko 提交于
      Instead of checking upfront if the <driver> element will be needed
      in a big condition, just format all the attributes into a string
      and output the <driver> element if the string is not empty.
      fb78d1ce
    • J
      qemu: Need to check for capability before query · 76a81b1d
      John Ferlan 提交于
      Prior to trying the query-iothreads call - check if the qemu has
      the capability
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      76a81b1d
    • E
      network: check negative values in bridge queues · e6fc6646
      Erik Skultety 提交于
      We already are checking for negative value, reporting an error, but
      using wrong function and the check only succeeds when a value that
      cannot be converted to number successfully is encountered. This patch
      provides just a minor change in call of the right version
      of function virStrToLong.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1138539
      e6fc6646
    • H
      openvz: fixed two memory leaks on migration code · e3c626a6
      Hongbin Lu 提交于
      The first one occurs in openvzDomainMigratePrepare3Params() where in
      case no remote uri is given, the distant hostname is used. The name is
      obtained via virGetHostname() which require callers to free the
      returned value.
      The second leak lies in openvzDomainMigratePerform3Params(). There's a
      virCommand used later. However, at the beginning of the function
      virCheckFlags() is called which returns. So the command created was
      leaked.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e3c626a6
    • M
      virprocess: Extend list of platforms for setns wrapper · 735a15a6
      Michal Privoznik 提交于
      Currently, the setns() wrapper is supported only for x86_64 and i686
      which leaves us failing to build on other platforms like arm, aarch64
      and so on. This means, that the wrapper needs to be extended to those
      platforms and make to fail on runtime not compile time.
      
      The syscall numbers for other platforms was fetched using this
      command:
      
      kernel.git $ git grep "define.*__NR_setns" | grep -e arm -e powerpc -e s390
      arch/arm/include/uapi/asm/unistd.h:#define __NR_setns                   (__NR_SYSCALL_BASE+375)
      arch/arm64/include/asm/unistd32.h:#define __NR_setns 375
      arch/powerpc/include/uapi/asm/unistd.h:#define __NR_setns               350
      arch/s390/include/uapi/asm/unistd.h:#define __NR_setns          339
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      735a15a6
    • P
      util: storage: Fix qcow(2) header parser according to docs · 34e317cf
      Peter Krempa 提交于
      The backing store string location offset 0 determines that the file
      isn't present. The string size shouldn't be then checked:
      
      from qemu.git/docs/specs/qcow2.txt
      
      == Header ==
      
      The first cluster of a qcow2 image contains the file header:
      
      Byte  0 -  3:   magic
                      QCOW magic string ("QFI\xfb")
      
            4 -  7:   version
                      Version number (valid values are 2 and 3)
      
            8 - 15:   backing_file_offset
                      Offset into the image file at which the backing file name
                      is stored (NB: The string is not null terminated). 0 if the
                      image doesn't have a backing file.
      
           16 - 19:   backing_file_size
                      Length of the backing file name in bytes. Must not be
                      longer than 1023 bytes. Undefined if the image doesn't have
                      a backing file.         ^^^^^^^^^
      
      This patch intentionally leaves the backing file string size check in
      place in case a malformatted file would be presented to libvirt. Also
      according to the docs the string size is maximum 1023 bytes, thus this
      patch adds a check to verify that.
      
      I was also able to verify that the check was done the same way in the
      legacy qcow fromat (in qemu's code).
      34e317cf
    • J
      qemu: Fix call in qemuDomainSetNumaParamsLive for virCgroupNewIOThread · 82494cd6
      John Ferlan 提交于
      Found by inspection of the "i+1" change.  IOThreads are numbered 1..n
      thus the virCgroupNewIOThread needs to create a 1..n value not 0 based.
      82494cd6
    • J
      qemu_cgroup: Adjust spacing around incrementor · 500c91c5
      John Ferlan 提交于
      Change "i+1" to "i + 1"
      500c91c5
    • J
      qemu: Fix iothreads issue · b66c950f
      John Ferlan 提交于
      If there are no iothreads, then return from qemuProcessDetectIOThreadPIDs
      without error; otherwise, the following occurs:
      
      error: Failed to start domain $dom
      error: An error occurred, but the cause is unknown
      b66c950f
    • E
      cputune: allow interleaved xml · 7e8feed4
      Eric Blake 提交于
      I noticed this with the recent iothread pinning code, but the
      problem existed longer than that. The XML validation required
      users to supply <cputune> children in a strict order, even though
      there was no conceptual reason why they can't occur in any order.
      
      docs/ changes best viewed with -w
      
      * docs/schemas/domaincommon.rng (cputune): Add interleave.
      * tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreads.xml: Swap
      up order, copying canonical form...
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-iothreads.xml:
      ...here.
      * tests/qemuxml2xmltest.c (mymain): Mark the difference.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7e8feed4
    • J
      vircgroup: Fix broken builds without cgroups · e45f0d05
      John Ferlan 提交于
      I missed adding virCgroupNewIOThread to the !VIR_CGROUP_SUPPORTED
      
      Pushing as build breaker
      e45f0d05
    • L
      network: detect conflicting route even if it is the final entry · 22048ae6
      Laine Stump 提交于
      This is a folloup to commit 5f719596, which checks for a route
      conflicting with the standard libvirt default network subnet
      (192.168.122.0/24). It turns out that $() strips the trailing newline
      from the output of "ip route show", so there would be no match if the
      route we were looking for was the final line of output. This can be
      solved by adding ${nl} to the end of the output (just as we were
      already adding it at the beginning of the output).
      22048ae6
    • J
      domain_conf: Add iothreadpin to cputune · 938fb12f
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1101574
      
      Add an option 'iothreadpin' to the <cpuset> to allow for setting the
      CPU affinity for each IOThread.
      
      The iothreadspin will mimic the vcpupin with respect to being able to
      assign each iothread to a specific CPU, although iothreads ids start
      at 1 while vcpu ids start at 0. This matches the iothread naming scheme.
      938fb12f
    • J
      qemu: Allow pinning specific IOThreads to a CPU · 9bef96ec
      John Ferlan 提交于
      Modify qemuProcessStart() in order to allowing setting affinity to
      specific CPU's for IOThreads. The process followed is similar to
      that for the vCPU's.
      
      This involves adding a function to fetch the IOThread id's via
      qemuMonitorGetIOThreads() and adding them to iothreadpids[] list.
      Then making sure all the cgroup data has been properly set up and
      finally assigning affinity.
      9bef96ec
    • J
      qemu_cgroup: Introduce cgroup functions for IOThreads · 5f6ad32c
      John Ferlan 提交于
      In order to support cpuset setting, introduce qemuSetupCgroupIOThreadsPin
      and qemuSetupCgroupForIOThreads to mimic the existing Vcpu API's.
      
      These will support having an 'iotrhreadpin' element in the 'cpuset' in
      order to pin named IOThreads to specific CPU's. The IOThread pin names
      will follow the IOThread naming scheme starting at 1 (eg "iothread1")
      up through an including the def->iothreads value.
      5f6ad32c
    • J
      qemu_domain: Add niothreadpids and iothreadpids · 58690551
      John Ferlan 提交于
      Add new 'niothreadpids' and 'iothreadpids' to mimic the 'ncpupids' and
      'vcpupids' that already exist.
      58690551
    • J
      vircgroup: Introduce virCgroupNewIOThread · 3abb95ca
      John Ferlan 提交于
      Add virCgroupNewIOThread() to mimic virCgroupNewVcpu() except the naming
      scheme with use "iothread" rather than "vcpu".
      3abb95ca
    • J
      qemu: Issue query-iothreads and to get list of active IOThreads · 4cf6bfab
      John Ferlan 提交于
      Generate infrastructure and test to handle fetching the QMP
      IOThreads data.
      4cf6bfab
    • J
      virsh: Add iothread to 'attach-disk' · bc5a8090
      John Ferlan 提交于
      Add an iothread parameter to allow attaching to an IOThread, such as:
      
      virsh attach-disk $dom $source $target --live --config --iothread 2 \
           --targetbus virtio --driver qemu --subdriver raw  --type disk
      bc5a8090
  3. 15 9月, 2014 15 次提交
    • M
    • E
      network: check for invalid forward delay time · 3aa05241
      Erik Skultety 提交于
      When spanning tree protocol is allowed in bridge settings, forward delay
      value is set as well (default is 0 if omitted). Until now, there was no
      check for delay value validity. Delay makes sense only as a positive
      numerical value.
      
      Note: However, even if you provide positive  numerical value, brctl
      utility only uses values from range <2,30>, so the number provided can
      be modified (kernel most likely) to fall within this range.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1125764
      3aa05241
    • J
      qemu: Fix build breaker on printf directive · c29cad67
      John Ferlan 提交于
      %zu for size_t not %lu
      c29cad67
    • J
      daemon: Resolve Coverity FORWARD_NULL · 1f967758
      John Ferlan 提交于
      Coverity complains that the comparison:
      
        if (nfds && nfds > ((int)!!sock_path + (int)!!sock_path_ro))
      
      could mean 'sock_path' is NULL. Later in virNetSocketNewListenUNIX
      there's a direct dereference of path in the error path:
      
        if (path[0] != '@')
      
      A bit of sleuthing proves that upon entry to daemonSetupNetworking
      there is no way for 'sock_path' to be NULL since daemonUnixSocketPaths
      will set up 'sock_file' (although it may not set up 'sock_file_ro')
      in all 3 paths.
      
      Adjusted code to add ATTRIBUTE_NONNULL(3) on incoming path parameter and
      then fixup the comparison of nfds to be a comparison against 2 or 1
      depending on whether sock_path_ro is NULL or not.
      1f967758
    • J
      qemu: Resolve Coverity BAD_SIZEOF · 3a0002b5
      John Ferlan 提交于
      Coverity complains about the calculation of the buf & len within
      the PROBE macro.  So to quiet things down, do the calculation prior
      to usage in either write() or qemuMonitorIOWriteWithFD() calls and
      then have the PROBE use the calculated values - which works.
      3a0002b5
    • J
      Resolve Coverity CHECKED_RETURN · 07334ccb
      John Ferlan 提交于
      Coverity complained that checking the return of virDomainCreate()
      was not consistent amongst the callers - so added the return check
      to the objecteventtest.c and adjust the virt-login-shell to compare
      < 0 rather than just non zero for the failure condition.
      07334ccb
    • J
      virsh: Resolve Coverity DEADCODE · 0268a35d
      John Ferlan 提交于
      Coverity complains that on the first pass through the for loop that
      'params' cannot be true, thus the ternary setting to "&" cannot be
      done. Since we can only ever get to this point once, drop the ternary
      0268a35d
    • J
      domain_conf: Resolve Coverity COPY_PASTE_ERROR · 96aa6052
      John Ferlan 提交于
      Seems when commit id 'ea130e3b' added the checks to ensure each of
      the hard_limit, soft_limit, and swap_hard_limit wasn't set at
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED - a copy/paste error of using
      the 'hard_limit' for each comparison was done. Adjust the code.
      96aa6052
    • J
      virtime: Resolve Coverity DEADCODE · f26e6397
      John Ferlan 提交于
      Coverity complains that because of how 'offset' is initialized to
      0 (zero), the resulting math and comparison on rem is pointless.
      
      According to the origin commit id '3ec12898', the code is a
      replacement for gmtime(), but without the localtime() or GMT
      calculations - so just remove this code and add a comment
      indicating the removal
      f26e6397
    • J
      remote_driver: Resolve Coverity RESOURCE_LEAK · 9545d062
      John Ferlan 提交于
      Since 98b9acf5
      
      This was a false positive where Coverity was complaining that the
      remoteDeserializeTypedParameters() could allocate 'params', but
      none of the callers could return the allocated memory back to their
      caller since on input the param was passed by value. Additionally,
      the flow of the code was that if params was NULL on entry, then each
      function would return 'nparams' as the number of params entries the
      caller would need to allocate in order to call the function again
      with 'nparams' and 'params' being set.  By the time the deserialize
      routine was called params would have something.  For other callers
      where the 'params' was passed by reference as NULL since it's expected
      that the deserialize allocates the memory and then have that passed
      back to the original caller to dispose there was no Coverity issue.
      
      As it turns out Coverity didn't quite seem to understand the
      relationship between 'nparams' and 'params'; however, if the
      !userAllocated path of the deserialize code compared against
      limit in any manner, then the Coverity error went away which
      was quite strange, but useful.
      
      As it turns out one code path remoteDomainGetJobStats had a
      comparison against 'limit' while another remoteConnectGetAllDomainStats
      did not assuming that limit would be checked.  So I refactored the
      code a bit to cause the limit check to occur in deserialize for
      both conditions and then only made the check of current returned
      size against the incoming *nparams fail the non allocation case.
      This means the job code doesn't need to check the limit any more,
      while the stats code now does check the limit.
      
      Additionally, to help perhaps decipher which of the various
      callers to the deserialize code caused the failure - I used
      a #define to pass the __FUNCNAME__ of the caller along so that
      error messages could have something like:
      
      error: remoteConnectGetAllDomainStats: too many parameters '2' for nparams '0'
      error: Reconnected to the hypervisor
      
      (it's a contrived error just to show the funcname in the error)
      9545d062
    • L
      node_device_udev: Try harder to get human readable vendor:product · 3ef77a54
      Lubomir Rintel 提交于
      The manufacurer and product from USB device itself are usually not particularly
      useful -- they tend to be missing, or ugly (all-uppercase, padded with spaces,
      etc.). Prefer what's in the usb id database and fall back to descriptors only
      if the device is too new to be in database.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1138887
      3ef77a54
    • H
      add migration support for OpenVZ driver · 7e649c54
      Hongbin Lu 提交于
      This patch adds initial migration support to the OpenVZ driver,
      using the VIR_DRV_FEATURE_MIGRATION_PARAMS family of migration
      functions.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      7e649c54
    • M
      d00c6fd2
    • M
      aaaa2d56
    • M
      8035f2e6