1. 28 4月, 2017 3 次提交
    • P
      qemu: use nec-usb-xhci as a default controller for aarch64 if available · 233f8d0b
      Pavel Hrdina 提交于
      This is a USB3 controller and it's a better choice than piix3-uhci.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      Acked-by: NAndrea Bolognani <abologna@redhat.com>
      233f8d0b
    • P
      qemu: change the logic of setting default USB controller · e69001b4
      Pavel Hrdina 提交于
      The new logic will set the piix3-uhci if available regardless of
      any architecture and it will be updated to better model based on
      architecture and device existence.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      Acked-by: NAndrea Bolognani <abologna@redhat.com>
      e69001b4
    • J
      qemu: Add support for guest CPU cache · df13c0b4
      Jiri Denemark 提交于
      This patch maps /domain/cpu/cache element into -cpu parameters:
      
      - <cache mode='passthrough'/> is translated to host-cache-info=on
      - <cache level='3' mode='emulate'/> is transformed into l3-cache=on
      - <cache mode='disable'/> is turned in host-cache-info=off,l3-cache=off
      
      Any other <cache> element is forbidden.
      
      The tricky part is detecting whether QEMU supports the CPU properties.
      
      The 'host-cache-info' property is introduced in v2.4.0-1389-ge265e3e480,
      earlier QEMU releases enabled host-cache-info by default and had no way
      to disable it. If the property is present, it defaults to 'off' for any
      QEMU until at least 2.9.0.
      
      The 'l3-cache' property was introduced later by v2.7.0-200-g14c985cffa.
      Earlier versions worked as if l3-cache=off was passed. For any QEMU
      until at least 2.9.0 l3-cache is 'off' by default.
      
      QEMU 2.9.0 was the first release which supports probing both properties
      by running device-list-properties with typename=host-x86_64-cpu. Older
      QEMU releases did not support device-list-properties command for CPU
      devices. Thus we can't really rely on probing them and we can just use
      query-cpu-model-expansion QMP command as a witness.
      
      Because the cache property probing is only reliable for QEMU >= 2.9.0
      when both are already supported for quite a few releases, we let QEMU
      report an error if a specific cache mode is explicitly requested. The
      other mode (or both if a user requested CPU cache to be disabled) is
      explicitly turned off for QEMU >= 2.9.0 to avoid any surprises in case
      the QEMU defaults change. Any older QEMU already turns them off so not
      doing so explicitly does not make any harm.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      df13c0b4
  2. 27 4月, 2017 1 次提交
  3. 24 4月, 2017 1 次提交
  4. 21 4月, 2017 1 次提交
    • M
      conf, docs: Add support for coalesce setting(s) · 523c9960
      Martin Kletzander 提交于
      We are currently parsing only rx/frames/max because that's the only
      value that makes sense for us.  The tun device just added support for
      this one and the others are only supported by hardware devices which
      we don't need to worry about as the only way we'd pass those to the
      domain is using <hostdev/> or <interface type='hostdev'/>.  And in
      those cases the guest can modify the settings itself.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      523c9960
  5. 20 4月, 2017 1 次提交
    • P
      qemu_domain: use correct default USB controller on ppc64 · 90acbc76
      Pavel Hrdina 提交于
      The history of USB controller for ppc64 guest is complex and goes
      back to libvirt 1.3.1 where the fun started.
      
      Prior Libvirt 1.3.1 if no model for USB controller was specified
      we've simply passed "-usb" on QEMU command line.
      
      Since Libvirt 1.3.1 there is a patch (8156493d) that fixes this
      issue by using "-device pci-ohci,..." but it breaks migration with
      older Libvirts which was agreed that's acceptable.  However this
      patch didn't reflect this change in the domain XML and the model
      was still missing.
      
      Since Libvirt 2.2.0 there is a patch (f55eaccb) that fixes the
      issue with not setting the USB model into domain XML which we need
      to know about to not break the migration and since the default
      model was *pci-ohci* it was used as default in this patch as well.
      
      This patch tries to take all the previous changes into account and
      also change the default for newly defined domains that don't specify
      any model for USB controller.
      
      The VIR_DOMAIN_DEF_PARSE_ABI_UPDATE is set only if new domain is
      defined or new device is added into a domain which means that in
      all other cases we will use the old *pci-ohci* model instead of the
      better and not broken *nec-usb-xhci* model.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1373184Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      90acbc76
  6. 18 4月, 2017 1 次提交
    • P
      qemu: refactor qemuDomainMachine* functions · ac97658d
      Pavel Hrdina 提交于
      Introduce new wrapper functions without *Machine* in the function
      name that take the whole virDomainDef structure as argument and
      call the existing functions with *Machine* in the function name.
      
      Change the arguments of existing functions to *machine* and *arch*
      because they don't need the whole virDomainDef structure and they
      could be used in places where we don't have virDomainDef.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      ac97658d
  7. 10 4月, 2017 1 次提交
  8. 03 4月, 2017 2 次提交
    • A
      qemu: Enforce ACPI, UEFI requirements · 396ca36c
      Andrea Bolognani 提交于
      Depending on the architecture, requirements for ACPI and UEFI can
      be different; more specifically, while on x86 UEFI requires ACPI,
      on aarch64 it's the other way around.
      
      Enforce these requirements when validating the domain, and make
      the error message more accurate by mentioning that they're not
      necessarily applicable to all architectures.
      
      Several aarch64 test cases had to be tweaked because they would
      have failed the validation step otherwise.
      396ca36c
    • M
      Introduce and use virDomainDiskEmptySource · 462c4b66
      Michal Privoznik 提交于
      Currently, if we want to zero out disk source (e,g, due to
      startupPolicy when starting up a domain) we use
      virDomainDiskSetSource(disk, NULL). This works well for file
      based storage (storage type file, dir, or block). But it doesn't
      work at all for other types like volume and network.
      
      So imagine that you have a domain that has a CDROM configured
      which source is a volume from an inactive pool. Because it is
      startupPolicy='optional', the CDROM is empty when the domain
      starts. However, the source element is not cleared out in the
      status XML and thus when the daemon restarts and tries to
      reconnect to the domain it refreshes the disks (which fails - the
      storage pool is still not running) and thus the domain is killed.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      462c4b66
  9. 29 3月, 2017 1 次提交
  10. 28 3月, 2017 3 次提交
  11. 27 3月, 2017 6 次提交
  12. 25 3月, 2017 1 次提交
    • J
      qemu: Set up the migration TLS objects for target · 1a6b6d9a
      John Ferlan 提交于
      If the migration flags indicate this migration will be using TLS,
      then set up the destination during the prepare phase once the target
      domain has been started to add the TLS objects to perform the migration.
      
      This will create at least an "-object tls-creds-x509,endpoint=server,..."
      for TLS credentials and potentially an "-object secret,..." to handle the
      passphrase response to access the TLS credentials. The alias/id used for
      the TLS objects will contain "libvirt_migrate".
      
      Once the objects are created, the code will set the "tls-creds" and
      "tls-hostname" migration parameters to signify usage of TLS.
      
      During the Finish phase we'll be sure to attempt to clear the
      migration parameters and delete those objects (whether or not they
      were created). We'll also perform the same reset during recovery
      if we've reached FINISH3.
      
      If the migration isn't using TLS, then be sure to check if the
      migration parameters exist and clear them if so.
      1a6b6d9a
  13. 17 3月, 2017 1 次提交
  14. 16 3月, 2017 1 次提交
  15. 15 3月, 2017 2 次提交
    • M
      qemu: Implement NVDIMM · 1bc17319
      Michal Privoznik 提交于
      So, majority of the code is just ready as-is. Well, with one
      slight change: differentiate between dimm and nvdimm in places
      like device alias generation, generating the command line and so
      on.
      
      Speaking of the command line, we also need to append 'nvdimm=on'
      to the '-machine' argument so that the nvdimm feature is
      advertised in the ACPI tables properly.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1bc17319
    • M
      Introduce NVDIMM memory model · b4e8a49f
      Michal Privoznik 提交于
      NVDIMM is new type of memory introduced into QEMU 2.6. The idea
      is that we have a Non-Volatile memory module that keeps the data
      persistent across domain reboots.
      
      At the domain XML level, we already have some representation of
      'dimm' modules. Long story short, NVDIMM will utilize the
      existing <memory/> element that lives under <devices/> by adding
      a new attribute 'nvdimm' to the existing @model and introduce a
      new <path/> element for <source/> while reusing other fields. The
      resulting XML would appear as:
      
          <memory model='nvdimm'>
            <source>
              <path>/tmp/nvdimm</path>
            </source>
            <target>
              <size unit='KiB'>523264</size>
              <node>0</node>
            </target>
            <address type='dimm' slot='0'/>
          </memory>
      
      So far, this is just a XML parser/formatter extension. QEMU
      driver implementation is in the next commit.
      
      For more info on NVDIMM visit the following web page:
      
          http://pmem.io/Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b4e8a49f
  16. 13 3月, 2017 1 次提交
  17. 10 3月, 2017 1 次提交
    • M
      qemuProcessHandleMonitorEOF: Disable namespace for domain · e915942b
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1430634
      
      If a qemu process has died, we get EOF on its monitor. At this
      point, since qemu process was the only one running in the
      namespace kernel has already cleaned the namespace up. Any
      attempt of ours to enter it has to fail.
      
      This really happened in the bug linked above. We've tried to
      attach a disk to qemu and while we were in the monitor talking to
      qemu it just died. Therefore our code tried to do some roll back
      (e.g. deny the device in cgroups again, restore labels, etc.).
      However, during the roll back (esp. when restoring labels) we
      still thought that domain has a namespace. So we used secdriver's
      transactions. This failed as there is no namespace to enter.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e915942b
  18. 09 3月, 2017 4 次提交
    • P
      conf: store "autoGenerated" for graphics listen in status XML · cd4a8b93
      Pavel Hrdina 提交于
      When libvirtd is started we call qemuDomainRecheckInternalPaths
      to detect whether a domain has VNC socket path generated by libvirt
      based on option from qemu.conf.  However if we are parsing status XML
      for running domain the existing socket path can be generated also if
      the config XML uses the new <listen type='socket'/> element without
      specifying any socket.
      
      The current code doesn't make difference how the socket was generated
      and always marks it as "fromConfig".  We need to store the
      "autoGenerated" value in the status XML in order to preserve that
      information.
      
      The difference between "fromConfig" and "autoGenerated" is important
      for migration, because if the socket is based on "fromConfig" we don't
      print it into the migratable XML and we assume that user has properly
      configured qemu.conf on both hosts.  However if the socket is based
      on "autoGenerated" it means that a new feature was used and therefore
      we need to leave the socket in migratable XML to make sure that if
      this feature is not supported on destination the migration will fail.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      cd4a8b93
    • J
      qemu: Rename variable · b2e5de96
      John Ferlan 提交于
      Rename 'secretUsageType' to 'usageType' since it's superfluous in an
      API qemu*Secret*
      b2e5de96
    • J
      qemu: Introduce qemuDomainSecretInfoTLSNew · 7c2b7891
      John Ferlan 提交于
      Building upon the qemuDomainSecretInfoNew, create a helper which will
      build the secret used for TLS.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      7c2b7891
    • J
      qemu: Introduce qemuDomainSecretInfoNew · c9a7b7b6
      John Ferlan 提交于
      Create a helper which will create the secinfo used for disks, hostdevs,
      and chardevs.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      c9a7b7b6
  19. 07 3月, 2017 2 次提交
  20. 06 3月, 2017 1 次提交
    • M
      qemu: Enforce qemuSecurity wrappers · 4da534c0
      Michal Privoznik 提交于
      Now that we have some qemuSecurity wrappers over
      virSecurityManager APIs, lets make sure everybody sticks with
      them. We have them for a reason and calling virSecurityManager
      API directly instead of wrapper may lead into accidentally
      labelling a file on the host instead of namespace.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4da534c0
  21. 21 2月, 2017 1 次提交
    • M
      qemu: Fix deadlock across fork() in QEMU driver · e22de286
      Marc Hartmayer 提交于
      The functions in virCommand() after fork() must be careful with regard
      to accessing any mutexes that may have been locked by other threads in
      the parent process. It is possible that another thread in the parent
      process holds the lock for the virQEMUDriver while fork() is called.
      This leads to a deadlock in the child process when
      'virQEMUDriverGetConfig(driver)' is called and therefore the handshake
      never completes between the child and the parent process. Ultimately
      the virDomainObjectPtr will never be unlocked.
      
      It gets much worse if the other thread of the parent process, that
      holds the lock for the virQEMUDriver, tries to lock the already locked
      virDomainObject. This leads to a completely unresponsive libvirtd.
      
      It's possible to reproduce this case with calling 'virsh start XXX'
      and 'virsh managedsave XXX' in a tight loop for multiple domains.
      
      This commit fixes the deadlock in the same way as it is described in
      commit 61b52d2e.
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      e22de286
  22. 20 2月, 2017 4 次提交