Skip to contentSkip to conversation

hw/pc: set q35 as the default x86 machine

RFC PATCH In review Marcel Apfelbaum 11 participants 48 messages Jun 3, 2018 – Jun 21, 2018

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 hw/pc: set q35 as the default x86 machine

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

---
 hw/i386/pc_piix.c | 2 --
 hw/i386/pc_q35.c  | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +0 -2
index b4c5b03274..16dd65198f 100644
@@ -429,7 +429,6 @@ static void pc_i440fx_3_0_machine_options(MachineClass *m)
 {
     pc_i440fx_machine_options(m);
     m->alias = "pc";
-    m->is_default = 1;
 }
 
 DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL,
@@ -438,7 +437,6 @@ DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL,
 static void pc_i440fx_2_12_machine_options(MachineClass *m)
 {
     pc_i440fx_3_0_machine_options(m);
-    m->is_default = 0;
     m->alias = NULL;
     SET_MACHINE_COMPAT(m, PC_COMPAT_2_12);
 }
hw/i386/pc_q35.c +2 -0
index 83d6d75efa..b33c235d49 100644
@@ -312,6 +312,7 @@ static void pc_q35_3_0_machine_options(MachineClass *m)
 {
     pc_q35_machine_options(m);
     m->alias = "q35";
+    m->is_default = 1;
 }
 
 DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL,
@@ -321,6 +322,7 @@ static void pc_q35_2_12_machine_options(MachineClass *m)
 {
     pc_q35_3_0_machine_options(m);
     m->alias = NULL;
+    m->is_default = 0;
     SET_MACHINE_COMPAT(m, PC_COMPAT_2_12);
 }
 
Signature · 1 line
2.13.6
#1 lore raw
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

Signature · 1 line
MST
#2 lore raw
Quoted 18 lines · On Mon, 4 Jun 2018 04:38:22 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

Quoted 7 lines

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Maybe we should mark 'pc' default as deprecated first, like we do with CLI options that we wish to drop in future?

That way we 'create' documentation, so users would be aware of the change and have time to fix their CLI if they prefer 'pc' machine.

Quoted 3 lines

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

#3 lore raw
Quoted 11 lines · Igor Mammedov
Quoted 5 lines

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Maybe we should mark 'pc' default as deprecated first, like we do with CLI options that we wish to drop in future?

That way we 'create' documentation, so users would be aware of the change and have time to fix their CLI if they prefer 'pc' machine.

Michael has listed reasons why 'pc' cannot be deprecated, since some of them are not even fixable. Honestly, 'pc' works well for 99% of the use cases---just like you probably don't care whether your laptop has a PCI or PCIe chipset.

Paolo

#5 lore raw
In reply to Michael S. Tsirkin
Quoted 20 lines · Michael S. Tsirkin
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Quoted 8 lines

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

We could add new aliases if they are useful for management software, but we would need a well-defined use case and set of requirements+expectations for the new alias.

Signature · 1 line
Eduardo
#6 lore raw
Quoted 27 lines · Eduardo Habkost
Quoted 26 lines · Michael S. Tsirkin
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Quoted 6 lines
Quoted 2 lines

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

We could add new aliases if they are useful for management software, but we would need a well-defined use case and set of requirements+expectations for the new alias.

I'm not convinced by the idea of adding a distinct default "for mgmt". All the problems described wrt 'q35' vs 'pc' apply equally to management apps as they do to humans. It just happens that one common mgmt layer (libvirt) knows how to handle some of the complexity of q35. Other mgmt apps though are just as likely to be hurt by the change as humans are. So effectively the proposed "for mgmt" is actually "for libvirt >= some version", which feels like a layering violation to me.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#7 lore raw
Quoted 35 lines · Daniel P. Berrangé
Quoted 27 lines · Eduardo Habkost
Quoted 26 lines · Michael S. Tsirkin
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Quoted 6 lines
Quoted 2 lines

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

We could add new aliases if they are useful for management software, but we would need a well-defined use case and set of requirements+expectations for the new alias.

Quoted 7 lines

I'm not convinced by the idea of adding a distinct default "for mgmt". All the problems described wrt 'q35' vs 'pc' apply equally to management apps as they do to humans. It just happens that one common mgmt layer (libvirt) knows how to handle some of the complexity of q35. Other mgmt apps though are just as likely to be hurt by the change as humans are. So effectively the proposed "for mgmt" is actually "for libvirt >= some version", which feels like a layering violation to me.

This means the new alias would be used only if requested explicitly by management software (not used automatically by libvirt).

Taking that into account, I still don't see what exactly would be the use case here, and what exactly users can/can't expect when using the new alias.

Signature · 1 line
Eduardo
#10 lore raw
In reply to Daniel P. Berrangé
Quoted 43 lines · Daniel P. Berrangé
Quoted 27 lines · Eduardo Habkost
Quoted 26 lines · Michael S. Tsirkin
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Quoted 6 lines
Quoted 2 lines

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

We could add new aliases if they are useful for management software, but we would need a well-defined use case and set of requirements+expectations for the new alias.

I'm not convinced by the idea of adding a distinct default "for mgmt". All the problems described wrt 'q35' vs 'pc' apply equally to management apps as they do to humans. It just happens that one common mgmt layer (libvirt) knows how to handle some of the complexity of q35. Other mgmt apps though are just as likely to be hurt by the change as humans are. So effectively the proposed "for mgmt" is actually "for libvirt >= some version", which feels like a layering violation to me.

Quoted 2 lines

Regards,
Daniel

Is libvirt happy to just hard-code q35 for now then?

Quoted 4 lines
Signature · 3 lines
|: 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 :|
#11 lore raw
Quoted 44 lines · Michael S. Tsirkin
Quoted 35 lines · Daniel P. Berrangé
Quoted 27 lines · Eduardo Habkost
Quoted 26 lines · Michael S. Tsirkin
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Quoted 6 lines
Quoted 2 lines

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

We could add new aliases if they are useful for management software, but we would need a well-defined use case and set of requirements+expectations for the new alias.

Quoted 7 lines

I'm not convinced by the idea of adding a distinct default "for mgmt". All the problems described wrt 'q35' vs 'pc' apply equally to management apps as they do to humans. It just happens that one common mgmt layer (libvirt) knows how to handle some of the complexity of q35. Other mgmt apps though are just as likely to be hurt by the change as humans are. So effectively the proposed "for mgmt" is actually "for libvirt >= some version", which feels like a layering violation to me.

Quoted 1 line

Is libvirt happy to just hard-code q35 for now then?

I'm pretty wary of doing that, as I feel 'pc' has broader OS compatibility than 'q35', so we'd be likely to cause breakage for users.

IMHO, defaults are something better expressed in libosinfo, so if there's guests where we think q35 is a better choice, we can record it there and leave everything else on pc to avoid risk of breakage.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#8 lore raw
In reply to Eduardo Habkost
Quoted 44 lines · Eduardo Habkost
Quoted 35 lines · Daniel P. Berrangé
Quoted 27 lines · Eduardo Habkost
Quoted 26 lines · Michael S. Tsirkin
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Quoted 6 lines
Quoted 2 lines

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

We could add new aliases if they are useful for management software, but we would need a well-defined use case and set of requirements+expectations for the new alias.

Quoted 7 lines

I'm not convinced by the idea of adding a distinct default "for mgmt". All the problems described wrt 'q35' vs 'pc' apply equally to management apps as they do to humans. It just happens that one common mgmt layer (libvirt) knows how to handle some of the complexity of q35. Other mgmt apps though are just as likely to be hurt by the change as humans are. So effectively the proposed "for mgmt" is actually "for libvirt >= some version", which feels like a layering violation to me.

Quoted 7 lines

This means the new alias would be used only if requested explicitly by management software (not used automatically by libvirt).

Taking that into account, I still don't see what exactly would be the use case here, and what exactly users can/can't expect when using the new alias.

Let's see what we have now first:

1. We have a requirement for the user to save the machine type on install and maintain it with the image (a separate thread discusses saving that as part of a qcow2 image).

2. If you use an alias instead you are supposed to resolve it and save the resolved value. If you save the alias instead, you can't do cross-version live migration.

3. If you don't specify anything you get a machine tagged default. You are supposed to find it and save the value found. If you don't and just keep using the default, you can't do cross-version live migration.

---

So now we would like to relax 3 to say

	"If you don't and just keep using the default, some images might not
	boot".

unfortunately we probably can't change 3 like this. So what I propose instead is simply:

4. If you find a machine type value tagged "qmp-default" you must save the value found. If you don't and just keep using the qmp-default each time, then existing guest images won't boot.
This relaxed compatibility requirement allows for advanced features as compared to default.

Quoted 2 lines
Signature · 1 line
Eduardo
#4 lore raw
In reply to Paolo Bonzini
Quoted 13 lines · Paolo Bonzini
Quoted 11 lines · Igor Mammedov
Quoted 5 lines

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Maybe we should mark 'pc' default as deprecated first, like we do with CLI options that we wish to drop in future?

That way we 'create' documentation, so users would be aware of the change and have time to fix their CLI if they prefer 'pc' machine.

Quoted 8 lines

Michael has listed reasons why 'pc' cannot be deprecated, since some of them are not even fixable. Honestly, 'pc' works well for 99% of the use cases---just like you probably don't care whether your laptop has a PCI or PCIe chipset.

Paolo

I understood this comment to mean deprecating a *default* machine type.

So if you do -M pc you're still OK, but if you simply omit a machine type and hope for a specific one you're out of luck.

... We could just deprecate having any default and then make QEMU whine at you if you don't specify one, like we do for guessing format types on drive images -- it'll do it, but if it guesses raw it whines at you a little.

#14 lore raw
In reply to Michael S. Tsirkin

Hi Michael,

Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

Quoted 8 lines
Quoted 4 lines

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so.

We can add something do the help.

Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Quoted 1 line

hotplug needs extra bridges to work,

Adding a pci express root port in case hotplug is desired should not be too hard.

Quoted 6 lines

and one
can see that while management tool users benefit from q35, command line users will suffer.

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

This will help maybe, but was not the point. We have two x86 machine types, meaning some features will be developed/tested for pc, while others for q35. At some point we will loose track of what is working for each machine.

The PC machine command line is simpler and it supports older guest OSes, so we should keep it, of course; but I am not sure
we should add more features to it.

I see marking Q35 as the default machine a first step.

Thanks,
Marcel

#9 lore raw
In reply to Michael S. Tsirkin
Quoted 73 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 35 lines · Daniel P. Berrangé
Quoted 27 lines · Eduardo Habkost
Quoted 26 lines · Michael S. Tsirkin
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Quoted 6 lines
Quoted 2 lines

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

We could add new aliases if they are useful for management software, but we would need a well-defined use case and set of requirements+expectations for the new alias.

Quoted 7 lines

I'm not convinced by the idea of adding a distinct default "for mgmt". All the problems described wrt 'q35' vs 'pc' apply equally to management apps as they do to humans. It just happens that one common mgmt layer (libvirt) knows how to handle some of the complexity of q35. Other mgmt apps though are just as likely to be hurt by the change as humans are. So effectively the proposed "for mgmt" is actually "for libvirt >= some version", which feels like a layering violation to me.

Quoted 7 lines

This means the new alias would be used only if requested explicitly by management software (not used automatically by libvirt).

Taking that into account, I still don't see what exactly would be the use case here, and what exactly users can/can't expect when using the new alias.

Let's see what we have now first:

1. We have a requirement for the user to save the machine type on install and maintain it with the image (a separate thread discusses saving that as part of a qcow2 image).

2. If you use an alias instead you are supposed to resolve it and save the resolved value. If you save the alias instead, you can't do cross-version live migration.

3. If you don't specify anything you get a machine tagged default. You are supposed to find it and save the value found. If you don't and just keep using the default, you can't do cross-version live migration.

---

So now we would like to relax 3 to say

	"If you don't and just keep using the default, some images might not
	boot".
Quoted 8 lines

unfortunately we probably can't change 3 like this. So what I propose instead is simply:

4. If you find a machine type value tagged "qmp-default" you must save the value found. If you don't and just keep using the qmp-default each time, then existing guest images won't boot.
This relaxed compatibility requirement allows for advanced features as compared to default.

What problems would this system solve? Who would prefer to use the "qmp-default" machine-type instead of the "pc" or "q35" aliases?

Signature · 1 line
Eduardo
#12 lore raw
In reply to Daniel P. Berrangé
Quoted 41 lines · Daniel P. Berrangé
Quoted 40 lines · Michael S. Tsirkin
Quoted 39 lines · Daniel P. Berrangé
Quoted 26 lines · Eduardo Habkost
Quoted 25 lines · Michael S. Tsirkin
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Quoted 5 lines
Quoted 2 lines

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

We could add new aliases if they are useful for management software, but we would need a well-defined use case and set of requirements+expectations for the new alias.

I'm not convinced by the idea of adding a distinct default "for mgmt". All the problems described wrt 'q35' vs 'pc' apply equally to management apps as they do to humans. It just happens that one common mgmt layer (libvirt) knows how to handle some of the complexity of q35. Other mgmt apps though are just as likely to be hurt by the change as humans are. So effectively the proposed "for mgmt" is actually "for libvirt >= some version", which feels like a layering violation to me.

Quoted 7 lines
Quoted 1 line

Is libvirt happy to just hard-code q35 for now then?

I'm pretty wary of doing that, as I feel 'pc' has broader OS compatibility than 'q35', so we'd be likely to cause breakage for users.

IMHO, defaults are something better expressed in libosinfo, so if there's guests where we think q35 is a better choice, we can record it there and leave everything else on pc to avoid risk of breakage.

The only info we need to pass properly to management systems is:
"Use q35 unless your guests are really old".

I agree the exiting systems should not be touched.

Thanks,
Marcel

Quoted 2 lines

Regards,
Daniel

#13 lore raw
Quoted 48 lines · Marcel Apfelbaum
Quoted 45 lines · Daniel P. Berrangé
Quoted 33 lines · Michael S. Tsirkin
Quoted 32 lines · Daniel P. Berrangé
Quoted 31 lines · Eduardo Habkost
Quoted 19 lines · Michael S. Tsirkin
Quoted 8 lines · Marcel Apfelbaum

Moving to QEMU 3.0 seems like a good opportunity for such a change.

I440FX is really old and does not support modern features like IOMMU. Q35's SATA emulation is faster than pc's IDE, native PCI express hotplug is cleaner than ACPI based one and so on...

Also the libvirt guys added very good support for the Q35 machine (thanks!).

Quoted 8 lines

Management software should always specify the machine type and for the current setups, adding '-machine pc' to the command line is not such a big deal.

In time the pc machine will fade out and we will probably stop adding new versions at some point.

For command line users, I think changing the default isn't nice.

Quoted 8 lines

Yes it's easy to add -machine pc but there's no documentation that tells you to do so. Add to that shortcuts like -cdrom stop working, hotplug needs extra bridges to work, and one can see that while management tool users benefit from q35, command line users will suffer.

Can't we add a tag for management without changing the command line default? How about "management-default"? "recommended"? "latest"?

We could add new aliases if they are useful for management software, but we would need a well-defined use case and set of requirements+expectations for the new alias.

Quoted 8 lines
Quoted 7 lines

I'm not convinced by the idea of adding a distinct default "for mgmt". All the problems described wrt 'q35' vs 'pc' apply equally to management apps as they do to humans. It just happens that one common mgmt layer (libvirt) knows how to handle some of the complexity of q35. Other mgmt apps though are just as likely to be hurt by the change as humans are. So effectively the proposed "for mgmt" is actually "for libvirt >= some version", which feels like a layering violation to me.

Is libvirt happy to just hard-code q35 for now then?

I'm pretty wary of doing that, as I feel 'pc' has broader OS compatibility than 'q35', so we'd be likely to cause breakage for users.

Quoted 6 lines
Quoted 3 lines

IMHO, defaults are something better expressed in libosinfo, so if there's guests where we think q35 is a better choice, we can record it there and leave everything else on pc to avoid risk of breakage.

The only info we need to pass properly to management systems is:
"Use q35 unless your guests are really old".

Or if your existing disk image contains drivers or other software that work only with pc. Or if it's going to trigger Windows license reactivation on a disk image prepared using pc.

The stack can't change the default without breaking existing guest images. Whether it's a reasonable risk or it's unacceptable depends on what are the intended audience and use cases of a given management stack. I don't think QEMU or libvirt can make that decision for them.

That said, if something is going to break as soon as the default in QEMU changes, that's a bug in the management stack. Management stacks should stop assuming the default machine-type in libvirt+QEMU is never going to change.

Signature · 1 line
Eduardo
#15 lore raw
In reply to Marcel Apfelbaum

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

In case no machine type is given qemu can print some hints together with the error message.

cheers,
Gerd

#16 lore raw
Quoted 7 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Quoted 8 lines

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#17 lore raw

[Qemu-devel] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

(CCing libvir-list)

Quoted 12 lines · Daniel P. Berrangé
Quoted 11 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Quoted 8 lines
Quoted 4 lines

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Is there an actual promise to never change the default machine-type documented in the libvirt API, or is this just fear of breaking existing code?

Signature · 1 line
Eduardo
#18 lore raw

Re: [Qemu-devel] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

Quoted 20 lines · Eduardo Habkost

(CCing libvir-list)

Quoted 17 lines · Daniel P. Berrangé
Quoted 15 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Is there an actual promise to never change the default machine-type documented in the libvirt API, or is this just fear of breaking existing code?

The risk of breaking things that currently work. Some of the things discussed here that risk breaking users if QEMU changes the default, have the same risk if libvirt changes the default.

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

If we want to get q35 broadly used for modern OS, then IMHO the best option is to record that metadata in libosinfo, as ew do for other virtual hardware preferences. That doesn't fix the problem of disk images that might not transparently boot between pc/q35, but at least avoids breaking OS that don't support q35 at all.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#28 lore raw
In reply to Daniel P. Berrangé
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines · Gerd Hoffmann
   Hi,
Quoted 2 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

It can work, sure. And we can add user hints: "Use q35 for ...., select pc if..."

Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Can't libvirt preserve 'pc' for existing domains, while defaulting to q35 the creation of new domains ? This way it aligns with Gerd's proposal of no default x86 machine.

Thanks,
Marcel

Quoted 3 lines

Regards,
Daniel

#29 lore raw
Quoted 20 lines · Marcel Apfelbaum
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines · Gerd Hoffmann
   Hi,
Quoted 2 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

It can work, sure. And we can add user hints: "Use q35 for ...., select pc if..."

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Can't libvirt preserve 'pc' for existing domains, while defaulting to q35 the creation of new domains ? This way it aligns with Gerd's proposal of no default x86 machine.

Existing domains wasn't the case I was concerned about. Consider you have libvirt 4.4.0 intsalled and you deploy a *new* domain from a prebuilt disk image "foo". Now update to a libvirt or QEMU which changes to q35 and try to deploy another new domain from the same prebuilt disk image "foo". It may not work now if that disk image doesn't support q35. That would be a regression from the user's POV, whether libvirt or qemu has changed the default.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#19 lore raw

Re: [Qemu-devel] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

In reply to Daniel P. Berrangé
Quoted 37 lines · Daniel P. Berrangé
Quoted 20 lines · Eduardo Habkost

(CCing libvir-list)

Quoted 17 lines · Daniel P. Berrangé
Quoted 15 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Is there an actual promise to never change the default machine-type documented in the libvirt API, or is this just fear of breaking existing code?

The risk of breaking things that currently work. Some of the things discussed here that risk breaking users if QEMU changes the default, have the same risk if libvirt changes the default.

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

Quoted 5 lines

If we want to get q35 broadly used for modern OS, then IMHO the best option is to record that metadata in libosinfo, as ew do for other virtual hardware preferences. That doesn't fix the problem of disk images that might not transparently boot between pc/q35, but at least avoids breaking OS that don't support q35 at all.

This leads to a more general question: sometimes the defaults chosen by libvirt are obsolete or broken, and we might want to change them.

Is there a process for changing defaults in libvirt, or libvirt is bound by past decisions forever?

Signature · 1 line
Eduardo
#20 lore raw

Re: [Qemu-devel] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

Quoted 44 lines · Eduardo Habkost
Quoted 37 lines · Daniel P. Berrangé
Quoted 20 lines · Eduardo Habkost

(CCing libvir-list)

Quoted 17 lines · Daniel P. Berrangé
Quoted 15 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Is there an actual promise to never change the default machine-type documented in the libvirt API, or is this just fear of breaking existing code?

The risk of breaking things that currently work. Some of the things discussed here that risk breaking users if QEMU changes the default, have the same risk if libvirt changes the default.

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

Quoted 5 lines

If we want to get q35 broadly used for modern OS, then IMHO the best option is to record that metadata in libosinfo, as ew do for other virtual hardware preferences. That doesn't fix the problem of disk images that might not transparently boot between pc/q35, but at least avoids breaking OS that don't support q35 at all.

Quoted 6 lines

This leads to a more general question: sometimes the defaults chosen by libvirt are obsolete or broken, and we might want to change them.

Is there a process for changing defaults in libvirt, or libvirt is bound by past decisions forever?

The general promise is that if you upgrade libvirt everything an application was doing before should still work in the same way. We also aim to promise that if you upgrade the hypervisor underneath things will still work. This is much harder to guarantee but we'll make reasonable effort to try to present an unchanged view to the mgmt app. Guest ABI is of course most critical part of that but anything that affects APIs a mgmt app is using relevant. This largely precludes changing defaults unless the feature goes away entirely or is unusable in some serious way.

This is why we try to push the idea of policy decisions into a layer above with libosinfo suggesting defaults for individual guest OS.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#30 lore raw
In reply to Daniel P. Berrangé
Quoted 29 lines · Daniel P. Berrangé
Quoted 20 lines · Marcel Apfelbaum
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines · Gerd Hoffmann
   Hi,
Quoted 2 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

It can work, sure. And we can add user hints: "Use q35 for ...., select pc if..."

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Can't libvirt preserve 'pc' for existing domains, while defaulting to q35 the creation of new domains ? This way it aligns with Gerd's proposal of no default x86 machine.

Quoted 7 lines

Existing domains wasn't the case I was concerned about. Consider you have libvirt 4.4.0 intsalled and you deploy a *new* domain from a prebuilt disk image "foo". Now update to a libvirt or QEMU which changes to q35 and try to deploy another new domain from the same prebuilt disk image "foo". It may not work now if that disk image doesn't support q35. That would be a regression from the user's POV, whether libvirt or qemu has changed the default.

How about:
- "create new domain with empty disk" --> i440fx now, q35 later
- "create new domain from domain XML and disk image" --> whatever the domain definition dictates
- "create new domain from disk image and no domain XML" --> assume i440fx forever (with a detailed board / device config that's used for all legacy (definition-less) disk images)
- convince disk image distributors to provide their domain definitions with their disks (need not be libvirt domain XML, other definitions might work)
- write converters from those other definition formats to libvirt XML, or QEMU cfg file?

(I'm with Markus:
<http://mid.mail-archive.com/[email protected]>. Not specifically about OVF, but disk image providers need to start exposing their QEMU configs. And I think they should do that in whatever format their management stack supports.)

Just my two cents, feel free to ignore.

Thanks
Laszlo

#21 lore raw

Re: [Qemu-devel] [libvirt] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

In reply to Eduardo Habkost
Quoted 44 lines · Eduardo Habkost
Quoted 37 lines · Daniel P. Berrangé
Quoted 20 lines · Eduardo Habkost

(CCing libvir-list)

Quoted 17 lines · Daniel P. Berrangé
Quoted 15 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Is there an actual promise to never change the default machine-type documented in the libvirt API, or is this just fear of breaking existing code?

The risk of breaking things that currently work. Some of the things discussed here that risk breaking users if QEMU changes the default, have the same risk if libvirt changes the default.

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

Quoted 5 lines

If we want to get q35 broadly used for modern OS, then IMHO the best option is to record that metadata in libosinfo, as ew do for other virtual hardware preferences. That doesn't fix the problem of disk images that might not transparently boot between pc/q35, but at least avoids breaking OS that don't support q35 at all.

Quoted 6 lines

This leads to a more general question: sometimes the defaults chosen by libvirt are obsolete or broken, and we might want to change them.

Is there a process for changing defaults in libvirt, or libvirt is bound by past decisions forever?

If the default was always recorded in the domain XML it is safe to change it because it will not affect already existing domains or migration but if the default is not recorded in the domain XML there needs to be a lot of compatibility code.

In the past we've changed some of the defaults, for example default device model.

Pavel

#31 lore raw
In reply to Laszlo Ersek
Quoted 38 lines · Laszlo Ersek
Quoted 29 lines · Daniel P. Berrangé
Quoted 20 lines · Marcel Apfelbaum
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines · Gerd Hoffmann
   Hi,
Quoted 2 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

It can work, sure. And we can add user hints: "Use q35 for ...., select pc if..."

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Can't libvirt preserve 'pc' for existing domains, while defaulting to q35 the creation of new domains ? This way it aligns with Gerd's proposal of no default x86 machine.

Quoted 7 lines

Existing domains wasn't the case I was concerned about. Consider you have libvirt 4.4.0 intsalled and you deploy a *new* domain from a prebuilt disk image "foo". Now update to a libvirt or QEMU which changes to q35 and try to deploy another new domain from the same prebuilt disk image "foo". It may not work now if that disk image doesn't support q35. That would be a regression from the user's POV, whether libvirt or qemu has changed the default.

Quoted 2 lines

How about:
- "create new domain with empty disk" --> i440fx now, q35 later

"empty disk" is not something that can be determined by the host - libvirt might not even have direct access to the disk at the time this info would be needed.

Quoted 11 lines

- "create new domain from domain XML and disk image" --> whatever the domain definition dictates
- "create new domain from disk image and no domain XML" --> assume i440fx forever (with a detailed board / device config that's used for all legacy (definition-less) disk images)

- convince disk image distributors to provide their domain definitions with their disks (need not be libvirt domain XML, other definitions might work)

Libvirt domain XML is absolutely not suitable - it is a host specific instantiation of a guest, that is not guaranteed to be portable to any other host.

Funnily enough though, I just remembered that 10 years ago we invented another XML format called "virt-image XML", that went along with a "virt-image" command line tool

https://github.com/virt-manager/virt-manager/blob/2e7d477156e9d0f6fb218fa19fc00d6229d33e85/man/virt-image-xml.pod

This was rarely used because the "virt-image" tool itself was rather broken by design, so we eventually deleted this entirely.

The virt-image XML description though could be resurrected as it is largely relevant to the conversation.

Quoted 2 lines

- write converters from those other definition formats to libvirt XML, or QEMU cfg file?

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#22 lore raw

Re: [Qemu-devel] [libvirt] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

In reply to Pavel Hrdina
Quoted 49 lines · Pavel Hrdina
Quoted 48 lines · Eduardo Habkost
Quoted 37 lines · Daniel P. Berrangé
Quoted 20 lines · Eduardo Habkost

(CCing libvir-list)

Quoted 17 lines · Daniel P. Berrangé
Quoted 15 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Is there an actual promise to never change the default machine-type documented in the libvirt API, or is this just fear of breaking existing code?

The risk of breaking things that currently work. Some of the things discussed here that risk breaking users if QEMU changes the default, have the same risk if libvirt changes the default.

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

Quoted 5 lines

If we want to get q35 broadly used for modern OS, then IMHO the best option is to record that metadata in libosinfo, as ew do for other virtual hardware preferences. That doesn't fix the problem of disk images that might not transparently boot between pc/q35, but at least avoids breaking OS that don't support q35 at all.

This leads to a more general question: sometimes the defaults chosen by libvirt are obsolete or broken, and we might want to change them.

Quoted 7 lines
Quoted 2 lines

Is there a process for changing defaults in libvirt, or libvirt is bound by past decisions forever?

If the default was always recorded in the domain XML it is safe to change it because it will not affect already existing domains or migration but if the default is not recorded in the domain XML there needs to be a lot of compatibility code.

That's the opposite of what Daniel said above, isn't it? The machine-type is always recorded in the domain XML, but it's still considered unsafe to change.

Signature · 1 line
Eduardo
#23 lore raw

Re: [Qemu-devel] [libvirt] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

Quoted 53 lines · Eduardo Habkost
Quoted 52 lines · Pavel Hrdina
Quoted 50 lines · Eduardo Habkost
Quoted 37 lines · Daniel P. Berrangé
Quoted 20 lines · Eduardo Habkost

(CCing libvir-list)

Quoted 17 lines · Daniel P. Berrangé
Quoted 15 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Is there an actual promise to never change the default machine-type documented in the libvirt API, or is this just fear of breaking existing code?

The risk of breaking things that currently work. Some of the things discussed here that risk breaking users if QEMU changes the default, have the same risk if libvirt changes the default.

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

Quoted 5 lines

If we want to get q35 broadly used for modern OS, then IMHO the best option is to record that metadata in libosinfo, as ew do for other virtual hardware preferences. That doesn't fix the problem of disk images that might not transparently boot between pc/q35, but at least avoids breaking OS that don't support q35 at all.

This leads to a more general question: sometimes the defaults chosen by libvirt are obsolete or broken, and we might want to change them.

Is there a process for changing defaults in libvirt, or libvirt is bound by past decisions forever?

Quoted 8 lines
Quoted 4 lines

If the default was always recorded in the domain XML it is safe to change it because it will not affect already existing domains or migration but if the default is not recorded in the domain XML there needs to be a lot of compatibility code.

That's the opposite of what Daniel said above, isn't it? The machine-type is always recorded in the domain XML, but it's still considered unsafe to change.

Yes, I disagree with that Pavel has written here. The domain XML recording of settings is critical for preserving guest ABI for migration, etc, so obviously must be stable. Even if there is *no* domain XML yet, however, libvirt still aims to avoid changes in defaults that are liable to break an existing mgmt application creating guests in future.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#25 lore raw

Re: [Qemu-devel] [libvirt] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

In reply to Eduardo Habkost
Quoted 53 lines · Eduardo Habkost
Quoted 52 lines · Pavel Hrdina
Quoted 50 lines · Eduardo Habkost
Quoted 37 lines · Daniel P. Berrangé
Quoted 20 lines · Eduardo Habkost

(CCing libvir-list)

Quoted 17 lines · Daniel P. Berrangé
Quoted 15 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Is there an actual promise to never change the default machine-type documented in the libvirt API, or is this just fear of breaking existing code?

The risk of breaking things that currently work. Some of the things discussed here that risk breaking users if QEMU changes the default, have the same risk if libvirt changes the default.

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

Quoted 5 lines

If we want to get q35 broadly used for modern OS, then IMHO the best option is to record that metadata in libosinfo, as ew do for other virtual hardware preferences. That doesn't fix the problem of disk images that might not transparently boot between pc/q35, but at least avoids breaking OS that don't support q35 at all.

This leads to a more general question: sometimes the defaults chosen by libvirt are obsolete or broken, and we might want to change them.

Is there a process for changing defaults in libvirt, or libvirt is bound by past decisions forever?

Quoted 8 lines
Quoted 4 lines

If the default was always recorded in the domain XML it is safe to change it because it will not affect already existing domains or migration but if the default is not recorded in the domain XML there needs to be a lot of compatibility code.

That's the opposite of what Daniel said above, isn't it? The machine-type is always recorded in the domain XML, but it's still considered unsafe to change.

It's not opposite. The thing is that some of the defaults are not that easy change for other reasons, not from libvirt POV or because of ABI stability. In general yes, it is possible to change it but in some cases it might not be good idea, one example could be the machine time.

Changing default machine time affects the whole guest and may break a lot of use-cases but changing some default device model if the current default is obsolete and most of the OSes supports the new one should be safe.

Pavel

#24 lore raw

Re: [Qemu-devel] [libvirt] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

In reply to Daniel P. Berrangé
Quoted 63 lines · Daniel P. Berrangé
Quoted 53 lines · Eduardo Habkost
Quoted 52 lines · Pavel Hrdina
Quoted 50 lines · Eduardo Habkost
Quoted 37 lines · Daniel P. Berrangé
Quoted 20 lines · Eduardo Habkost

(CCing libvir-list)

Quoted 17 lines · Daniel P. Berrangé
Quoted 15 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Is there an actual promise to never change the default machine-type documented in the libvirt API, or is this just fear of breaking existing code?

The risk of breaking things that currently work. Some of the things discussed here that risk breaking users if QEMU changes the default, have the same risk if libvirt changes the default.

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

Quoted 5 lines

If we want to get q35 broadly used for modern OS, then IMHO the best option is to record that metadata in libosinfo, as ew do for other virtual hardware preferences. That doesn't fix the problem of disk images that might not transparently boot between pc/q35, but at least avoids breaking OS that don't support q35 at all.

This leads to a more general question: sometimes the defaults chosen by libvirt are obsolete or broken, and we might want to change them.

Is there a process for changing defaults in libvirt, or libvirt is bound by past decisions forever?

Quoted 8 lines
Quoted 4 lines

If the default was always recorded in the domain XML it is safe to change it because it will not affect already existing domains or migration but if the default is not recorded in the domain XML there needs to be a lot of compatibility code.

That's the opposite of what Daniel said above, isn't it? The machine-type is always recorded in the domain XML, but it's still considered unsafe to change.

Quoted 5 lines

Yes, I disagree with that Pavel has written here. The domain XML recording of settings is critical for preserving guest ABI for migration, etc, so obviously must be stable. Even if there is *no* domain XML yet, however, libvirt still aims to avoid changes in defaults that are liable to break an existing mgmt application creating guests in future.

Yes in general we try to avoid changing defaults and no it's possible to do it if there is good reason <568887a32f9985b95d998dd0d675255ea985013f>.

So technically there is a way but usually it's not good idea. I should have noted in the first reply that machine type is huge change and that my statement applies to smaller changes.

Pavel

#33 lore raw
In reply to Daniel P. Berrangé
Quoted 22 lines · Daniel P. Berrangé
Quoted 21 lines · Marcel Apfelbaum
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines · Gerd Hoffmann
    Hi,
Quoted 2 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

It can work, sure. And we can add user hints: "Use q35 for ...., select pc if..."

Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Quoted 6 lines
Quoted 3 lines

Can't libvirt preserve 'pc' for existing domains, while defaulting to q35 the creation of new domains ? This way it aligns with Gerd's proposal of no default x86 machine.

Existing domains wasn't the case I was concerned about. Consider you have libvirt 4.4.0 intsalled and you deploy a *new* domain from a prebuilt disk image "foo".

Using Laszlo idea (I think):
 1) disk image "foo"/no info -> use 'pc' machine.
 2) no prebuild image (clean install?) ->  use q35 and add this info to xml In the meantime find a way to embed the supported machine type(s) in the image. (I think the above idea was already discussed, not sure what was the conclusion )

Thanks,
Marcel

Quoted 8 lines

Now update to a libvirt or QEMU which changes to q35
and try to deploy another new domain from the same prebuilt disk image "foo". It may not work now if that disk image doesn't support q35. That would be a regression from the user's POV, whether libvirt or qemu has changed the default.

Regards,
Daniel

#34 lore raw
Quoted 28 lines · Marcel Apfelbaum
Quoted 25 lines · Daniel P. Berrangé
Quoted 24 lines · Marcel Apfelbaum
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines · Gerd Hoffmann
    Hi,
Quoted 2 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

It can work, sure. And we can add user hints: "Use q35 for ...., select pc if..."

Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Can't libvirt preserve 'pc' for existing domains, while defaulting to q35 the creation of new domains ? This way it aligns with Gerd's proposal of no default x86 machine.

Quoted 7 lines
Quoted 3 lines

Existing domains wasn't the case I was concerned about. Consider you have libvirt 4.4.0 intsalled and you deploy a *new* domain from a prebuilt disk image "foo".

Using Laszlo idea (I think):
 1) disk image "foo"/no info -> use 'pc' machine.
 2) no prebuild image (clean install?) ->  use q35 and add this info to xml

NB there's no reliable distinction of "new" from "old" guest install from libvirt's POV. When we receive XML from an application we've no way of knowing if this is a brand new guest about to be installed or a previously installed guest.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#26 lore raw

Re: [Qemu-devel] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

In reply to Daniel P. Berrangé
Quoted 3 lines · Daniel P. Berrangé

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

I don't understand that part - when using libvirt domain xml records the machine type used for the install, so it seems that installed images won't be affected.

Signature · 1 line
MST
#35 lore raw
In reply to Daniel P. Berrangé
Quoted 3 lines · Daniel P. Berrangé

Existing domains wasn't the case I was concerned about. Consider you have libvirt 4.4.0 intsalled and you deploy a *new* domain from a prebuilt disk image "foo".

I see. How about q35 as default for new domains only?

Signature · 1 line
MST
#32 lore raw
In reply to Daniel P. Berrangé
Quoted 66 lines · Daniel P. Berrangé
Quoted 38 lines · Laszlo Ersek
Quoted 29 lines · Daniel P. Berrangé
Quoted 20 lines · Marcel Apfelbaum
Quoted 5 lines · Daniel P. Berrangé
Quoted 4 lines · Gerd Hoffmann
   Hi,
Quoted 2 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

It can work, sure. And we can add user hints: "Use q35 for ...., select pc if..."

Quoted 7 lines
Quoted 3 lines

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Can't libvirt preserve 'pc' for existing domains, while defaulting to q35 the creation of new domains ? This way it aligns with Gerd's proposal of no default x86 machine.

Quoted 7 lines

Existing domains wasn't the case I was concerned about. Consider you have libvirt 4.4.0 intsalled and you deploy a *new* domain from a prebuilt disk image "foo". Now update to a libvirt or QEMU which changes to q35 and try to deploy another new domain from the same prebuilt disk image "foo". It may not work now if that disk image doesn't support q35. That would be a regression from the user's POV, whether libvirt or qemu has changed the default.

Quoted 2 lines

How about:
- "create new domain with empty disk" --> i440fx now, q35 later

"empty disk" is not something that can be determined by the host - libvirt might not even have direct access to the disk at the time this info would be needed.

Quoted 11 lines

- "create new domain from domain XML and disk image" --> whatever the domain definition dictates
- "create new domain from disk image and no domain XML" --> assume i440fx forever (with a detailed board / device config that's used for all legacy (definition-less) disk images)

- convince disk image distributors to provide their domain definitions with their disks (need not be libvirt domain XML, other definitions might work)

Libvirt domain XML is absolutely not suitable - it is a host specific instantiation of a guest, that is not guaranteed to be portable to any other host.

Funnily enough though, I just remembered that 10 years ago we invented another XML format called "virt-image XML", that went along with a "virt-image" command line tool

Quoted 7 lines

https://github.com/virt-manager/virt-manager/blob/2e7d477156e9d0f6fb218fa19fc00d6229d33e85/man/virt-image-xml.pod

This was rarely used because the "virt-image" tool itself was rather broken by design, so we eventually deleted this entirely.

The virt-image XML description though could be resurrected as it is largely relevant to the conversation.

Oh, that might be a nice thing to put into qcow2 meta-data. (Hopefully in a format that's easier to parse and write than xml).

Quoted 9 lines
Quoted 2 lines

- write converters from those other definition formats to libvirt XML, or QEMU cfg file?

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#27 lore raw

Re: [Qemu-devel] libvirt default machine-type guarantees? (was Re: [PATCH RFC] hw/pc: set q35 as the default x86 machine)

In reply to Michael S. Tsirkin
Quoted 8 lines · Michael S. Tsirkin
Quoted 3 lines · Daniel P. Berrangé

eg old OS versions that only work with PC, or more commonly pre-existing cloud disk images that were built against PC can't be assumed to just work against q35, even if the OS in the image supports it.

I don't understand that part - when using libvirt domain xml records the machine type used for the install, so it seems that installed images won't be affected.

There's no libvirt XML for distributed cloud images, it is created whenever the image is instantiated. Libvirt also doesn't require use of its persistent guest feature - it is possible to create so called "transient" guests with libvirt where you just provide an XML doc at each boot up, and libvirt does not save this XML between boots. Even if an app is using persistent libvirt XML they might not boot the VM on the same host each time, so the previous persistent XML may not be available at next boot up. So there's many ways existing deployed guests can be affected by changes in defaults, even when libvirt records info in the XML.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#36 lore raw
In reply to Michael S. Tsirkin
Quoted 6 lines · Michael S. Tsirkin
Quoted 3 lines · Daniel P. Berrangé

Existing domains wasn't the case I was concerned about. Consider you have libvirt 4.4.0 intsalled and you deploy a *new* domain from a prebuilt disk image "foo".

I see. How about q35 as default for new domains only?

There's no concept of "new" or "old" domains in libvirt. It just sees XML and boots it and has no way of knowing if this is a brand new deployment never booted before or an old deployed booted for the 1000th time.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#37 lore raw
Quoted 6 lines · Daniel P. Berrangé
Quoted 5 lines · Michael S. Tsirkin
Quoted 3 lines · Daniel P. Berrangé

Existing domains wasn't the case I was concerned about. Consider you have libvirt 4.4.0 intsalled and you deploy a *new* domain from a prebuilt disk image "foo".

Quoted 8 lines
Quoted 1 line

I see. How about q35 as default for new domains only?

There's no concept of "new" or "old" domains in libvirt. It just sees XML and boots it and has no way of knowing if this is a brand new deployment never booted before or an old deployed booted for the 1000th time.

Regards,
Daniel

Oh I mean when XML is created using e.g. virt-install

Quoted 4 lines
Signature · 3 lines
|: 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 :|
#38 lore raw
In reply to Daniel P. Berrangé

Getting back to this discussion:

Quoted 12 lines · Daniel P. Berrangé
Quoted 11 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Quoted 8 lines
Quoted 4 lines

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

I believe there's consensus that applications blindly relying on the default machine-type when creating a domain is a bad idea.

That said, can we deprecate this feature in libvirt, encourage applications to always specify an explicit machine-type, thus making it possible to deprecate the i440fx machine-types one day?

Signature · 1 line
Eduardo
#39 lore raw
Quoted 24 lines · Eduardo Habkost

Getting back to this discussion:

Quoted 12 lines · Daniel P. Berrangé
Quoted 11 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Quoted 8 lines
Quoted 4 lines

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Quoted 6 lines

I believe there's consensus that applications blindly relying on the default machine-type when creating a domain is a bad idea.

That said, can we deprecate this feature in libvirt, encourage applications to always specify an explicit machine-type, thus making it possible to deprecate the i440fx machine-types one day?

Well from libvirt's POV this scenario arrives if a mgmt app simply omits the relevant element/attribute from the XML config. Deprecating something implies that in future we'd drop support for it, but we're never going to make this mandatory in libvirt as that would be a regression in behaviour from libvirt's POV. So I don't think it is something we would deprecate.

I'm happy to see an update to the XML docs to strongly recommend that apps always provide a machine type though. Many will likely already be doing so with aarch64 to get the "virt" machine type anyway, since the default libvirt picks is often not suitable.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#40 lore raw
Quoted 32 lines · Daniel P. Berrangé
Quoted 24 lines · Eduardo Habkost

Getting back to this discussion:

Quoted 12 lines · Daniel P. Berrangé
Quoted 11 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Quoted 8 lines
Quoted 4 lines

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Quoted 6 lines

I believe there's consensus that applications blindly relying on the default machine-type when creating a domain is a bad idea.

That said, can we deprecate this feature in libvirt, encourage applications to always specify an explicit machine-type, thus making it possible to deprecate the i440fx machine-types one day?

Quoted 6 lines

Well from libvirt's POV this scenario arrives if a mgmt app simply omits the relevant element/attribute from the XML config. Deprecating something implies that in future we'd drop support for it, but we're never going to make this mandatory in libvirt as that would be a regression in behaviour from libvirt's POV. So I don't think it is something we would deprecate.

Does libvirt really have an option, here? I'm sure that sooner or later somebody will distribute QEMU binaries without "pc".

Quoted 4 lines

I'm happy to see an update to the XML docs to strongly recommend that apps always provide a machine type though. Many will likely already be doing so with aarch64 to get the "virt" machine type anyway, since the default libvirt picks is often not suitable.

Well, if you don't want to explicitly remove the default-is-pc feature from libvirt, strongly recommending against it (and letting people know that it may stop working in the future) might be enough.

Signature · 1 line
Eduardo
#41 lore raw
Quoted 40 lines · Eduardo Habkost
Quoted 32 lines · Daniel P. Berrangé
Quoted 24 lines · Eduardo Habkost

Getting back to this discussion:

Quoted 12 lines · Daniel P. Berrangé
Quoted 11 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Quoted 8 lines
Quoted 4 lines

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Quoted 6 lines

I believe there's consensus that applications blindly relying on the default machine-type when creating a domain is a bad idea.

That said, can we deprecate this feature in libvirt, encourage applications to always specify an explicit machine-type, thus making it possible to deprecate the i440fx machine-types one day?

Quoted 6 lines

Well from libvirt's POV this scenario arrives if a mgmt app simply omits the relevant element/attribute from the XML config. Deprecating something implies that in future we'd drop support for it, but we're never going to make this mandatory in libvirt as that would be a regression in behaviour from libvirt's POV. So I don't think it is something we would deprecate.

Quoted 2 lines

Does libvirt really have an option, here? I'm sure that sooner or later somebody will distribute QEMU binaries without "pc".

Sure if someone does that, we'll have no choice, but as long as 'pc' is shipped we shouldn't gratuitously break apps by changing the default.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#42 lore raw
Quoted 41 lines · Daniel P. Berrangé
Quoted 40 lines · Eduardo Habkost
Quoted 38 lines · Daniel P. Berrangé
Quoted 24 lines · Eduardo Habkost

Getting back to this discussion:

Quoted 12 lines · Daniel P. Berrangé
Quoted 11 lines · Gerd Hoffmann

Hi,

Quoted 4 lines
Quoted 2 lines

Add to that shortcuts like -cdrom
stop working,

Maybe is fixable.

Already fixed for ages.

Quoted 1 line

I see marking Q35 as the default machine a first step.

Quoted 8 lines
Quoted 4 lines

Maybe the better option is to go the arm route: Just don't define a default, so users have to specify pc or q35. That will make them notice there is a world beside 'pc', and we also avoid breaking things silently.

If QEMU removes the default, then libvirt will have to hardcode 'pc' as the default to maintain back compatibility, so I don't think that ends up as a net win

Quoted 6 lines

I believe there's consensus that applications blindly relying on the default machine-type when creating a domain is a bad idea.

That said, can we deprecate this feature in libvirt, encourage applications to always specify an explicit machine-type, thus making it possible to deprecate the i440fx machine-types one day?

Well from libvirt's POV this scenario arrives if a mgmt app simply omits the relevant element/attribute from the XML config. Deprecating something implies that in future we'd drop support for it, but we're never going to make this mandatory in libvirt as that would be a regression in behaviour from libvirt's POV. So I don't think it is something we would deprecate.

Quoted 5 lines
Quoted 2 lines

Does libvirt really have an option, here? I'm sure that sooner or later somebody will distribute QEMU binaries without "pc".

Sure if someone does that, we'll have no choice, but as long as 'pc' is shipped we shouldn't gratuitously break apps by changing the default.

Right. I just want to make sure "omitting the machine-type may stop working in the future" is documented somehow.

Signature · 1 line
Eduardo
#43 lore raw
Quoted 5 lines · Eduardo Habkost
Quoted 2 lines

Sure if someone does that, we'll have no choice, but as long as 'pc' is shipped we shouldn't gratuitously break apps by changing the default.

Right. I just want to make sure "omitting the machine-type may stop working in the future" is documented somehow.

I still think we should just add links to the qemu binary and use ARGV to detect the machine type.

qemu-pc-i386
qemu-q35-x86_64

etc.

Quoted 2 lines
Signature · 1 line
Eduardo
#44 lore raw
Quoted 4 lines · Michael S. Tsirkin
Quoted 3 lines · Eduardo Habkost
Quoted 2 lines

Sure if someone does that, we'll have no choice, but as long as 'pc' is shipped we shouldn't gratuitously break apps by changing the default.

Quoted 8 lines
Quoted 2 lines

Right. I just want to make sure "omitting the machine-type may stop working in the future" is documented somehow.

I still think we should just add links to the qemu binary and use ARGV to detect the machine type.

qemu-pc-i386
qemu-q35-x86_64

Why having separate QEMU binaries would help? We still need to define and document what will happen when both the machine-type and the QEMU binary are omitted in the domain XML.

Personally I prefer to document this as "we recommend you always specify the machine-type" instead of "we recommend you always specify the QEMU binary path".

Signature · 1 line
Eduardo
#46 lore raw
In reply to Michael S. Tsirkin
Quoted 4 lines · Michael S. Tsirkin
Quoted 3 lines · Eduardo Habkost
Quoted 2 lines

Sure if someone does that, we'll have no choice, but as long as 'pc' is shipped we shouldn't gratuitously break apps by changing the default.

Quoted 8 lines
Quoted 2 lines

Right. I just want to make sure "omitting the machine-type may stop working in the future" is documented somehow.

I still think we should just add links to the qemu binary and use ARGV to detect the machine type.

qemu-pc-i386
qemu-q35-x86_64

Do you really want 60 different qemu-something-arm symlinks?

thanks
-- PMM

#47 lore raw
Quoted 8 lines · Peter Maydell
Quoted 7 lines · Michael S. Tsirkin
Quoted 5 lines · Eduardo Habkost
Quoted 2 lines

Sure if someone does that, we'll have no choice, but as long as 'pc' is shipped we shouldn't gratuitously break apps by changing the default.

Right. I just want to make sure "omitting the machine-type may stop working in the future" is documented somehow.

Quoted 7 lines
Quoted 5 lines

I still think we should just add links to the qemu binary and use ARGV to detect the machine type.

qemu-pc-i386
qemu-q35-x86_64

Do you really want 60 different qemu-something-arm symlinks?

Absolutely not !

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#45 lore raw
In reply to Eduardo Habkost
Quoted 11 lines · Eduardo Habkost
Quoted 10 lines · Michael S. Tsirkin
Quoted 5 lines · Eduardo Habkost
Quoted 2 lines

Sure if someone does that, we'll have no choice, but as long as 'pc' is shipped we shouldn't gratuitously break apps by changing the default.

Right. I just want to make sure "omitting the machine-type may stop working in the future" is documented somehow.

I still think we should just add links to the qemu binary and use ARGV to detect the machine type.

Quoted 6 lines
Quoted 2 lines

qemu-pc-i386
qemu-q35-x86_64

Why having separate QEMU binaries would help? We still need to define and document what will happen when both the machine-type and the QEMU binary are omitted in the domain XML.

It would not help libvirt at all, and in fact it would cause extra pain for applications, because we don't have ability to associated separate QEMU binaries with machine types in our capabilities design. So not only would libvirt need changing, but apps using libvirt too.

Quoted 3 lines

Personally I prefer to document this as "we recommend you always specify the machine-type" instead of "we recommend you always specify the QEMU binary path".

Indeed, the former is something apps already do in many cases.

Regards,
Daniel

Signature · 3 lines
|: 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 :|