1. 03 12月, 2013 4 次提交
    • P
      qemu: Use qemuBuildNetworkDriveURI to handle http/ftp and friends · 078a1025
      Peter Krempa 提交于
      Prepare the function to integrate other protocols and start folding
      other network protocols into a common place.
      078a1025
    • P
      qemu: Simplify call pattern of qemuBuildDriveURIString · 927ddae1
      Peter Krempa 提交于
      Automatically assign secret type from the disk source definition and
      pull in adding of the comma. Then update callers to keep generated
      output the same.
      927ddae1
    • P
      qemu: Split out formatting of network disk source URI · a29d33ff
      Peter Krempa 提交于
      The snapshot code will need to use qemu-style formatted URIs of network
      disks. Split out the code to avoid duplication.
      a29d33ff
    • P
      qemu: Refactor qemuTranslateDiskSourcePool · e1a4d08b
      Peter Krempa 提交于
      Before this patch, the translation function still needs a second ugly
      helper function to actually format the command line for qemu. But if we
      do the right stuff in the translation function, we don't have to bother
      with the second function any more.
      
      This patch removes the messy qemuBuildVolumeString function and changes
      qemuTranslateDiskSourcePool to set stuff up correctly so that the
      regular code paths meant for volumes can be used to format the command
      line correctly.
      
      For this purpose a new helper "qemuDiskGetActualType()" is introduced to
      return the type of the volume in a pool.
      
      As a part of the refactor the qemuTranslateDiskSourcePool function is
      fixed to do decisions based on the pool type instead of the volume type.
      This allows to separate pool-type-specific stuff more clearly and will
      ease addition of other pool types that will require certain other
      operations to get the correct pool source.
      
      The previously fixed tests should make sure that we don't break stuff
      that was working before.
      e1a4d08b
  2. 26 11月, 2013 1 次提交
    • E
      storage: add network-dir as new storage volume type · ecd881b7
      Eric Blake 提交于
      In the 'directory' and 'netfs' storage pools, a user can see
      both 'file' and 'dir' storage volume types, to know when they
      can descend into a subdirectory.  But in a network-based storage
      pool, such as the upcoming 'gluster' pool, we use 'network'
      instead of 'file', and did not have any counterpart for a
      directory until this patch.  Adding a new volume type
      'network-dir' is better than reusing 'dir', because it makes
      it clear that the only way to access 'network' volumes within
      that container is through the network mounting (leaving 'dir'
      for something accessible in the local file system).
      
      * include/libvirt/libvirt.h.in (virStorageVolType): Expand enum.
      * docs/formatstorage.html.in: Document it.
      * docs/schemasa/storagevol.rng (vol): Allow new value.
      * src/conf/storage_conf.c (virStorageVol): Use new value.
      * src/qemu/qemu_command.c (qemuBuildVolumeString): Fix client.
      * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Likewise.
      * tools/virsh-volume.c (vshVolumeTypeToString): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemVolDelete): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ecd881b7
  3. 25 11月, 2013 1 次提交
  4. 21 11月, 2013 2 次提交
  5. 19 11月, 2013 1 次提交
  6. 12 11月, 2013 1 次提交
  7. 08 11月, 2013 3 次提交
    • V
      qemu: assign PCI address to primary video card · 54e4d9d0
      Vitor de Lima 提交于
      When adding support for Q35 guests, the code to assign a PCI address
      to the primary video card was moved into Q35 and i440fx(PIIX3)
      specific functions, but no fallback was kept for other machine types
      that might have a video card.
      
      This patch remedies that by assigning a PCI address to the primary
      video card if it does not have any kind of address.  In particular,
      this fixes issues with pseries guests.
      Signed-off-by: NVitor de Lima <vitor.lima@eldorado.org.br>
      Signed-off-by: NLaine Stump <laine@laine.org>
      54e4d9d0
    • P
      qemu: Add support for paravirtual spinlocks in the guest · e0dc8511
      Peter Krempa 提交于
      The linux kernel recently added support for paravirtual spinlock
      handling to avoid performance regressions on overcomitted hosts. This
      feature needs to be turned in the hypervisor so that the guest OS is
      notified about the possible support.
      
      This patch adds a new feature "paravirt-spinlock" to the XML and
      supporting code to enable the "kvm_pv_unhalt" pseudo CPU feature in
      qemu.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1008989
      e0dc8511
    • P
      conf: Refactor storing and usage of feature flags · de7b5faf
      Peter Krempa 提交于
      Currently we were storing domain feature flags in a bit field as the
      they were either enabled or disabled. New features such as paravirtual
      spinlocks however can be tri-state as the default option may depend on
      hypervisor version.
      
      To allow storing tri-state feature state in the same place instead of
      having to declare dedicated variables for each feature this patch
      refactors the bit field to an array.
      de7b5faf
  8. 05 11月, 2013 1 次提交
  9. 21 10月, 2013 1 次提交
  10. 17 10月, 2013 1 次提交
  11. 15 10月, 2013 4 次提交
    • P
      qemu: command: Fix macro indentation · fe1bf917
      Peter Krempa 提交于
      fe1bf917
    • J
    • E
      maint: avoid 'const fooPtr' in qemu · 9a520a59
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in src/qemu.
      
      * src/qemu/qemu_bridge_filter.h (networkAllowMacOnPort)
      (networkDisallowMacOnPort): Use intended type.
      * src/qemu/qemu_bridge_filter.c (networkAllowMacOnPort)
      (networkDisallowMacOnPort): Likewise.
      * src/qemu/qemu_command.c (qemuBuildTPMBackendStr)
      (qemuBuildTPMDevStr, qemuBuildCpuArgStr)
      (qemuBuildObsoleteAccelArg, qemuBuildMachineArgStr)
      (qemuBuildSmpArgStr, qemuBuildNumaArgStr): Likewise.
      * src/qemu/qemu_conf.c (qemuSharedDeviceEntryCopy): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSaveImageStartVM): Likewise.
      * src/qemu/qemu_hostdev.c
      (qemuDomainHostdevNetConfigVirtPortProfile): Likewise.
      * src/qemu/qemu_monitor_json.c
      (qemuMonitorJSONAttachCharDevCommand): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9a520a59
    • E
      maint: fix awkward typing of virDomainChrGetDomainPtrs · f8fa2b3e
      Eric Blake 提交于
      virDomainChrGetDomainPtrs() required 4 levels of pointers (taking
      a parameter that will be used as an output variable to return the
      address of another variable that contains an array of pointers).
      This is rather complex to reason about, especially when outside
      of the domain_conf file, no other caller should be modifying
      the resulting array of pointers directly.  Changing the public
      signature gives something is easier to reason with, and actually
      make const-correct; which is important as it was the only function
      that was blocking virDomainDeviceDefCopy from treating its source
      as const.
      
      * src/conf/domain_conf.h (virDomainChrGetDomainPtrs): Use simpler
      types, and make const-correct for external users.
      * src/conf/domain_conf.c (virDomainChrGetDomainPtrs): Split...
      (virDomainChrGetDomainPtrsInternal): ...into an internal version
      that lets us modify terms, vs. external form that is read-only.
      (virDomainDeviceDefPostParseInternal, virDomainChrFind)
      (virDomainChrInsert): Adjust callers.
      * src/qemu/qemu_command.c (qemuGetNextChrDevIndex): Adjust caller.
      (qemuDomainDeviceAliasIndex): Make const-correct.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f8fa2b3e
  12. 10 10月, 2013 1 次提交
    • P
      qemu: Prefer VFIO for PCI device passthrough · f094aaac
      Peter Krempa 提交于
      Prefer using VFIO (if available) to the legacy KVM device passthrough.
      
      With this patch a PCI passthrough device without the driver configured
      will be started with VFIO if it's available on the host. If not legacy
      KVM passthrough is checked and error is reported if it's not available.
      f094aaac
  13. 08 10月, 2013 1 次提交
  14. 03 10月, 2013 1 次提交
    • L
      qemu: check actual netdev type rather than config netdev type during init · 9881bfed
      Laine Stump 提交于
      This resolves:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=1012824
         https://bugzilla.redhat.com/show_bug.cgi?id=1012834
      
      Note that a similar problem was reported in:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=827519
      
      but the fix only worked for <interface type='hostdev'>, *not* for
      <interface type='network'> where the network itself was a pool of
      hostdevs.
      
      The symptom in both cases was this error message:
      
         internal error: Unable to determine device index for network device
      
      In both cases the cause was lack of proper handling for netdevs
      (<interface>) of type='hostdev' when scanning the netdev list looking
      for alias names in qemuAssignDeviceNetAlias() - those that aren't
      type='hostdev' have an alias of the form "net%d", while those that are
      hostdev use "hostdev%d". This special handling was completely lacking
      prior to the fix for Bug 827519 which was:
      
      When searching for the highest alias index, libvirt looks at the alias
      for each netdev and if it is type='hostdev' it ignores the entry. If
      the type is not hostdev, then it expects the "net%d" form; if it
      doesn't find that, it fails and logs the above error message.
      
      That fix works except in the case of <interface type='network'> where
      the network uses hostdev (i.e. the network is a pool of VFs to be
      assigned to the guests via PCI passthrough). In this case, the check
      for type='hostdev' would fail because it was done as:
      
           def->net[i]->type == VIR_DOMAIN_NET_TYPE_HOSTDEV
      
      (which compares what was written in the config) when it actually
      should have been:
      
          virDomainNetGetActualType(def->net[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV
      
      (which compares the type of netdev that was actually allocated from
      the network at runtime).
      
      Of course the latter wouldn't be of any use if the netdevs of
      type='network' hadn't already acquired their actual network connection
      yet, but manual examination of the code showed that this is never the
      case.
      
      While looking through qemu_command.c, two other places were found to
      directly compare the net[i]->type field rather than getting actualType:
      
      * qemuAssignDeviceAliases() - in this case, the incorrect comparison
        would cause us to create a "net%d" alias for a netdev with
        type='network' but actualType='hostdev'. This alias would be
        subsequently overwritten by the proper "hostdev%d" form, so
        everything would operate properly, but a string would be
        leaked. This patch also fixes this problem.
      
      * qemuAssignDevicePCISlots() - would defer assigning a PCI address to
        a netdev if it was type='hostdev', but not for type='network +
        actualType='hostdev'. In this case, the actual device usually hasn't
        been acquired yet anyway, and even in the case that it has, there is
        no practical difference between assigning a PCI address while
        traversing the netdev list or while traversing the hostdev
        list. Because changing it would be an effective NOP (but potentially
        cause some unexpected regression), this usage was left unchanged.
      9881bfed
  15. 25 9月, 2013 15 次提交
  16. 24 9月, 2013 2 次提交