1. 19 2月, 2015 3 次提交
    • M
      qemuProcessHandleBlockJob: Take status into account · 76c61cdc
      Michal Privoznik 提交于
      Upon BLOCK_JOB_COMPLETED event delivery, we check if the job has
      completed (in qemuMonitorJSONHandleBlockJobImpl()). For better image,
      the event looks something like this:
      
      "timestamp": {"seconds": 1423582694, "microseconds": 372666}, "event":
      "BLOCK_JOB_COMPLETED", "data": {"device": "drive-virtio-disk0", "len":
      8412790784, "offset": 409993216, "speed": 8796093022207, "type":
      "mirror", "error": "No space left on device"}}
      
      If "len" does not equal "offset" it's considered an error, and we can
      clearly see "error" field filled in. However, later in the event
      processing this case was handled no differently to case of job being
      aborted via separate API. It's time that we start differentiate these
      two because of the future work.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      76c61cdc
    • M
      qemuProcessHandleBlockJob: Set disk->mirrorState more often · c37943a0
      Michal Privoznik 提交于
      Currently, upon BLOCK_JOB_* event, disk->mirrorState is not updated
      each time. The callback code handling the events checks if a blockjob
      was started via our public APIs prior to setting the mirrorState.
      However, some block jobs may be started internally (e.g. during
      storage migration), in which case we don't bother with setting
      disk->mirror (there's nothing we can set it to anyway), or other
      fields. But it will come handy if we update the mirrorState in these
      cases too. The event wasn't delivered just for fun - we've started the
      job after all.
      
      So, in this commit, the mirrorState is set to whatever job status
      we've obtained. Of course, there are some actions on some statuses
      that we want to perform. But instead of if {} else if {} else {} ...
      enumeration, let's move to switch().
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c37943a0
    • P
      qemu: Exit job on error path of qemuDomainSetVcpusFlags() · 0df2f040
      Peter Krempa 提交于
      Commit e105dc98 moved some code but
      didn't adjust the jump labels so that the job would be terminated.
      0df2f040
  2. 17 2月, 2015 5 次提交
  3. 13 2月, 2015 2 次提交
  4. 12 2月, 2015 3 次提交
    • D
      qemu: do upfront check for vcpupids being null when querying pinning · 9358b63a
      Daniel P. Berrange 提交于
      The qemuDomainHelperGetVcpus attempted to report an error when the
      vcpupids info was NULL. Unfortunately earlier code would clamp the
      value of 'maxinfo' to 0 when nvcpupids was 0, so the error reporting
      would end up being skipped.
      
      This lead to 'virsh vcpuinfo <dom>' just returning an empty list
      instead of giving the user a clear error.
      9358b63a
    • D
      qemu: fix setting of VM CPU affinity with TCG · a103bb10
      Daniel P. Berrange 提交于
      If a previous commit I fixed the incorrect handling of vcpu pids
      for TCG mode QEMU:
      
        commit b07f3d82
        Author: Daniel P. Berrange <berrange@redhat.com>
        Date:   Thu Dec 18 16:34:39 2014 +0000
      
          Don't setup fake CPU pids for old QEMU
      
          The code assumes that def->vcpus == nvcpupids, so when we setup
          fake CPU pids for old QEMU with nvcpupids == 1, we cause the
          later code to read off the end of the array. This has fun results
          like sche_setaffinity(0, ...) which changes libvirtd's own CPU
          affinity, or even better sched_setaffinity($RANDOM, ...) which
          changes the affinity of a random OS process.
      
      The intent was that this would merely disable the ability to set
      per-vCPU affinity. It should still have been possible to set VM
      level host CPU affinity.
      
      Unfortunately, when you set  <vcpu cpuset='0-1'>4</vcpu>, the XML
      parser will internally take this & initialize an entry in the
      def->cputune.vcpupin array for every VCPU. IOW this is implicitly
      being treated as
      
        <cputune>
          <vcpupin cpuset='0-1' vcpu='0'/>
          <vcpupin cpuset='0-1' vcpu='1'/>
          <vcpupin cpuset='0-1' vcpu='2'/>
          <vcpupin cpuset='0-1' vcpu='3'/>
        </cputune>
      
      Even more fun, the faked cputune elements are hidden from view when
      querying the live XML, because their cpuset mask is the same as the
      VM default cpumask.
      
      The upshot was that it was impossible to set VM level CPU affinity.
      
      To fix this we must update qemuProcessSetVcpuAffinities so that it
      only reports a fatal error if the per-VCPU cpu mask is different
      from the VM level cpu mask.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a103bb10
    • M
  5. 11 2月, 2015 2 次提交
  6. 10 2月, 2015 10 次提交
  7. 06 2月, 2015 2 次提交
  8. 05 2月, 2015 1 次提交
  9. 03 2月, 2015 1 次提交
  10. 31 1月, 2015 7 次提交
    • P
      qemu: command: Don't combine old and modern NUMA node creation · b92a0037
      Peter Krempa 提交于
      Change done by commit f309db1f wrongly
      assumes that qemu can start with a combination of NUMA nodes specified
      with the "memdev" option and the appropriate backends, and the legacy
      way by specifying only "mem" as a size argument. QEMU rejects such
      commandline though:
      
      $ /usr/bin/qemu-system-x86_64 -S -M pc -m 1024 -smp 2 \
      -numa node,nodeid=0,cpus=0,mem=256 \
      -object memory-backend-ram,id=ram-node1,size=12345 \
      -numa node,nodeid=1,cpus=1,memdev=ram-node1
      qemu-system-x86_64: -numa node,nodeid=1,cpus=1,memdev=ram-node1: qemu: memdev option must be specified for either all or no nodes
      
      To fix this issue we need to check if any of the nodes requires the new
      definition with the backend and if so, then all other nodes have to use
      it too.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1182467
      b92a0037
    • P
      qemu: command: Refactor NUMA backend object formatting to use JSON objs · 8795adf7
      Peter Krempa 提交于
      With the new JSON to argv formatter we are now able to represent the
      memory backend definitions in the JSON object format that is reusable
      for monitor use (hotplug) and then convert it into the shell string.
      This will avoid having two separate instances of the same code that
      would create the different formats.
      
      Previous refactors now allow to make this step without changes to the
      test suite.
      8795adf7
    • P
      qemu: command: Switch to bytes when formatting size for memory backends · b50b4ef3
      Peter Krempa 提交于
      QEMU's command line visitor as well as the JSON interface take bytes by
      default for memory object sizes. Convert mebibytes to bytes so that we
      can later refactor the existing code for hotplug purposes.
      b50b4ef3
    • P
      qemu: command: Unify values for boolean values when formating memory backends · a47174c5
      Peter Krempa 提交于
      QEMU's qapi visitor code allows yes/on/y for true and no/off/n for false
      value of boolean properities. Unify the used style so that we can
      generate it later and fix test cases.
      a47174c5
    • P
      qemu: command: Shuffle around formating of alias for memory backend objs · 172100ac
      Peter Krempa 提交于
      Move the alias as the second formated argument and tweak the tests so
      that a future refactor that will change the order doesn't break tests.
      172100ac
    • P
      qemu: Extract code to setup memory backing objects · db3b1c4a
      Peter Krempa 提交于
      Extract the memory backend device code into a separate function so that
      it can be later easily refactored and reused.
      
      Few small changes for future reusability, namely:
      - new (currently unused) parameter for user specified page size
      - size of the memory is specified in kibibytes, divided up in the
      function
      - new (currently unused) parameter for user specifed source nodeset
      - option to enforce capability check
      db3b1c4a
    • P
      qemu: command: Add helper to format -object strings from JSON representation · 331b2583
      Peter Krempa 提交于
      Unlike -device, qemu uses a JSON object to add backend "objects" via the
      monitor rather than the string that would be passed on the commandline.
      
      To be able to reuse code parts that configure backends for various
      devices, this patch adds a helper that will allow generating the command
      line representations from the JSON property object.
      331b2583
  11. 30 1月, 2015 3 次提交
    • T
      qemu: change macvtap device options in response to NIC_RX_FILTER_CHANGED · 79a87694
      Tony Krowiak 提交于
      This patch enables synchronization of the host macvtap
      device options with the guest device's in response to the
      NIC_RX_FILTER_CHANGED event.
      
      The following device options will be synchronized:
      * PROMISC
      * MULTICAST
      * ALLMULTI
      Signed-off-by: NTony Krowiak <akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      79a87694
    • J
      qemu: Don't unconditionally delete file in qemuOpenFileAs · 7879d031
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1158034
      
      If we're expecting to create a file somewhere and that fails for some
      reason during qemuOpenFileAs, then we unlink the path we're attempting
      to create leaving no way to determine what the "existing" privileges,
      protections, or labels are that caused the failure (open, change owner
      and group, change mode, etc.).
      
      Furthermore, if we fall into the path where we'll be opening / creating
      the file using VIR_FILE_OPEN_FORK, we need to first unlink/delete the file
      we created in the first path; otherwise, the attempt by the child process
      to open as some specific user:group may fail because the file was already
      created using nfsnobody:nfsnobody. Again, if we didn't create the file we
      don't want to blindly delete what already exists. Thus, a second reason for
      the original check to set need_unlink to false when we find the file with
      CREAT set, but already existing.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      7879d031
    • J
      qemu: Adjust EndAsyncJob for qemuDomainSaveInternal error path · 8ff38336
      John Ferlan 提交于
      Commit id '540c339a' to fix issues with reference counting and transient
      domains moved the qemuDomainObjEndAsyncJob call prior to the attempt to
      restart the guest CPU's resulting in an error:
      
          error: Failed to save domain rhel70 to /tmp/pl/rhel70.save
          error: internal error: unexpected async job 3
      
      when (ret != 0) - eg, the error path from qemuDomainSaveMemory.
      
      This patch will adjust the logic to call the EndAsyncJob only after
      we've tried to restart the guest CPUs. It also needs to adjust the
      test for qemuDomainRemoveInactive to add the ret == 0 condition.
      
      Additionally, if we get to endjob: because of some error earlier, then
      we need to save that error in the event the CPU restart logic fails.
      We don't want to return the error from CPU restart failure, rather we
      want to return the error from the failed save that caused us to fall
      into the retry to start the CPU logic.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      8ff38336
  12. 29 1月, 2015 1 次提交
    • M
      qemu: Add AAVMF to the list of known UEFIs · 436dcf0b
      Michal Privoznik 提交于
      Well, even though users can pass the list of UEFI:NVRAM pairs at the
      configure time, we may maintain the list of widely available UEFI
      ourselves too. And as arm64 begin to rises, OVMF was ported there too.
      With a slight name change - it's called AAVMF, with AAVMF_CODE.fd
      being the UEFI firmware and AAVMF_VARS.fd being the NVRAM store file.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      436dcf0b