Skip to contentSkip to conversation

Remove hardcoded xen-platform device initialization (v4)

PATCH In review Paul Durrant 5 participants 23 messages Jun 18, 2013 – Jun 25, 2013

lore
Share & tools
lore
#0 lore raw

cover Remove hardcoded xen-platform device initialization (v4)

Because of concerns over backwards compatibility and a suggestion that xenfv should be retired in favour of using the pc machine type I have re- worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types to be used with the accel=xen option, but preserves the hardcoded creation of the xen-platform device only for machine type xenfv.

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

#1 lore raw

PATCH 1/2 Allow use of pc machine type (accel=xen) for Xen HVM domains.

Xen HVM domains normally spawn QEMU with a dedicated xenfv machine type. The initialization code for this machine type can easily be pulled into the generic pc initialization code and guarded with a test for whether the xen accelerator options is specified, which is more consistent with the way other accelerators are used.

---
 hw/i386/pc_piix.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +5 -3
index d618570..f96e0c2 100644
@@ -91,6 +91,11 @@ static void pc_init1(MemoryRegion *system_memory,
     DeviceState *icc_bridge;
     FWCfgState *fw_cfg = NULL;
 
+    if (xen_enabled() && xen_hvm_init() != 0) {
+        fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
+        exit(1);
+    }
+
     icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
     object_property_add_child(qdev_get_machine(), "icc-bridge",
                               OBJECT(icc_bridge), NULL);
@@ -320,9 +325,6 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
 #ifdef CONFIG_XEN
 static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
 {
-    if (xen_hvm_init() != 0) {
-        hw_error("xen hardware virtual machine initialisation failed");
-    }
     pc_init_pci(args);
 }
 #endif
Signature · 1 line
1.7.10.4
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM domains.

Quoted 7 lines · Paul Durrant

Xen HVM domains normally spawn QEMU with a dedicated xenfv machine type. The initialization code for this machine type can easily be pulled into the generic pc initialization code and guarded with a test for whether the xen accelerator options is specified, which is more consistent with the way other accelerators are used.

Quoted 38 lines
 hw/i386/pc_piix.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +5 -3
index d618570..f96e0c2 100644
@@ -91,6 +91,11 @@ static void pc_init1(MemoryRegion *system_memory,
     DeviceState *icc_bridge;
     FWCfgState *fw_cfg = NULL;
 
+    if (xen_enabled() && xen_hvm_init() != 0) {
+        fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
+        exit(1);
+    }
+
     icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
     object_property_add_child(qdev_get_machine(), "icc-bridge",
                               OBJECT(icc_bridge), NULL);
@@ -320,9 +325,6 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
 #ifdef CONFIG_XEN
 static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
 {
-    if (xen_hvm_init() != 0) {
-        hw_error("xen hardware virtual machine initialisation failed");
-    }
     pc_init_pci(args);
 }
 #endif
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v1 1/2
#3 lore raw

Re: [Qemu-devel] [Xen-devel] [PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM domains.

In reply to Paul Durrant
Quoted 7 lines · Paul Durrant

Xen HVM domains normally spawn QEMU with a dedicated xenfv machine type. The initialization code for this machine type can easily be pulled into the generic pc initialization code and guarded with a test for whether the xen accelerator options is specified, which is more consistent with the way other accelerators are used.

Quoted 38 lines
 hw/i386/pc_piix.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +5 -3
index d618570..f96e0c2 100644
@@ -91,6 +91,11 @@ static void pc_init1(MemoryRegion *system_memory,
     DeviceState *icc_bridge;
     FWCfgState *fw_cfg = NULL;
 
+    if (xen_enabled() && xen_hvm_init() != 0) {
+        fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
+        exit(1);
+    }
+
     icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
     object_property_add_child(qdev_get_machine(), "icc-bridge",
                               OBJECT(icc_bridge), NULL);
@@ -320,9 +325,6 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
 #ifdef CONFIG_XEN
 static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
 {
-    if (xen_hvm_init() != 0) {
-        hw_error("xen hardware virtual machine initialisation failed");
-    }
     pc_init_pci(args);
 }
 #endif
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#4 lore raw

Re: [Qemu-devel] [Xen-devel] [PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM domains.

In reply to Paul Durrant
Quoted 17 lines · Paul Durrant

Xen HVM domains normally spawn QEMU with a dedicated xenfv machine type. The initialization code for this machine type can easily be pulled into the generic pc initialization code and guarded with a test for whether the xen accelerator options is specified, which is more consistent with the way other accelerators are used.

---
 hw/i386/pc_piix.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +0 -0
index d618570..f96e0c2 100644
@@ -91,6 +91,11 @@ static void pc_init1(MemoryRegion *system_memory,
     DeviceState *icc_bridge;

hw/i386/pc_piix.c static void pc_init1(MemoryRegion *system_memory, · line 101

Quoted 10 lines
hw/i386/pc_piix.c +5 -0
     FWCfgState *fw_cfg = NULL;
 
+    if (xen_enabled() && xen_hvm_init() != 0) {
+        fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
+        exit(1);
+    }
+
     icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
     object_property_add_child(qdev_get_machine(), "icc-bridge",
                               OBJECT(icc_bridge), NULL);

I was about to submit a pull request with this patch, but unfortunately it breaks non-xen compilations:

hw/i386/pc_piix.o: In function `pc_init1':
/local/scratch/sstabellini/qemu/hw/i386/pc_piix.c:94: undefined reference to `xen_hvm_init'

you need to add the function to xen-stub.c:

xen-stub.c +5 -0
index 6f0516a..47c8e73 100644
@@ -63,3 +63,8 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
 void xen_modified_memory(ram_addr_t start, ram_addr_t length)
 {
 }
+
+int xen_hvm_init(void)
+{
+    return 0;
+}

I'll include this change in the pull request

#5 lore raw

Re: [PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM domains.

Quoted 63 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 25 June 2013 13:02
To: Paul Durrant
Cc: [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM domains.

Quoted 1 line · Paul Durrant

Xen HVM domains normally spawn QEMU with a dedicated xenfv machine

type. The

hw/i386/pc_piix.c static void pc_init1(MemoryRegion

Quoted 15 lines

initialization code for this machine type can easily be pulled into the generic pc initialization code and guarded with a test for whether the xen accelerator options is specified, which is more consistent with the way other accelerators are used.

---
 hw/i386/pc_piix.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +0 -0
index d618570..f96e0c2 100644
@@ -91,6 +91,11 @@ static void pc_init1(MemoryRegion

*system_memory,

hw/i386/pc_piix.c static void pc_init1(MemoryRegion · line 101

Quoted 11 lines
hw/i386/pc_piix.c +5 -0
     DeviceState *icc_bridge;
     FWCfgState *fw_cfg = NULL;
 
+    if (xen_enabled() && xen_hvm_init() != 0) {
+        fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
+        exit(1);
+    }
+
     icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
     object_property_add_child(qdev_get_machine(), "icc-bridge",
                               OBJECT(icc_bridge), NULL);

I was about to submit a pull request with this patch, but unfortunately it breaks non-xen compilations:

hw/i386/pc_piix.o: In function `pc_init1':
/local/scratch/sstabellini/qemu/hw/i386/pc_piix.c:94: undefined reference to `xen_hvm_init'

you need to add the function to xen-stub.c:

xen-stub.c +5 -0
index 6f0516a..47c8e73 100644
@@ -63,3 +63,8 @@ void qmp_xen_set_global_dirty_log(bool enable, Error
 **errp)
 void xen_modified_memory(ram_addr_t start, ram_addr_t length)
 {
 }
+
+int xen_hvm_init(void)
+{
+    return 0;
+}
Quoted 1 line

I'll include this change in the pull request

Ok. Thanks for the fix-up.

Paul

#6 lore raw

Re: [Qemu-devel] [Xen-devel] [PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM domains.

In reply to Stefano Stabellini
Quoted 63 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 25 June 2013 13:02
To: Paul Durrant
Cc: [email protected]; [email protected]
Subject: Re: [Xen-devel] [PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM domains.

Quoted 1 line · Paul Durrant

Xen HVM domains normally spawn QEMU with a dedicated xenfv machine

type. The

hw/i386/pc_piix.c static void pc_init1(MemoryRegion

Quoted 15 lines

initialization code for this machine type can easily be pulled into the generic pc initialization code and guarded with a test for whether the xen accelerator options is specified, which is more consistent with the way other accelerators are used.

---
 hw/i386/pc_piix.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +0 -0
index d618570..f96e0c2 100644
@@ -91,6 +91,11 @@ static void pc_init1(MemoryRegion

*system_memory,

hw/i386/pc_piix.c static void pc_init1(MemoryRegion · line 101

Quoted 11 lines
hw/i386/pc_piix.c +5 -0
     DeviceState *icc_bridge;
     FWCfgState *fw_cfg = NULL;
 
+    if (xen_enabled() && xen_hvm_init() != 0) {
+        fprintf(stderr, "xen hardware virtual machine initialisation failed\n");
+        exit(1);
+    }
+
     icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
     object_property_add_child(qdev_get_machine(), "icc-bridge",
                               OBJECT(icc_bridge), NULL);

I was about to submit a pull request with this patch, but unfortunately it breaks non-xen compilations:

hw/i386/pc_piix.o: In function `pc_init1':
/local/scratch/sstabellini/qemu/hw/i386/pc_piix.c:94: undefined reference to `xen_hvm_init'

you need to add the function to xen-stub.c:

xen-stub.c +5 -0
index 6f0516a..47c8e73 100644
@@ -63,3 +63,8 @@ void qmp_xen_set_global_dirty_log(bool enable, Error
 **errp)
 void xen_modified_memory(ram_addr_t start, ram_addr_t length)
 {
 }
+
+int xen_hvm_init(void)
+{
+    return 0;
+}
Quoted 1 line

I'll include this change in the pull request

Ok. Thanks for the fix-up.

Paul

#7 lore raw

PATCH 2/2 Move hardcoded initialization of xen-platform device.

In reply to Paul Durrant

Creation of the xen-platform device is currently hardcoded into machine type pc's initialization code, guarded by a test for the whether the xen accelerator is enabled. This patch moves the creation of xen-platform into the initialization code of the xenfv machine type. This maintains backwards compatibility for that machine type but allows more flexibility if another machine type is used with Xen HVM domains.

---
 hw/i386/pc_piix.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +7 -3
index f96e0c2..c294138 100644
@@ -179,9 +179,6 @@ static void pc_init1(MemoryRegion *system_memory,
     pc_register_ferr_irq(gsi[13]);
 
     pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
-    if (xen_enabled()) {
-        pci_create_simple(pci_bus, -1, "xen-platform");
-    }
 
     /* init basic PC hardware */
     pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled());
@@ -325,7 +322,14 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
 #ifdef CONFIG_XEN
 static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
 {
+    PCIBus *bus;
+
     pc_init_pci(args);
+
+    bus = pci_find_root_bus(0);
+    if (bus != NULL) {
+        pci_create_simple(bus, -1, "xen-platform");
+    }
 }
 #endif
 
Signature · 1 line
1.7.10.4
#8 lore raw

PATCH 2/2 Move hardcoded initialization of xen-platform device.

In reply to Paul Durrant

Creation of the xen-platform device is currently hardcoded into machine type pc's initialization code, guarded by a test for the whether the xen accelerator is enabled. This patch moves the creation of xen-platform into the initialization code of the xenfv machine type. This maintains backwards compatibility for that machine type but allows more flexibility if another machine type is used with Xen HVM domains.

---
 hw/i386/pc_piix.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +7 -3
index f96e0c2..c294138 100644
@@ -179,9 +179,6 @@ static void pc_init1(MemoryRegion *system_memory,
     pc_register_ferr_irq(gsi[13]);
 
     pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
-    if (xen_enabled()) {
-        pci_create_simple(pci_bus, -1, "xen-platform");
-    }
 
     /* init basic PC hardware */
     pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled());
@@ -325,7 +322,14 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
 #ifdef CONFIG_XEN
 static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
 {
+    PCIBus *bus;
+
     pc_init_pci(args);
+
+    bus = pci_find_root_bus(0);
+    if (bus != NULL) {
+        pci_create_simple(bus, -1, "xen-platform");
+    }
 }
 #endif
 
Signature · 1 line
1.7.10.4
Acked-by on v1 2/2
#9 lore raw

Re: [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Quoted 8 lines · Paul Durrant

Creation of the xen-platform device is currently hardcoded into machine type pc's initialization code, guarded by a test for the whether the xen accelerator is enabled. This patch moves the creation of xen-platform into the initialization code of the xenfv machine type. This maintains backwards compatibility for that machine type but allows more flexibility if another machine type is used with Xen HVM domains.

Quoted 31 lines
 hw/i386/pc_piix.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +7 -3
index f96e0c2..c294138 100644
@@ -179,9 +179,6 @@ static void pc_init1(MemoryRegion *system_memory,
     pc_register_ferr_irq(gsi[13]);
 
     pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
-    if (xen_enabled()) {
-        pci_create_simple(pci_bus, -1, "xen-platform");
-    }
 
     /* init basic PC hardware */
     pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled());
@@ -325,7 +322,14 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
 #ifdef CONFIG_XEN
 static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
 {
+    PCIBus *bus;
+
     pc_init_pci(args);
+
+    bus = pci_find_root_bus(0);
+    if (bus != NULL) {
+        pci_create_simple(bus, -1, "xen-platform");
+    }
 }
 #endif
Acked-by on v1 2/2
#10 lore raw

Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] Move hardcoded initialization of xen-platform device.

In reply to Paul Durrant
Quoted 8 lines · Paul Durrant

Creation of the xen-platform device is currently hardcoded into machine type pc's initialization code, guarded by a test for the whether the xen accelerator is enabled. This patch moves the creation of xen-platform into the initialization code of the xenfv machine type. This maintains backwards compatibility for that machine type but allows more flexibility if another machine type is used with Xen HVM domains.

Quoted 31 lines
 hw/i386/pc_piix.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +7 -3
index f96e0c2..c294138 100644
@@ -179,9 +179,6 @@ static void pc_init1(MemoryRegion *system_memory,
     pc_register_ferr_irq(gsi[13]);
 
     pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
-    if (xen_enabled()) {
-        pci_create_simple(pci_bus, -1, "xen-platform");
-    }
 
     /* init basic PC hardware */
     pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled());
@@ -325,7 +322,14 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
 #ifdef CONFIG_XEN
 static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
 {
+    PCIBus *bus;
+
     pc_init_pci(args);
+
+    bus = pci_find_root_bus(0);
+    if (bus != NULL) {
+        pci_create_simple(bus, -1, "xen-platform");
+    }
 }
 #endif
#11 lore raw
In reply to Paul Durrant

Il 18/06/2013 13:16, Paul Durrant ha scritto:

Quoted 10 lines

Because of concerns over backwards compatibility and a suggestion that xenfv should be retired in favour of using the pc machine type I have re- worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types to be used with the accel=xen option, but preserves the hardcoded creation of the xen-platform device only for machine type xenfv.

Perfect!

Paolo

Quoted 9 lines

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

#12 lore raw
In reply to Paul Durrant

Il 18/06/2013 13:16, Paul Durrant ha scritto:

Quoted 10 lines

Because of concerns over backwards compatibility and a suggestion that xenfv should be retired in favour of using the pc machine type I have re- worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types to be used with the accel=xen option, but preserves the hardcoded creation of the xen-platform device only for machine type xenfv.

Perfect!

Paolo

Quoted 9 lines

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

#13 lore raw
In reply to Paul Durrant

Hi Paul,

(xen-devel snipped)

Quoted 11 lines · Paul Durrant

Because of concerns over backwards compatibility and a suggestion that xenfv should be retired in favour of using the pc machine type I have re- worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types to be used with the accel=xen option, but preserves the hardcoded creation of the xen-platform device only for machine type xenfv.

Quoted 7 lines

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

thread?

Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Thanks!
Laszlo

#14 lore raw
Quoted 29 lines · Laszlo Ersek

Hi Paul,

(xen-devel snipped)

Quoted 11 lines · Paul Durrant

Because of concerns over backwards compatibility and a suggestion that xenfv should be retired in favour of using the pc machine type I have re- worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types to be used with the accel=xen option, but preserves the hardcoded creation of the xen-platform device only for machine type xenfv.

Quoted 7 lines

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

Quoted 7 lines

thread?

Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Thanks!
Laszlo

OK will make it skip fwcfg as we did earlier.
Thanks for the review.

Signature · 1 line
MST
#15 lore raw
Quoted 41 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: 18 June 2013 13:52
To: Laszlo Ersek
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-platform device initialization (v4)

Quoted 13 lines · Laszlo Ersek

Hi Paul,

(xen-devel snipped)

Quoted 8 lines · Paul Durrant

Because of concerns over backwards compatibility and a suggestion that xenfv should be retired in favour of using the pc machine type I have re- worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types to

be

Quoted 18 lines
Quoted 10 lines

used with the accel=xen option, but preserves the hardcoded creation of the xen-platform device only for machine type xenfv.

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

thread?

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Thanks!
Laszlo

OK will make it skip fwcfg as we did earlier. Thanks for the review.

Yes, I think the assert(fw_cfg) would be problematic in the xen case where, up until my patch, machine types was necessarily xenfv.

Paul

#16 lore raw
Quoted 47 lines · Paul Durrant
Quoted 47 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: 18 June 2013 13:52
To: Laszlo Ersek
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-platform device initialization (v4)

Quoted 13 lines · Laszlo Ersek

Hi Paul,

(xen-devel snipped)

Quoted 8 lines · Paul Durrant

Because of concerns over backwards compatibility and a suggestion that xenfv should be retired in favour of using the pc machine type I have re- worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types to

be

Quoted 23 lines
Quoted 10 lines

used with the accel=xen option, but preserves the hardcoded creation of the xen-platform device only for machine type xenfv.

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

thread?

Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Thanks!
Laszlo

Quoted 7 lines
Quoted 3 lines

OK will make it skip fwcfg as we did earlier. Thanks for the review.

Yes, I think the assert(fw_cfg) would be problematic in the xen case where, up until my patch, machine types was necessarily xenfv.

Paul

Do you guys actually need the pvpanic device?
How do you know which port to use without fwcfg?

Signature · 1 line
MST
#17 lore raw
Quoted 64 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: 18 June 2013 14:02
To: Paul Durrant
Cc: Laszlo Ersek; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-platform device initialization (v4)

Quoted 8 lines · Paul Durrant
Quoted 8 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: 18 June 2013 13:52
To: Laszlo Ersek
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-platform device initialization (v4)

Quoted 7 lines
Quoted 7 lines · Laszlo Ersek
Quoted 6 lines

Hi Paul,

(xen-devel snipped)

Quoted 1 line · Paul Durrant

Because of concerns over backwards compatibility and a suggestion

that

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

xenfv should be retired in favour of using the pc machine type I have

re-

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types

to

Quoted 2 lines
Quoted 2 lines

be

Quoted 1 line
Quoted 1 line

used with the accel=xen option, but preserves the hardcoded

creation of

Quoted 27 lines
Quoted 26 lines
Quoted 15 lines
Quoted 9 lines

the xen-platform device only for machine type xenfv.

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

Quoted 7 lines

thread?

Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Thanks!
Laszlo

OK will make it skip fwcfg as we did earlier. Thanks for the review.

Quoted 6 lines
Quoted 1 line

Yes, I think the assert(fw_cfg) would be problematic in the xen case where,

up until my patch, machine types was necessarily xenfv.

Quoted 2 lines

Paul

Do you guys actually need the pvpanic device?

I don't believe anyone uses it. You should probably ask on xen-devel to make sure though.

Paul

#18 lore raw
In reply to Michael S. Tsirkin
Quoted 52 lines · Michael S. Tsirkin
Quoted 51 lines · Paul Durrant
Quoted 50 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: 18 June 2013 13:52
To: Laszlo Ersek
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-platform device initialization (v4)

Quoted 13 lines · Laszlo Ersek

Hi Paul,

(xen-devel snipped)

Quoted 8 lines · Paul Durrant

Because of concerns over backwards compatibility and a suggestion that xenfv should be retired in favour of using the pc machine type I have re- worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types to

be

Quoted 16 lines
Quoted 10 lines

used with the accel=xen option, but preserves the hardcoded creation of the xen-platform device only for machine type xenfv.

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

Quoted 7 lines

thread?

Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Thanks!
Laszlo

OK will make it skip fwcfg as we did earlier. Thanks for the review.

Quoted 6 lines
Quoted 3 lines

Yes, I think the assert(fw_cfg) would be problematic in the xen case where, up until my patch, machine types was necessarily xenfv.

Paul

Do you guys actually need the pvpanic device?
How do you know which port to use without fwcfg?

Xen domains don't know the port and don't use the pvpanic device, but qemu starts at least. In other words, the pvpanic device is created, but unreachable. Maybe the has_pvpanic logic should depend on (or extended with) !xen_enabled().

Just a guess.

Laszlo

#19 lore raw
Quoted 71 lines

-----Original Message-----
From: Laszlo Ersek [mailto:[email protected]]
Sent: 18 June 2013 14:14
To: Michael S. Tsirkin
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-platform device initialization (v4)

Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Paul Durrant
Quoted 6 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: 18 June 2013 13:52
To: Laszlo Ersek
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-

platform

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

device initialization (v4)

Quoted 6 lines · Laszlo Ersek

Hi Paul,

(xen-devel snipped)

Quoted 1 line · Paul Durrant

Because of concerns over backwards compatibility and a suggestion

that

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

xenfv should be retired in favour of using the pc machine type I have

re-

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types

to

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

be

Quoted 1 line
Quoted 1 line

used with the accel=xen option, but preserves the hardcoded

creation of

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 9 lines

the xen-platform device only for machine type xenfv.

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

thread?

Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Thanks!
Laszlo

OK will make it skip fwcfg as we did earlier. Thanks for the review.

Yes, I think the assert(fw_cfg) would be problematic in the xen case

where, up until my patch, machine types was necessarily xenfv.

Quoted 3 lines
Quoted 2 lines

Paul

Quoted 8 lines
Quoted 2 lines

Do you guys actually need the pvpanic device?
How do you know which port to use without fwcfg?

Xen domains don't know the port and don't use the pvpanic device, but qemu starts at least. In other words, the pvpanic device is created, but unreachable. Maybe the has_pvpanic logic should depend on (or extended with) !xen_enabled().

That seems entirely reasonable to me.

Paul

#20 lore raw
Quoted 80 lines · Paul Durrant
Quoted 71 lines

-----Original Message-----
From: Laszlo Ersek [mailto:[email protected]]
Sent: 18 June 2013 14:14
To: Michael S. Tsirkin
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-platform device initialization (v4)

Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Paul Durrant
Quoted 6 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: 18 June 2013 13:52
To: Laszlo Ersek
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-

platform

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

device initialization (v4)

Quoted 6 lines · Laszlo Ersek

Hi Paul,

(xen-devel snipped)

Quoted 1 line · Paul Durrant

Because of concerns over backwards compatibility and a suggestion

that

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

xenfv should be retired in favour of using the pc machine type I have

re-

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types

to

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

be

Quoted 1 line
Quoted 1 line

used with the accel=xen option, but preserves the hardcoded

creation of

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 9 lines

the xen-platform device only for machine type xenfv.

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

thread?

Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Thanks!
Laszlo

OK will make it skip fwcfg as we did earlier. Thanks for the review.

Yes, I think the assert(fw_cfg) would be problematic in the xen case

where, up until my patch, machine types was necessarily xenfv.

Quoted 3 lines
Quoted 2 lines

Paul

Quoted 8 lines
Quoted 2 lines

Do you guys actually need the pvpanic device?
How do you know which port to use without fwcfg?

Xen domains don't know the port and don't use the pvpanic device, but qemu starts at least. In other words, the pvpanic device is created, but unreachable. Maybe the has_pvpanic logic should depend on (or extended with) !xen_enabled().

Quoted 3 lines

That seems entirely reasonable to me.

Paul

We can just skip creating the device if there's no fw cfg.

#21 lore raw

Il 18/06/2013 16:22, Michael S. Tsirkin ha scritto:

Quoted 81 lines · Paul Durrant
Quoted 80 lines
Quoted 79 lines

-----Original Message-----
From: Laszlo Ersek [mailto:[email protected]]
Sent: 18 June 2013 14:14
To: Michael S. Tsirkin
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-platform device initialization (v4)

Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Paul Durrant
Quoted 6 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: 18 June 2013 13:52
To: Laszlo Ersek
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-

platform

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

device initialization (v4)

Quoted 6 lines · Laszlo Ersek

Hi Paul,

(xen-devel snipped)

Quoted 1 line · Paul Durrant

Because of concerns over backwards compatibility and a suggestion

that

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

xenfv should be retired in favour of using the pc machine type I have

re-

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types

to

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

be

Quoted 1 line
Quoted 1 line

used with the accel=xen option, but preserves the hardcoded

creation of

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 9 lines

the xen-platform device only for machine type xenfv.

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

thread?

Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Thanks!
Laszlo

OK will make it skip fwcfg as we did earlier. Thanks for the review.

Yes, I think the assert(fw_cfg) would be problematic in the xen case

where, up until my patch, machine types was necessarily xenfv.

Quoted 5 lines
Quoted 2 lines

Paul

Do you guys actually need the pvpanic device?
How do you know which port to use without fwcfg?

Xen domains don't know the port and don't use the pvpanic device, but qemu starts at least. In other words, the pvpanic device is created, but unreachable. Maybe the has_pvpanic logic should depend on (or extended with) !xen_enabled().

Quoted 3 lines
Quoted 1 line

That seems entirely reasonable to me.

We can just skip creating the device if there's no fw cfg.

No, in principle Xen domains could use another scheme to find the port (xenstore for example). If Xen domains do not want it, they can just add an "if". Or we could just skip the fw_cfg step. The device will be there but not ACPI-discoverable.

Paolo

#22 lore raw
Quoted 84 lines · Paolo Bonzini

Il 18/06/2013 16:22, Michael S. Tsirkin ha scritto:

Quoted 83 lines · Paul Durrant
Quoted 81 lines
Quoted 71 lines

-----Original Message-----
From: Laszlo Ersek [mailto:[email protected]]
Sent: 18 June 2013 14:14
To: Michael S. Tsirkin
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-platform device initialization (v4)

Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Paul Durrant
Quoted 6 lines

-----Original Message-----
From: Michael S. Tsirkin [mailto:[email protected]]
Sent: 18 June 2013 13:52
To: Laszlo Ersek
Cc: Paul Durrant; [email protected]
Subject: Re: [Qemu-devel] [PATCH 0/2] Remove hardcoded xen-

platform

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

device initialization (v4)

Quoted 6 lines · Laszlo Ersek

Hi Paul,

(xen-devel snipped)

Quoted 1 line · Paul Durrant

Because of concerns over backwards compatibility and a suggestion

that

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

xenfv should be retired in favour of using the pc machine type I have

re-

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

worked my original patch into 2 patches:

[PATCH 1/2] Allow use of pc machine type (accel=xen) for Xen HVM [PATCH 2/2] Move hardcoded initialization of xen-platform device.

Application of both these patches allows alternative pc machine types

to

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

be

Quoted 1 line
Quoted 1 line

used with the accel=xen option, but preserves the hardcoded

creation of

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 9 lines

the xen-platform device only for machine type xenfv.

v3:
- Add test for xen_enabled() that went missing in v2

v4:
- Remove erroneous whitespace hunk
- Replace hw_error() with fprintf()+exit(1)
- Add braces to single-line if

can you please offer an opinion in the

[PATCH 1/2] pvpanic: initialization cleanup
http://thread.gmane.org/gmane.comp.emulators.qemu/216940

thread?

Quoted 1 line

From where I stand (which is "quite afar" :)) this series of yours seems

somewhat related to my doubt there.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Thanks!
Laszlo

OK will make it skip fwcfg as we did earlier. Thanks for the review.

Yes, I think the assert(fw_cfg) would be problematic in the xen case

where, up until my patch, machine types was necessarily xenfv.

Quoted 3 lines
Quoted 2 lines

Paul

Quoted 8 lines
Quoted 2 lines

Do you guys actually need the pvpanic device?
How do you know which port to use without fwcfg?

Xen domains don't know the port and don't use the pvpanic device, but qemu starts at least. In other words, the pvpanic device is created, but unreachable. Maybe the has_pvpanic logic should depend on (or extended with) !xen_enabled().

That seems entirely reasonable to me.

Quoted 8 lines
Quoted 1 line

We can just skip creating the device if there's no fw cfg.

No, in principle Xen domains could use another scheme to find the port (xenstore for example). If Xen domains do not want it, they can just add an "if". Or we could just skip the fw_cfg step. The device will be there but not ACPI-discoverable.

Paolo

That's a good reason to hide it. We don't want multiple mechanisms to discover the same feature, it's a maintainance headache.

For example, if we do this guests might try to use these ports for something else by mistake. Or they will start hard-coding the port,
then it will break if user tweaks it from command line.
Simply put, if xen wants to use features exposed through fw cfg, let's add fw cfg support for xen and use let xen use fw cfg to discover them.

Signature · 1 line
MST