hw/i386/pc_piix.c: Also pass vmport=off for xenfv machine
PATCH 1/1 hw/i386/pc_piix.c: Also pass vmport=off for xenfv machine
c/s 9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4
or
c/s b154537ad07598377ebf98252fb7d2aff127983b
moved the testing of xen_enabled() from pc_init1() to pc_machine_initfn().
xen_enabled() does not return the correct value in pc_machine_initfn() so add vmport=off to xenfv machine to correctly turn off vmport for xen.
Drop the call to xen_enabled() in pc_machine_initfn() to reduce potential confusion.
---
The 1st version of "-machine vmport=off: Allow..." patch did not have this issue. It was the adjusting to the QOM that introduced it.
hw/i386/pc.c | 2 +- hw/i386/pc_piix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/i386/pc.c +1 -1
@@ -1737,7 +1737,7 @@ static void pc_machine_initfn(Object *obj) pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL, NULL); - pcms->vmport = !xen_enabled (); + pcms->vmport = true; object_property_add_bool(obj, PC_MACHINE_VMPORT, pc_machine_get_vmport, pc_machine_set_vmport,
hw/i386/pc_piix.c +1 -1
@@ -914,7 +914,7 @@ static QEMUMachine xenfv_machine = { .desc = "Xen Fully-virtualized PC", .init = pc_xen_hvm_init, .max_cpus = HVM_MAX_VCPUS, - .default_machine_opts = "accel=xen", + .default_machine_opts = "accel=xen,vmport=off", .hot_add_cpu = pc_hot_add_cpu, };#endif
Signature · 1 line
1.8.4
Quoted 46 lines · Don Slutz
c/s
9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4or
c/s
b154537ad07598377ebf98252fb7d2aff127983bmoved the testing of
xen_enabled()frompc_init1()topc_machine_initfn().
xen_enabled()does not return the correct value inpc_machine_initfn()so add vmport=off to xenfv machine to correctly turn off vmport for xen.Drop the call to
xen_enabled()inpc_machine_initfn()to reduce potential confusion.Signed-off-by Don Slutz <[email protected]>---
The 1st version of "-machine vmport=off: Allow..." patch did not have this issue. It was the adjusting to the QOM that introduced it.
hw/i386/pc.c | 2 +- hw/i386/pc_piix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)hw/i386/pc.c +1
-1@@ -1737,7 +1737,7 @@ static void pc_machine_initfn(Object *obj) pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL, NULL); - pcms->vmport = !xen_enabled (); + pcms->vmport = true; object_property_add_bool(obj, PC_MACHINE_VMPORT, pc_machine_get_vmport, pc_machine_set_vmport,hw/i386/pc_piix.c +0
-0
hw/i386/pc_piix.c static QEMUMachine xenfv_machine = { · line 920
Quoted 8 lines
hw/i386/pc_piix.c +1
-1@@ -914,7 +914,7 @@ static QEMUMachine xenfv_machine = { .desc = "Xen Fully-virtualized PC", .init = pc_xen_hvm_init, .max_cpus = HVM_MAX_VCPUS, - .default_machine_opts = "accel=xen", + .default_machine_opts = "accel=xen,vmport=off", .hot_add_cpu = pc_hot_add_cpu, };#endif
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Paolo
Quoted 59 lines · Paolo Bonzini
Quoted 46 lines · Don Slutz
c/s
9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4or
c/s
b154537ad07598377ebf98252fb7d2aff127983bmoved the testing of
xen_enabled()frompc_init1()topc_machine_initfn().
xen_enabled()does not return the correct value inpc_machine_initfn()so add vmport=off to xenfv machine to correctly turn off vmport for xen.Drop the call to
xen_enabled()inpc_machine_initfn()to reduce potential confusion.Signed-off-by Don Slutz <[email protected]>---
The 1st version of "-machine vmport=off: Allow..." patch did not have this issue. It was the adjusting to the QOM that introduced it.
hw/i386/pc.c | 2 +- hw/i386/pc_piix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)hw/i386/pc.c +1
-1@@ -1737,7 +1737,7 @@ static void pc_machine_initfn(Object *obj) pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL, NULL); - pcms->vmport = !xen_enabled (); + pcms->vmport = true; object_property_add_bool(obj, PC_MACHINE_VMPORT, pc_machine_get_vmport, pc_machine_set_vmport,hw/i386/pc_piix.c +0
-0hw/i386/pc_piix.c static QEMUMachine xenfv_machine = { · line 920
Quoted 8 lines
hw/i386/pc_piix.c +1
-1@@ -914,7 +914,7 @@ static QEMUMachine xenfv_machine = { .desc = "Xen Fully-virtualized PC", .init = pc_xen_hvm_init, .max_cpus = HVM_MAX_VCPUS, - .default_machine_opts = "accel=xen", + .default_machine_opts = "accel=xen,vmport=off", .hot_add_cpu = pc_hot_add_cpu, };#endif "-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Quoted 1 line
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work. However you bring up a good point and I will see if I can quickly handled it.
-Don Slutz
Quoted 7 lines · Don Slutz
Quoted 5 lines
Quoted 1 line
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work.
Right. So let's start by deciding what the desired semantics are for all six cases: -M pc/xenfv, -machine vmport=on/off/absent.
Paolo
Quoted 1 line
However you bring up a good point and I will see if I can quickly handled it.
Quoted 11 lines · Paolo Bonzini
Quoted 5 lines · Don Slutz
Quoted 4 lines
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work.
Right. So let's start by deciding what the desired semantics are for all six cases: -M pc/xenfv, -machine vmport=on/off/absent.
Paolo
I get 12 cases (PCMachineState *pcms = PC_MACHINE(obj)):
-M pc
pcms->vmport is true
-M pc -machine vmport=on
pcms->vmport is true
-M pc -machine vmport=off
pcms->vmport is false
-M xenfv
pcms->vmport is false
-M xenfv -machine vmport=on
pcms->vmport is true
-M xenfv -machine vmport=off
pcms->vmport is false-M pc -machine accel=xen
pcms->vmport is false
-M pc -machine vmport=on,accel=xen
pcms->vmport is true
-M pc -machine vmport=off,accel=xen
pcms->vmport is false
-M xenfv -machine accel=xen
pcms->vmport is false
-M xenfv -machine vmport=on,accel=xen
pcms->vmport is true
-M xenfv -machine vmport=off,accel=xen
pcms->vmport is falseWhich look like to me to solve down to xen_init() called via xen_accel_class_init() need to see if vmport has been specified and change it if needed.
Which leads me to:
commit 436d056420bb209d066d2378b628d297777d9f20
Author: Don Slutz <[email protected]> Date: Wed Nov 19 10:01:16 2014 -0500
hw/i386/pc_piix.c: Also pass vmport=off for xenfv machine
c/s 9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4
or
c/s b154537ad07598377ebf98252fb7d2aff127983b
moved the testing of xen_enabled() from pc_init1() to pc_machine_initfn().
xen_enabled() does not return the correct value in pc_machine_initfn().
Add vmport_changed to track the state of vmport so that accel=xen can do the right thing.
Drop the call to xen_enabled() in pc_machine_initfn() to reduce potential confusion.
hw/i386/pc.c +2 -1
@@ -1723,6 +1723,7 @@ static void pc_machine_set_vmport(Object *obj, bool value, Error **errp)PCMachineState *pcms =PC_MACHINE (obj); pcms->vmport = value; + pcms->vmport_changed = true; }static void pc_machine_initfn (Object *obj)
@@ -1737,7 +1738,7 @@ static void pc_machine_initfn(Object *obj) pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL, NULL); - pcms->vmport = !xen_enabled (); + pcms->vmport = true; object_property_add_bool(obj, PC_MACHINE_VMPORT, pc_machine_get_vmport, pc_machine_set_vmport,
include/hw/i386/pc.h +1 -0
@@ -38,6 +38,7 @@ struct PCMachineState {uint64_t max_ram_below_4g;bool vmport; +bool vmport_changed; };#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
xen-common.c +6 -0
@@ -12,6 +12,7 @@#include "qmp-commands.h" #include "sysemu/char.h" #include "sysemu/accel.h" +#include "hw/i386/pc.h" //#define DEBUG_XEN
@@ -112,6 +113,11 @@ static void xen_change_state_handler(void *opaque, int running,static int xen_init (MachineState *ms) { +PCMachineState *pcms =PC_MACHINE (ms); + +if (!pcms->vmport_changed) { + pcms->vmport = false; + } xen_xc =xen_xc_interface_open (0 ,0 ,0 );if (xen_xc ==XC_HANDLER_INITIAL_VALUE ) {xen_be_printf (NULL ,0 ,"can't open xen interface\n" );
-Don Slutz
Quoted 1 line
Quoted 1 line
However you bring up a good point and I will see if I can quickly handled it.
P.S. I think the title:
xen-common.c: If "-machine vmport=" is not specified turn vmport off
is better. Will send v2 of patch out soon.
-Don Slutz
Quoted 143 lines · Don Slutz
Quoted 11 lines · Paolo Bonzini
Quoted 5 lines · Don Slutz
Quoted 4 lines
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work.
Right. So let's start by deciding what the desired semantics are for all six cases: -M pc/xenfv, -machine vmport=on/off/absent.
Paolo
I get 12 cases (PCMachineState *pcms =
PC_MACHINE(obj)):(quoted diff) +0
-12-M pc pcms->vmport is true -M pc -machine vmport=on pcms->vmport is true -M pc -machine vmport=off pcms->vmport is false -M xenfv pcms->vmport is false -M xenfv -machine vmport=on pcms->vmport is true -M xenfv -machine vmport=off pcms->vmport is false -M pc -machine accel=xen pcms->vmport is false -M pc -machine vmport=on,accel=xen pcms->vmport is true -M pc -machine vmport=off,accel=xen pcms->vmport is false -M xenfv -machine accel=xen pcms->vmport is false -M xenfv -machine vmport=on,accel=xen pcms->vmport is true -M xenfv -machine vmport=off,accel=xen pcms->vmport is falseWhich look like to me to solve down to
xen_init()called viaxen_accel_class_init()need to see if vmport has been specified and change it if needed.Which leads me to:
commit
436d056420bb209d066d2378b628d297777d9f20Author: Don Slutz <[email protected]> Date: Wed Nov 19 10:01:16 2014 -0500
hw/i386/pc_piix.c: Also pass vmport=off for xenfv machinec/s
9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4or
c/s
b154537ad07598377ebf98252fb7d2aff127983bmoved the testing of
xen_enabled()frompc_init1()topc_machine_initfn().
xen_enabled()does not return the correct value inpc_machine_initfn().Add
vmport_changedto track the state of vmport so that accel=xen can do the right thing.Drop the call to
xen_enabled()inpc_machine_initfn()to reduce potential confusion.Signed-off-by Don Slutz <[email protected]>hw/i386/pc.c +1
-0@@ -1723,6 +1723,7 @@ static void pc_machine_set_vmport(Object *obj, bool value, Error **errp) PCMachineState *pcms = PC_MACHINE(obj); pcms->vmport = value; + pcms->vmport_changed = true; }static void
pc_machine_initfn(Object *obj)hw/i386/pc.c +1
-1@@ -1737,7 +1738,7 @@ static void pc_machine_initfn(Object *obj) pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, NULL, NULL, NULL); - pcms->vmport = !xen_enabled (); + pcms->vmport = true; object_property_add_bool(obj, PC_MACHINE_VMPORT, pc_machine_get_vmport, pc_machine_set_vmport,include/hw/i386/pc.h +1
-0@@ -38,6 +38,7 @@ struct PCMachineState {uint64_t max_ram_below_4g;bool vmport; +bool vmport_changed; };#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"xen-common.c +6
-0@@ -12,6 +12,7 @@#include "qmp-commands.h" #include "sysemu/char.h" #include "sysemu/accel.h" +#include "hw/i386/pc.h" //#define DEBUG_XEN @@ -112,6 +113,11 @@ static void xen_change_state_handler(void *opaque, int running, static int xen_init(MachineState *ms) { +PCMachineState *pcms =PC_MACHINE (ms); + +if (!pcms->vmport_changed) { + pcms->vmport = false; + } xen_xc =xen_xc_interface_open (0 ,0 ,0 );if (xen_xc ==XC_HANDLER_INITIAL_VALUE ) {xen_be_printf(NULL, 0, "can't open xen interface\n");-Don Slutz
Quoted 1 line
Quoted 1 line
However you bring up a good point and I will see if I can quickly handled it.
Quoted 49 lines · Don Slutz
Quoted 10 lines · Paolo Bonzini
Quoted 5 lines · Don Slutz
Quoted 4 lines
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work.
Right. So let's start by deciding what the desired semantics are for all six cases: -M pc/xenfv, -machine vmport=on/off/absent.
Paolo
I get 12 cases (PCMachineState *pcms =
PC_MACHINE(obj)):(quoted diff) +0
-12-M pc pcms->vmport is true -M pc -machine vmport=on pcms->vmport is true -M pc -machine vmport=off pcms->vmport is false -M xenfv pcms->vmport is false -M xenfv -machine vmport=on pcms->vmport is true -M xenfv -machine vmport=off pcms->vmport is false -M pc -machine accel=xen pcms->vmport is false -M pc -machine vmport=on,accel=xen pcms->vmport is true -M pc -machine vmport=off,accel=xen pcms->vmport is false -M xenfv -machine accel=xen pcms->vmport is false -M xenfv -machine vmport=on,accel=xen pcms->vmport is true -M xenfv -machine vmport=off,accel=xen pcms->vmport is falseWhich look like to me to solve down to
xen_init()called viaxen_accel_class_init()
need to see if vmport has been specified and change it if needed.Which leads me to:
[...]
include/hw/i386/pc.h struct PCMachineState { · line 41
Quoted 9 lines
include/hw/i386/pc.h +1
-0@@ -38,6 +38,7 @@ struct PCMachineState {uint64_t max_ram_below_4g;bool vmport; +bool vmport_changed;
So, now the setting have three possible states: unset, on, and off.
If we can't avoid that (which seems to be the case, as "accel" is changed after we already set the default value for "vmport" in instance init), maybe we should make it an enum property that accepts on/off/auto as values, instead of faking a boolean property that is not really a boolean?
Signature · 1 line
Eduardo
Quoted 61 lines · Eduardo Habkost
Quoted 48 lines · Don Slutz
Quoted 10 lines · Paolo Bonzini
Quoted 5 lines · Don Slutz
Quoted 4 lines
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work.
Right. So let's start by deciding what the desired semantics are for all six cases: -M pc/xenfv, -machine vmport=on/off/absent.
Paolo
I get 12 cases (PCMachineState *pcms =
PC_MACHINE(obj)):(quoted diff) +0
-12-M pc pcms->vmport is true -M pc -machine vmport=on pcms->vmport is true -M pc -machine vmport=off pcms->vmport is false -M xenfv pcms->vmport is false -M xenfv -machine vmport=on pcms->vmport is true -M xenfv -machine vmport=off pcms->vmport is false -M pc -machine accel=xen pcms->vmport is false -M pc -machine vmport=on,accel=xen pcms->vmport is true -M pc -machine vmport=off,accel=xen pcms->vmport is false -M xenfv -machine accel=xen pcms->vmport is false -M xenfv -machine vmport=on,accel=xen pcms->vmport is true -M xenfv -machine vmport=off,accel=xen pcms->vmport is falseWhich look like to me to solve down to
xen_init()called viaxen_accel_class_init()
need to see if vmport has been specified and change it if needed.Which leads me to:
[...]
include/hw/i386/pc.h struct PCMachineState { · line 41
Quoted 9 lines
include/hw/i386/pc.h +1
-0@@ -38,6 +38,7 @@ struct PCMachineState {uint64_t max_ram_below_4g;bool vmport; +bool vmport_changed;So, now the setting have three possible states: unset, on, and off.
Quoted 6 lines
If we can't avoid that (which seems to be the case, as "accel" is changed after we already set the default value for "vmport" in instance init), maybe we should make it an enum property that accepts on/off/auto as values, instead of faking a boolean property that is not really a boolean?
I would be happy to look into this. I have not done anything that used an enum property, and so it is hard to guess on how long it will take to convert the change to this.
-Don Slutz
Quoted 69 lines · Don Slutz
Quoted 61 lines · Eduardo Habkost
Quoted 48 lines · Don Slutz
Quoted 10 lines · Paolo Bonzini
Quoted 5 lines · Don Slutz
Quoted 4 lines
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work.
Right. So let's start by deciding what the desired semantics are for all six cases: -M pc/xenfv, -machine vmport=on/off/absent.
Paolo
I get 12 cases (PCMachineState *pcms =
PC_MACHINE(obj)):(quoted diff) +0
-12-M pc pcms->vmport is true -M pc -machine vmport=on pcms->vmport is true -M pc -machine vmport=off pcms->vmport is false -M xenfv pcms->vmport is false -M xenfv -machine vmport=on pcms->vmport is true -M xenfv -machine vmport=off pcms->vmport is false -M pc -machine accel=xen pcms->vmport is false -M pc -machine vmport=on,accel=xen pcms->vmport is true -M pc -machine vmport=off,accel=xen pcms->vmport is false -M xenfv -machine accel=xen pcms->vmport is false -M xenfv -machine vmport=on,accel=xen pcms->vmport is true -M xenfv -machine vmport=off,accel=xen pcms->vmport is falseWhich look like to me to solve down to
xen_init()called viaxen_accel_class_init()
need to see if vmport has been specified and change it if needed.Which leads me to:
[...]
include/hw/i386/pc.h struct PCMachineState { · line 41
Quoted 9 lines
include/hw/i386/pc.h +1
-0@@ -38,6 +38,7 @@ struct PCMachineState {uint64_t max_ram_below_4g;bool vmport; +bool vmport_changed;So, now the setting have three possible states: unset, on, and off.
Quoted 6 lines
If we can't avoid that (which seems to be the case, as "accel" is changed after we already set the default value for "vmport" in instance init), maybe we should make it an enum property that accepts on/off/auto as values, instead of faking a boolean property that is not really a boolean?
Quoted 3 lines
I would be happy to look into this. I have not done anything that used an enum property, and so it is hard to guess on how long it will take to convert the change to this.
I think your patch may be a good intermediate solution, as long as you add a comment noting that the return value of the "vmport" property may be invalid before machine->init() is called, depending on the machine-type.
Or, maybe a property without a getter would be appropriate?
Signature · 1 line
Eduardo
Quoted 72 lines · Eduardo Habkost
Quoted 68 lines · Don Slutz
Quoted 61 lines · Eduardo Habkost
Quoted 48 lines · Don Slutz
Quoted 10 lines · Paolo Bonzini
Quoted 5 lines · Don Slutz
Quoted 4 lines
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work.
Right. So let's start by deciding what the desired semantics are for all six cases: -M pc/xenfv, -machine vmport=on/off/absent.
Paolo
I get 12 cases (PCMachineState *pcms =
PC_MACHINE(obj)):(quoted diff) +0
-12-M pc pcms->vmport is true -M pc -machine vmport=on pcms->vmport is true -M pc -machine vmport=off pcms->vmport is false -M xenfv pcms->vmport is false -M xenfv -machine vmport=on pcms->vmport is true -M xenfv -machine vmport=off pcms->vmport is false -M pc -machine accel=xen pcms->vmport is false -M pc -machine vmport=on,accel=xen pcms->vmport is true -M pc -machine vmport=off,accel=xen pcms->vmport is false -M xenfv -machine accel=xen pcms->vmport is false -M xenfv -machine vmport=on,accel=xen pcms->vmport is true -M xenfv -machine vmport=off,accel=xen pcms->vmport is falseWhich look like to me to solve down to
xen_init()called viaxen_accel_class_init()
need to see if vmport has been specified and change it if needed.Which leads me to:
[...]
include/hw/i386/pc.h struct PCMachineState { · line 41
Quoted 9 lines
include/hw/i386/pc.h +1
-0@@ -38,6 +38,7 @@ struct PCMachineState {uint64_t max_ram_below_4g;bool vmport; +bool vmport_changed;So, now the setting have three possible states: unset, on, and off.
Quoted 6 lines
If we can't avoid that (which seems to be the case, as "accel" is changed after we already set the default value for "vmport" in instance init), maybe we should make it an enum property that accepts on/off/auto as values, instead of faking a boolean property that is not really a boolean?
Quoted 3 lines
I would be happy to look into this. I have not done anything that used an enum property, and so it is hard to guess on how long it will take to convert the change to this.
Quoted 7 lines
I think your patch may be a good intermediate solution, as long as you add a comment noting that the return value of the "vmport" property may be invalid before
machine->init()is called, depending on the machine-type.Or, maybe a property without a getter would be appropriate?
Timing is everything. The convert to enum was not too hard. v3 posted.
-Don Slutz
Quoted 3 lines · Don Slutz
-M pc -machine accel=xen
pcms->vmport is false
I think this should be true. Any reason why not?
Paolo
Quoted 4 lines
(quoted diff) +0
-2-M pc -machine vmport=on,accel=xen pcms->vmport is true -M pc -machine vmport=off,accel=xen pcms->vmport is false
Quoted 7 lines · Paolo Bonzini
Quoted 2 lines · Don Slutz
-M pc -machine accel=xen
pcms->vmport is falseI think this should be true. Any reason why not?
Paolo
Yes, QEMU will crash if xen is enabled and the guest tries to access the VMware port.
(more on different thread).
-Don Slutz
Quoted 4 lines
Quoted 4 lines
(quoted diff) +0
-2-M pc -machine vmport=on,accel=xen pcms->vmport is true -M pc -machine vmport=off,accel=xen pcms->vmport is false
Quoted 7 lines · Don Slutz
Quoted 5 lines · Paolo Bonzini
Quoted 3 lines · Don Slutz
Quoted 3 lines
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Quoted 1 line
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work.
Right. So let's start by deciding what the desired semantics are for all six cases: -M pc/xenfv, -machine vmport=on/off/absent.
Paolo
I get 12 cases (PCMachineState *pcms =
PC_MACHINE(obj)):
We have more cases, if we consider "-M pc-2.1" too.
With this first patch (the one changing default_machine_opts), I expect to get the following results:
-M pc
pcms->vmport is true
-M pc -machine vmport=on
pcms->vmport is true
-M pc -machine vmport=off
pcms->vmport is false
-M pc-2.1
pcms->vmport is true-M pc-2.1 -machine vmport=on
pcms->vmport is true
(but it doesn't matter, QEMU 2.1 didn't have the vmport option)
-M pc-2.1 -machine vmport=off
pcms->vmport is false
(but it doesn't matter, QEMU 2.1 didn't have the vmport option)
-M xenfv
pcms->vmport is false
-M xenfv -machine vmport=on
pcms->vmport is true
-M xenfv -machine vmport=off
pcms->vmport is false-M pc -machine accel=xen
pcms->vmport is true
-M pc -machine vmport=on,accel=xen
pcms->vmport is true
-M pc -machine vmport=off,accel=xen
pcms->vmport is false
-M pc-2.1 -machine accel=xen
pcms->vmport is true **-M pc-2.1 -machine vmport=on,accel=xen
pcms->vmport is true
(but it doesn't matter, QEMU 2.1 didn't have the vmport option)
-M pc-2.1 -machine vmport=off,accel=xen
pcms->vmport is false
(but it doesn't matter, QEMU 2.1 didn't have the vmport option)
-M xenfv -machine accel=xen
pcms->vmport is false
-M xenfv -machine vmport=on,accel=xen
pcms->vmport is true
-M xenfv -machine vmport=off,accel=xen
pcms->vmport is falseI believe there's no consensus yet about the one marked with "**" above. It boils to the question: do we need to keep guest ABI stability when using "-M pc-2.1 -machine accel=xen"?
Signature · 1 line
Eduardo
Quoted 60 lines · Eduardo Habkost
Quoted 5 lines · Don Slutz
Quoted 4 lines · Paolo Bonzini
Quoted 3 lines · Don Slutz
Quoted 3 lines
"-M pc -machine accel=xen" should work and, if that's what you want, disable the vmport device. I think this patch is wrong.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
Quoted 1 line
Paolo
Well, I also want "-M pc -machine accel=xen,vmport=on" to work.
Right. So let's start by deciding what the desired semantics are for all six cases: -M pc/xenfv, -machine vmport=on/off/absent.
Paolo
I get 12 cases (PCMachineState *pcms =
PC_MACHINE(obj)):We have more cases, if we consider "-M pc-2.1" too.
With this first patch (the one changing
default_machine_opts), I expect to get the following results:(quoted diff) +0
-18-M pc pcms->vmport is true -M pc -machine vmport=on pcms->vmport is true -M pc -machine vmport=off pcms->vmport is false -M pc-2.1 pcms->vmport is true -M pc-2.1 -machine vmport=on pcms->vmport is true (but it doesn't matter, QEMU 2.1 didn't have the vmport option) -M pc-2.1 -machine vmport=off pcms->vmport is false (but it doesn't matter, QEMU 2.1 didn't have the vmport option) -M xenfv pcms->vmport is false -M xenfv -machine vmport=on pcms->vmport is true -M xenfv -machine vmport=off pcms->vmport is false -M pc -machine accel=xen pcms->vmport is true -M pc -machine vmport=on,accel=xen pcms->vmport is true -M pc -machine vmport=off,accel=xen pcms->vmport is false -M pc-2.1 -machine accel=xen pcms->vmport is true ** -M pc-2.1 -machine vmport=on,accel=xen pcms->vmport is true (but it doesn't matter, QEMU 2.1 didn't have the vmport option) -M pc-2.1 -machine vmport=off,accel=xen pcms->vmport is false (but it doesn't matter, QEMU 2.1 didn't have the vmport option) -M xenfv -machine accel=xen pcms->vmport is false -M xenfv -machine vmport=on,accel=xen pcms->vmport is true -M xenfv -machine vmport=off,accel=xen pcms->vmport is false
Quoted 4 lines
I believe there's no consensus yet about the one marked with "**" above. It boils to the question: do we need to keep guest ABI stability when using "-M pc-2.1 -machine accel=xen"?
My answer is that for "**" vmport needs to be off. It looks like my response:
Quoted 12 lines
Subject: Re: [BUGFIX][PATCH for 2.2 1/1]
hw/i386/pc_piix.c: Also pass vmport=off for xenfv machine
Date: Thu, 20 Nov 2014 10:09:31 -0500
From: Don Slutz <[email protected]>
To: Paolo Bonzini <[email protected]>, Don Slutz <[email protected]>, qemu-devel <[email protected]>, Eduardo Habkost <[email protected]>Quoted 6 lines · Paolo Bonzini
Quoted 2 lines · Don Slutz
-M pc -machine accel=xen
pcms->vmport is falseI think this should be true. Any reason why not?
Quoted 8 lines
Quoted 1 line
Paolo
Yes, QEMU will crash if xen is enabled and the guest tries to access the VMware port.
(more on different thread).
-Don Slutz
Was not seen before this.
-Don Slutz
On Thu, Nov 20, 2014 at 10:24:15AM -0500, Don Slutz wrote:
[...]
Quoted 2 lines
Quoted 2 lines
-M pc-2.1 -machine accel=xen
pcms->vmport is true **
[...]
Quoted 9 lines
Quoted 5 lines
I believe there's no consensus yet about the one marked with "**" above. It boils to the question: do we need to keep guest ABI stability when using "-M pc-2.1 -machine accel=xen"?
My answer is that for "**" vmport needs to be off. It looks like my response:
[...]
Quoted 2 lines
Quoted 2 lines
Yes, QEMU will crash if xen is enabled and the guest tries to access the VMware port.
[...]
Quoted 2 lines
Was not seen before this.
Yes, your answer arrived seconds after I sent my message. Ignore what I said above. :)
Signature · 1 line
Eduardo