1. 21 11月, 2019 2 次提交
    • J
      qemu: Store default CPU in domain XML · 5e939cea
      Jiri Denemark 提交于
      When starting a domain without a CPU model specified in the domain XML,
      QEMU will choose a default one. Which is fine unless the domain gets
      migrated to another host because libvirt doesn't perform any CPU ABI
      checks and the virtual CPU provided by QEMU on the destination host can
      differ from the one on the source host.
      
      With QEMU 4.2.0 we can probe for the default CPU model used by QEMU for
      a particular machine type and store it in the domain XML. This way the
      chosen CPU model is more visible to users and libvirt will make sure
      the guest will see the exact same CPU after migration.
      
      Architecture specific notes
      - aarch64: We only set the default CPU for TCG domains as KVM requires
        explicit "-cpu host" to work.
      
      - ppc64: The default CPU for KVM is "host" thanks to some hacks in QEMU,
        we will translate the default model to the model corresponding to the
        host CPU ("POWER8" on a Power8 host, "POWER9" on Power9 host, etc.).
        This is not a problem as the corresponding CPU model is in fact an
        alias for "host". This is probably not ideal, but it's not wrong and
        the default virtual CPU configured by libvirt is the same QEMU would
        use. TCG uses various CPU models depending on machine type and its
        version.
      
      - s390x: The default CPU for KVM is "host" while TCG defaults to "qemu".
      
      - x86_64: The default CPU model (qemu64) is not runnable on any host
        with KVM, but QEMU just disables unavailable features and starts
        happily.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1598151
      https://bugzilla.redhat.com/show_bug.cgi?id=1598162Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      5e939cea
    • J
  2. 05 12月, 2017 1 次提交
  3. 11 4月, 2017 1 次提交
  4. 10 2月, 2016 1 次提交
    • C
      tests: qemuxml2xml: assign device addresses · c1c4d0d5
      Cole Robinson 提交于
      We use the PreFormat callback for this. Many test cases need to be extended
      to pass in proper qemuCaps flags so AssignAddresses doesn't throw errors.
      
      One test case (pcie-root-port-too-many) is dropped, since it was meant
      only for checking an error condition in qemuxml2argv, and one we add in
      AssignAddresses it errors here too.
      
      Long term I think AssignAddresses should be handled in qemu's PostParse
      callback, but that's not entirely straightforward. Handling it here
      means we can get the test suite churn over with.
      c1c4d0d5
  5. 27 1月, 2016 1 次提交
    • P
      device: cleanup input device code · 36785c7e
      Pavel Hrdina 提交于
      The current code was a little bit odd.  At first we've removed all
      possible implicit input devices from domain definition to add them later
      back if there was any graphics device defined while parsing XML
      description.  That's not all, while formating domain definition to XML
      description we at first ignore any input devices with bus different to
      USB and VIRTIO and few lines later we add implicit input devices to XML.
      
      This seems to me as a lot of code for nothing.  This patch may look
      to be more complicated than original approach, but this is a preferred
      way to modify/add driver specific stuff only in those drivers and not
      deal with them in common parsing/formating functions.
      
      The update is to add those implicit input devices into config XML to
      follow the real HW configuration visible by guest OS.
      
      There was also inconsistence between our behavior and QEMU's in the way,
      that in QEMU there is no way how to disable those implicit input devices
      for x86 architecture and they are available always, even without graphics
      device.  This applies also to XEN hypervisor.  VZ driver already does its
      part by putting correct implicit devices into live XML.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      36785c7e
  6. 08 5月, 2015 1 次提交
    • C
      caps: Fix regression defaulting to host arch · 8910e063
      Cole Robinson 提交于
      My commit 747761a7 (v1.2.15 only) dropped this bit of logic when filling
      in a default arch in the XML:
      
      -    /* First try to find one matching host arch */
      -    for (i = 0; i < caps->nguests; i++) {
      -        if (caps->guests[i]->ostype == ostype) {
      -            for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
      -                if (caps->guests[i]->arch.domains[j]->type == domain &&
      -                    caps->guests[i]->arch.id == caps->host.arch)
      -                    return caps->guests[i]->arch.id;
      -            }
      -        }
      -    }
      
      That attempt to match host.arch is important, otherwise we end up
      defaulting to i686 on x86_64 host for KVM, which is not intended.
      Duplicate it in the centralized CapsLookup function.
      
      Additionally add some testcases that would have caught this.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1219191
      8910e063
  7. 13 4月, 2015 1 次提交
  8. 17 7月, 2014 2 次提交