1. 04 6月, 2019 7 次提交
    • J
      qemu: Check TSC frequency before starting QEMU · 7da62c91
      Jiri Denemark 提交于
      When migrating a domain with invtsc CPU feature enabled, the TSC
      frequency of the destination host must match the frequency used when the
      domain was started on the source host or the destination host has to
      support TSC scaling.
      
      If the frequencies do not match and the destination host does not
      support TSC scaling, QEMU will fail to set the right TSC frequency when
      starting vCPUs on the destination and thus migration will fail. However,
      this is quite late since both host might have spent significant time
      transferring memory and perhaps even storage data.
      
      By adding the check to libvirt we can let migration fail before any data
      starts to be sent over. If for some reason libvirt is unable to detect
      the host's TSC frequency or scaling support, we'll just let QEMU try and
      the migration will either succeed or fail later.
      
      Luckily, we mandate TSC frequency to be explicitly set in the domain XML
      to even allow migration of domains with invtsc. We can just check
      whether the requested frequency is compatible with the current host
      before starting QEMU.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1641702Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      7da62c91
    • J
      cpu_x86: Probe TSC frequency and scaling support · ceb04d15
      Jiri Denemark 提交于
      When the host CPU supports invariant TSC the host CPU definition created
      by virCPUx86GetHost will contain (unless probing fails for some reason)
      addition TSC related data.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      ceb04d15
    • J
      cpu_x86: Fix placement of *CheckFeature functions · 32f577ab
      Jiri Denemark 提交于
      Commit 0a97486e moved them outside #ifdef, but after virCPUx86GetHost,
      which will start calling them in the following patch.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      32f577ab
    • J
      conf: Report TSC frequency in host CPU capabilities · c277b9ad
      Jiri Denemark 提交于
      This patch adds a new
      
          <counter name='tsc' frequency='N' scaling='on|off'/>
      
      element into the host CPU capabilities XML.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      c277b9ad
    • J
      util: Add virHostCPUGetTscInfo · f0f6faba
      Jiri Denemark 提交于
      On a KVM x86_64 host which supports invariant TSC this function can be
      used to detect the TSC frequency and the availability of TSC scaling.
      
      The magic MSR numbers required to check if VMX scaling is supported on
      the host are documented in Volume 3 of the Intel® 64 and IA-32
      Architectures Software Developer’s Manual.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      f0f6faba
    • J
      qemuargv2xmltest: Use mocked virQEMUCapsProbeHostCPU · 02c1d3a6
      Jiri Denemark 提交于
      The qemuTestParseCapabilitiesArch call would eventually lead to the host
      CPU being probed via virCPUGetHost. Let's divert this to a mocked
      version already used by the qemuxml2argvtest.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      02c1d3a6
    • J
      qemu: Make virQEMUCapsProbeHostCPUForEmulator more generic · dd3fc650
      Jiri Denemark 提交于
      The function is renamed as virQEMUCapsProbeHostCPU and it does not get
      the list of allowed CPU models from qemuCaps anymore. This is
      responsibility is moved to the caller. The result is just a very thin
      wrapper around virCPUGetHost mostly required mocking in tests.
      
      The generic function is used in place of a direct call to virCPUGetHost
      in virQEMUCapsInitHostCPUModel to make sure tests don't accidentally
      probe host CPU.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      dd3fc650
  2. 03 6月, 2019 33 次提交