1. 16 9月, 2014 20 次提交
    • 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
    • J
      vircgroup: Fix broken builds without cgroups · e45f0d05
      John Ferlan 提交于
      I missed adding virCgroupNewIOThread to the !VIR_CGROUP_SUPPORTED
      
      Pushing as build breaker
      e45f0d05
    • 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
  2. 15 9月, 2014 13 次提交
  3. 12 9月, 2014 7 次提交
    • E
      blockjob: allow finer bandwidth tuning for set speed · 0a6a6b1a
      Eric Blake 提交于
      We stupidly modeled block job bandwidth after migration
      bandwidth, which in turn was an 'unsigned long' and therefore
      subject to 32-bit vs. 64-bit interpretations.  To work around
      the fact that 10-gigabit interfaces are possible but don't fit
      within 32 bits, the original interface took the number scaled
      as MiB/sec.  But this scaling is rather coarse, and it might
      be nice to tune bandwidth finer than in megabyte chunks.
      
      Several of the block job calls that can set speed are fed
      through a common interface, so it was easier to adjust them all
      at once.  Note that there is intentionally no flag for the new
      virDomainBlockCopy; there, since the API already uses a 64-bit
      type always, instead of a possible 32-bit type, and is brand
      new, it was easier to just avoid scaling issues.  As with the
      previous patch that adjusted the query side (commit db33cc24),
      omitting the new flag preserves old behavior, and the
      documentation now mentions limits of what happens when a 32-bit
      machine is on either client or server side.
      
      * include/libvirt/libvirt.h.in (virDomainBlockJobSetSpeedFlags)
      (virDomainBlockPullFlags)
      (VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES)
      (VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES): New enums.
      * src/libvirt.c (virDomainBlockJobSetSpeed, virDomainBlockPull)
      (virDomainBlockRebase, virDomainBlockCommit): Document them.
      * src/qemu/qemu_driver.c (qemuDomainBlockJobSetSpeed)
      (qemuDomainBlockPull, qemuDomainBlockRebase)
      (qemuDomainBlockCommit, qemuDomainBlockJobImpl): Support new flag.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0a6a6b1a
    • E
      blockcopy: add qemu implementation of new tunables · eef91f94
      Eric Blake 提交于
      Upstream qemu 1.4 added some drive-mirror tunables not present
      when it was first introduced in 1.3.  Management apps may want
      to set these in some cases (for example, without tuning
      granularity down to sector size, a copy may end up occupying
      more bytes than the original because an entire cluster is
      copied even when only a sector within the cluster is dirty,
      although tuning it down results in more CPU time to do the
      copy).  I haven't personally needed to use the parameters, but
      since they exist, and since the new API supports virTypedParams,
      we might as well expose them.
      
      Since the tuning parameters aren't often used, and omitted from
      the QMP command when unspecified, I think it is safe to rely on
      qemu 1.3 to issue an error about them being unsupported, rather
      than trying to create a new capability bit in libvirt.
      
      Meanwhile, all versions of qemu from 1.4 to 2.1 have a bug where
      a bad granularity (such as non-power-of-2) gives a poor message:
      error: internal error: unable to execute QEMU command 'drive-mirror': Invalid parameter 'drive-virtio-disk0'
      
      because of abuse of QERR_INVALID_PARAMETER (which is supposed to
      name the parameter that was given a bad value, rather than the
      value passed to some other parameter).  I don't see that a
      capability check will help, so we'll just live with it (and it
      has since been improved in upstream qemu).
      
      * src/qemu/qemu_monitor.h (qemuMonitorDriveMirror): Add
      parameters.
      * src/qemu/qemu_monitor.c (qemuMonitorDriveMirror): Likewise.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONDriveMirror):
      Likewise.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDriveMirror):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainBlockCopyCommon): Likewise.
      (qemuDomainBlockRebase, qemuDomainBlockCopy): Adjust callers.
      * src/qemu/qemu_migration.c (qemuMigrationDriveMirror): Likewise.
      * tests/qemumonitorjsontest.c (qemuMonitorJSONDriveMirror): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eef91f94
    • E
      blockcopy: add qemu implementation of new API · e3f5f8ee
      Eric Blake 提交于
      The hard part of managing the disk copy is already coded; all
      this had to do was convert the XML and virTypedParameters into
      the internal representation.
      
      With this patch, all blockcopy operations that used the old
      API should also work via the new API.  Additional extensions,
      such as supporting the granularity tunable or a network rather
      than file destination, will be added as later patches.
      
      * src/qemu/qemu_driver.c (qemuDomainBlockCopy): New function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e3f5f8ee
    • E
      blockcopy: tweak how rebase calls into copy · e53ee6c1
      Eric Blake 提交于
      In order to implement the new virDomainBlockCopy, the existing
      block copy internal implementation needs to be adjusted.  The
      new function will parse XML into a storage source, and parse
      typed parameters into integers, then call into the same common
      backend.  For now, it's easier to keep the same implementation
      limits that only local file destinations are suported, but now
      the check needs to be explicit.  Similar to qemuDomainBlockJobImpl
      consuming 'vm', this code also consumes the caller's 'mirror'
      description of the destination.
      
      * src/qemu/qemu_driver.c (qemuDomainBlockCopy): Rename...
      (qemuDomainBlockCopyCommon): ...and adjust parameters.
      (qemuDomainBlockRebase): Adjust caller.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e53ee6c1
    • M
      virDomainUndefineFlags: Allow NVRAM unlinking · 273b6581
      Michal Privoznik 提交于
      When a domain is undefined, there are options to remove it's
      managed save state or snapshots. However, there's another file
      that libvirt creates per domain: the NVRAM variable store file.
      Make sure that the file is not left behind if the domain is
      undefined.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      273b6581
    • J
      libxl: Resolve Coverity CHECKED_RETURN · 245134fc
      John Ferlan 提交于
      Add a check of the return for virDomainHostdevInsert() like every
      other call.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      245134fc
    • J
      qemu: Resolve Coverity FORWARD_NULL · 78fbc79d
      John Ferlan 提交于
      If we end up at the cleanup lable before we've VIR_EXPAND_N the list,
      then calling virQEMUCapsFreeStringList() with a NULL proplist could
      theoretically deref proplist if nproplist was set. Coverity doesn't
      seem to acknowledge the relationship between proplist and nproplist
      assuming in virQEMUCapsFreeStringList that nproplist could be at
      least 1 and thus have a null deref.  It only seems to follow the
      NULL proplist.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      78fbc79d