1. 05 11月, 2014 1 次提交
  2. 04 11月, 2014 1 次提交
  3. 03 11月, 2014 1 次提交
  4. 23 10月, 2014 1 次提交
    • E
      qemu: Disallow NUMA/network tuning for session mode · 43b67f2e
      Erik Skultety 提交于
      Tuning NUMA or network interface parameters requires root
      privileges to manage cgroups. Thus an attempt to set some of these
      parameters in session mode on a running domain should be invalid
      followed by an error. An example might be memory tuning which raises
      an error in such case.
      
      The following behavior in session mode will be present after applying
      this patch:
      
        Tuning  |      SET      |   GET  |
      ----------|---------------|--------|
      NUMA      | shut off only | always |
      Memory    |     never     | never  |
      Interface |     never     | always |
      
      Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1126762
      43b67f2e
  5. 04 10月, 2014 2 次提交
  6. 03 10月, 2014 2 次提交
    • C
      qemu: Don't compare CPU against host for TCG · 445a09bd
      Cole Robinson 提交于
      Right now when building the qemu command line, we try to do various
      unconditional validations of the guest CPU against the host CPU. However
      this checks are overly applied. The only time we should use the checks
      are:
      
      - The user requests host-model/host-passthrough, or
      
      - When KVM is requsted. CPU features requested in TCG mode are always
        emulated by qemu and are independent of the host CPU, so no host CPU
        checks should be performed.
      
      Right now if trying to specify a CPU for arm on an x86 host, it attempts
      to do non-sensical validation and falls over.
      
      Switch all the test cases that were intending to test CPU validation to
      use KVM, so they continue to test the intended code.
      
      Amend some aarch64 XML tests with a CPU model, to ensure things work
      correctly.
      445a09bd
    • C
      qemu_command: Split qemuBuildCpuArgStr · 3bc6dda6
      Cole Robinson 提交于
      Move the CPU mode/model handling to its own function. This is just
      code movement and re-indentation.
      3bc6dda6
  7. 24 9月, 2014 1 次提交
  8. 23 9月, 2014 2 次提交
  9. 22 9月, 2014 1 次提交
  10. 19 9月, 2014 1 次提交
  11. 18 9月, 2014 3 次提交
    • R
      Fix build in qemu_command · e29d28e7
      Roman Bogorodskiy 提交于
      Currently, build with clang fails with:
      
        CC       qemu/libvirt_driver_qemu_impl_la-qemu_command.lo
      qemu/qemu_command.c:6580:58: error: implicit conversion from enumeration type
      'virMemAccess' to different enumeration type 'virTristateSwitch'
      [-Werror,-Wenum-conversion]
              virTristateSwitch memAccess = def->cpu->cells[i].memAccess;
                                ~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
      1 error generated.
      
      Fix that by using virMemAccess instead of virTristateSwitch.
      e29d28e7
    • M
      qemu: Honor hugepages for UMA domains · 281f7001
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1135396
      
      There are two ways how to tell qemu to use huge pages. The first one
      is suitable for domains with NUMA nodes: the path to hugetlbfs mount
      is appended to NUMA node definition on the command line. The second
      one is suitable for UMA domains: here there's this global '-mem-path'
      argument that accepts path to the hugetlbfs mount point. However, the
      latter case was not used for all the cases that it should be. For
      instance:
      
        <memoryBacking>
          <hugepages>
            <page size='2048' unit='KiB' nodeset='0'/>
          </hugepages>
        </memoryBacking>
      
      didn't trigger the '-mem-path' so the huge pages - despite being
      configured - were not used at all.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      281f7001
    • M
      conf: Disallow nonexistent NUMA nodes for hugepages · ec982f6d
      Michal Privoznik 提交于
      As of 136ad497 it is possible to specify different huge pages per
      guest NUMA node. However, there's no check if nodeset specified in
      ./hugepages/page contains only those guest NUMA nodes that exist.
      In other words with current code it is possible to define meaningless
      combination:
      
        <memoryBacking>
          <hugepages>
            <page size='1048576' unit='KiB' nodeset='0,2-3'/>
            <page size='2048' unit='KiB' nodeset='1,4'/>
          </hugepages>
        </memoryBacking>
        <vcpu placement='static'>4</vcpu>
        <cpu>
          <numa>
            <cell id='0' cpus='0' memory='1048576'/>
            <cell id='1' cpus='1' memory='1048576'/>
            <cell id='2' cpus='2' memory='1048576'/>
            <cell id='3' cpus='3' memory='1048576'/>
          </numa>
        </cpu>
      
      Notice the node 4 in <hugepages/>?
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ec982f6d
  12. 17 9月, 2014 2 次提交
  13. 16 9月, 2014 1 次提交
    • 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
  14. 11 9月, 2014 2 次提交
  15. 10 9月, 2014 2 次提交
    • M
      qemu: Implement extended loader and nvram · 54289916
      Michal Privoznik 提交于
      QEMU now supports UEFI with the following command line:
      
        -drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
        -drive file=/usr/share/OVMF/OVMF_VARS.fd,if=pflash,format=raw,unit=1 \
      
      where the first line reflects <loader> and the second one <nvram>.
      Moreover, these two lines obsolete the -bios argument.
      
      Note that UEFI is unusable without ACPI. This is handled properly now.
      Among with this extension, the variable file is expected to be
      writable and hence we need security drivers to label it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      54289916
    • M
      conf: Extend <loader/> and introduce <nvram/> · 68bf13db
      Michal Privoznik 提交于
      Up to now, users can configure BIOS via the <loader/> element. With
      the upcoming implementation of UEFI this is not enough as BIOS and
      UEFI are conceptually different. For instance, while BIOS is ROM, UEFI
      is programmable flash (although all writes to code section are
      denied). Therefore we need new attribute @type which will
      differentiate the two. Then, new attribute @readonly is introduced to
      reflect the fact that some images are RO.
      
      Moreover, the OVMF (which is going to be used mostly), works in two
      modes:
      1) Code and UEFI variable store is mixed in one file.
      2) Code and UEFI variable store is separated in two files
      
      The latter has advantage of updating the UEFI code without losing the
      configuration. However, in order to represent the latter case we need
      yet another XML element: <nvram/>. Currently, it has no additional
      attributes, it's just a bare element containing path to the variable
      store file.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      68bf13db
  16. 08 9月, 2014 1 次提交
  17. 04 9月, 2014 1 次提交
    • E
      maint: use consistent if-else braces in qemu · 44e30277
      Eric Blake 提交于
      I'm about to add a syntax check that enforces our documented
      HACKING style of always using matching {} on if-else statements.
      
      This commit focuses on the qemu driver.
      
      * src/qemu/qemu_command.c (qemuParseISCSIString)
      (qemuParseCommandLineDisk, qemuParseCommandLine)
      (qemuBuildSmpArgStr, qemuBuildCommandLine)
      (qemuParseCommandLineDisk, qemuParseCommandLineSmp): Correct use
      of {}.
      * src/qemu/qemu_capabilities.c (virQEMUCapsProbeCPUModels):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainCoreDumpWithFormat)
      (qemuDomainRestoreFlags, qemuDomainGetInfo)
      (qemuDomainMergeBlkioDevice): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextCreateSnapshot)
      (qemuMonitorTextLoadSnapshot, qemuMonitorTextDeleteSnapshot):
      Likewise.
      * src/qemu/qemu_process.c (qemuProcessStop): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      44e30277
  18. 02 9月, 2014 1 次提交
  19. 29 8月, 2014 2 次提交
    • J
      qemu: Allow use of iothreads for disk definitions · ef8da2ad
      John Ferlan 提交于
      For virtio-blk-pci disks with the disk iothread attribute that are
      running the correct emulator, add the "iothread=iothread#" to the
      -device command line in order to enable iothreads for the disk as
      long as the command is available, the disk iothread value provided is
      valid, and is supported for the disk device being added
      ef8da2ad
    • J
      qemu: Add support for iothreads · 72edaae7
      John Ferlan 提交于
      Add a new capability to ensure the iothreads feature exists for the qemu
      emulator being run - requires the "query-iothreads" QMP command. Using the
      domain XML add correspoding command argument in order to generate the
      threads. The iothreads will use a name space "iothread#" where, the
      future patch to add support for using an iothread to a disk definition to
      merely define which of the available threads to use.
      
      Add tests to ensure the xml/argv processing is correct.  Note that no
      change was made to qemuargv2xmltest.c as processing the -object element
      would require knowing more than just iothreads.
      72edaae7
  20. 28 8月, 2014 3 次提交
    • J
      qemu_command: Resolve Coverity DEADCODE · 84bfb11b
      John Ferlan 提交于
      One useless warning, but the other one rather pertinent. On entry
      the 'trans' variable is initialized to VIR_DOMAIN_DISK_TRANS_DEFAULT.
      When the "trans" was found in the parsing loop it def->geometry.trans
      was assigned to the return from virDomainDiskGeometryTransTypeFromString
      and then 'trans' was used to do the comparison to see if it was valid.
      
      So remove 'trans' and use def->geometry.trans properly
      84bfb11b
    • J
      qemu_command: Resolve Coverity RESOURCE_LEAK · 461fb555
      John Ferlan 提交于
      In qemuParseISCSIString() if an error was returned, then the call
      to qemuParseDriveURIString() where the uri is free'd wouldn't be run
      461fb555
    • J
      qemu_command: Resolve Coverity REVERSE_INULL · 39b9c121
      John Ferlan 提交于
      In qemuNetworkIfaceConnect() a call to virNetDevBandwidthSet() is
      made where the function prototype requires the first parameter
      (net->ifname) to be non NULL.  Coverity complains that the subsequent
      non NULL check for net->ifname prior to the next call gets flagged as
      an unnecessary check.  Resolve by removing the extra check
      39b9c121
  21. 26 8月, 2014 2 次提交
    • E
      blkdeviotune: check for overflow when parsing XML · 2f0944de
      Erik Skultety 提交于
      According to docs/schemas/domaincommon.rng and _virDomainBlockIoTuneInfo
      all the iotune values are interpreted as unsigned long long, however
      according to qemu_monitor_json.c, qemu silently truncates numbers
      larger than LLONG_MAX. There's really not much of a usage for such
      large numbers anyway yet. This patch provides the same overflow
      check during a domain start as it does during setting
      a blkdeviotune element in qemu_driver.c and thus reports an error when
      a larger number than LLONG_MAX is detected.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1131876
      2f0944de
    • A
      Add new 'kvm' domain feature and ability to hide KVM signature · d0711642
      Alex Williamson 提交于
      QEMU 2.1 added support for the kvm=off option to the -cpu command,
      allowing the KVM hypervisor signature to be hidden from the guest.
      This enables disabling of some paravirualization features in the
      guest as well as allowing certain drivers which test for the
      hypervisor to load.  Domain XML syntax is as follows:
      
      <domain type='kvm>
        ...
        <features>
          ...
          <kvm>
            <hidden state='on'/>
          </kvm>
        </features>
        ...
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      d0711642
  22. 25 8月, 2014 1 次提交
  23. 21 8月, 2014 1 次提交
    • J
      Perform disk config validity checking for attach-device config · 33188c9f
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1078126
      
      Using 'virsh attach-device --config' (or --persistent) to attach a
      file backed lun device will succeed; however, subsequent domain restarts
      will result in failure because the configuration of a file backed lun
      is not supported.
      
      Although allowing 'illegal configurations' is something that can be
      allowed, it may not be practical in this case. Generally, when attaching
      a device to a domain means the domain must be running. A way around
      this is using the --config (or --persistent) option. When an attach
      is done to a running domain, a temporary configuration is modified
      first followed by the live update. The live update will make a number
      of disk validity checks when building the qemu command to attach the
      disk. If any fail, then change is rejected.
      
      Rather than allow a potentially illegal combination, adjust the code
      in the configuration path to make the same checks as the running path
      will make with respect to disk validity checks. This way we avoid
      having the potential for some subsequent start/reboot to fail because
      an illegal combination was allowed.
      
      NB: The live path still checks the configuration since it is possible
      to just do --live guest modification...
      33188c9f
  24. 20 8月, 2014 3 次提交
    • M
      qemu: Label all TAP FDs · cf976d9d
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1095636
      
      When starting up the domain the domain's NICs are allocated. As of
      1f24f682 (v1.0.6) we are able to use multiqueue feature on virtio
      NICs. It breaks network processing into multiple queues which can be
      processed in parallel by different host CPUs. The queues are, however,
      created by opening /dev/net/tun several times. Unfortunately, only the
      first FD in the row is labelled so when turning the multiqueue feature
      on in the guest, qemu will get AVC denial. Make sure we label all the
      FDs needed.
      
      Moreover, the default label of /dev/net/tun doesn't allow
      attaching a queue:
      
          type=AVC msg=audit(1399622478.790:893): avc:  denied  { attach_queue }
          for  pid=7585 comm="qemu-kvm"
          scontext=system_u:system_r:svirt_t:s0:c638,c877
          tcontext=system_u:system_r:virtd_t:s0-s0:c0.c1023
          tclass=tun_socket
      
      And as suggested by SELinux maintainers, the tun FD should be labeled
      as svirt_t. Therefore, we don't need to adjust any range (as done
      previously by Guannan in ae368ebf) rather set the seclabel of the
      domain directly.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cf976d9d
    • P
      conf: Pass virStorageSource into virDomainDiskSourceIsBlockType · 1cc6bdc2
      Peter Krempa 提交于
      All checks are based on the storage source, thus there's no need to pass
      the complete disk def.
      1cc6bdc2
    • G
      qemu_command: fix block indentation · 62df8ce0
      Giuseppe Scrivano 提交于
      Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
      62df8ce0
  25. 19 8月, 2014 1 次提交
  26. 08 8月, 2014 1 次提交