On Tue, Feb 07, 2023 at 10:20:14AM +0000, Richard W.M. Jones wrote:
On Tue, Feb 07, 2023 at 08:56:06AM +0000, Daniel P. Berrangé wrote:
> On Mon, Feb 06, 2023 at 12:49:41PM +0000, Richard W.M. Jones wrote:
> > (2) If the guest is RHEL family >= 9, use -cpu host / host-passthrough
> >
> > (3) Otherwise don't specify any -cpu or <cpu> section
> >
> > The third option seems to cause qemu / libvirt to use qemu64. However
> > it has the advantage that the guest is migratable afterwards.
>
> I vaguely recall in previous discussion that we decided not to
> care if the guest is migratable or not, on the basis that wasn't
> really domain knowledge of v2v nor an user request. Thus the
> use of 'host-passthrough' rather than 'host-model' to give a
> "perfect" match for the host, rather than approximation.
Discussion on the orignal patch:
https://listman.redhat.com/archives/libguestfs/2022-April/thread.html#28711
Maybe we discussed migratability on IRC or on some previous thread,
but all I can find there is the same commit message. (OTOH I did
review the patch and didn't query it, so ...)
I just posted a patch to change this from host-passthrough to
host-model, because I think we don't need to hinder live migration if
there's an easy way to do that.
> > There may be a case for changing this so:
> >
> > (a) Rule (2) is changed so we use host-model (for the libvirt target).
>
> All hinges on whether users expect the output of v2v to be
> migratable or not.
>
> > (b) Rule (3) is changed so we always specify a minimum CPU, eg.
> > for x86-64 guests, choose x86-64-v2 (is that an actual CPU model??)
>
> In the case of x86-64-v2 it is the QEMU Nehalem model is a perfect
> match, and is capable of running on both Intel and AMD hosts. This
> is mostly luck though. For x86-64-v3 / -v4 ABIs there is no viable
> model that will run on both AMD and Intel. So once there's a guest
> OS that mandates -v3, we'll be back to wanting host-model/passthrough.
Is there any easy way to query libvirt to find out what is the best
x86-64-vX compatible CPU available? Sometimes we are connected to
libvirt on the output side.
No, that's not a concept we expose. The x86-64-vX things are really
software ABIs aka the GCC -march / -mcpu flag arguments, and so
reporting about that kind of thing isn't especially in scope for
libvirt.
For QEMU we do however generate docs which show which CPUs can
support each x86 ABI - see the big colourful table here:
https://www.qemu.org/docs/master/system/i386/cpu.html
and the script for that is here
https://gitlab.com/qemu-project/qemu/-/blob/master/scripts/cpu-x86-uarch-...
I think it probably would be possible to query libvirt to ask for
the full expansion of the hypervisor host CPU featureset, because
ultimately the ABI is just declaring that features X, Y & Z must
exist as a minimum.
With regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|