[libvirt] [PATCHv2 1/1] Assign spapr-vio address type to ibmvscsi controller

For pseries guest, the default controller model is ibmvscsi controller, this controller only can work on spapr-vio address. This patch is to assign spapr-vio address type to ibmvscsi controller. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 117542f..2c6495a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -779,6 +779,7 @@ qemuAssignSpaprVIOAddress(virDomainDefPtr def, virDomainDeviceInfoPtr info, int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def) { int i, rc; + int model; /* Default values match QEMU. See spapr_(llan|vscsi|vty).c */ @@ -790,10 +791,17 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def) } for (i = 0 ; i < def->ncontrollers; i++) { - rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info, + model = def->controllers[i]->model; + if (model == -1 && + def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) + model = qemuDefaultScsiControllerModel(def); + if (model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI) { + def->controllers[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; + rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info, 0x2000ul); - if (rc) - return rc; + if (rc) + return rc; + } } for (i = 0 ; i < def->nserials; i++) { -- 1.7.9.5

On Thu, May 10, 2012 at 04:39:48PM +0800, Li Zhang wrote:
For pseries guest, the default controller model is ibmvscsi controller, this controller only can work on spapr-vio address.
This patch is to assign spapr-vio address type to ibmvscsi controller.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 117542f..2c6495a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -779,6 +779,7 @@ qemuAssignSpaprVIOAddress(virDomainDefPtr def, virDomainDeviceInfoPtr info, int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def) { int i, rc; + int model;
/* Default values match QEMU. See spapr_(llan|vscsi|vty).c */
@@ -790,10 +791,17 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def) }
for (i = 0 ; i < def->ncontrollers; i++) { - rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info, + model = def->controllers[i]->model; + if (model == -1 && + def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) + model = qemuDefaultScsiControllerModel(def); + if (model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI) { + def->controllers[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; + rc = qemuAssignSpaprVIOAddress(def, &def->controllers[i]->info, 0x2000ul); - if (rc) - return rc; + if (rc) + return rc; + } }
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 05/10/2012 03:37 AM, Daniel P. Berrange wrote:
On Thu, May 10, 2012 at 04:39:48PM +0800, Li Zhang wrote:
For pseries guest, the default controller model is ibmvscsi controller, this controller only can work on spapr-vio address.
This patch is to assign spapr-vio address type to ibmvscsi controller.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
ACK
Needs a v2; 'make check' failed. In particular, with: $ make -C tests check TESTS=qemuxml2argvtest VIR_TEST_DEBUG=1 I see failures like: 148) QEMU XML-2-ARGV usb-redir ... Offset 457 Expect [bus=pci.0,addr=0x4.0x1] Actual [reg=0x2000] ... FAILED 149) QEMU XML-2-ARGV usb1-usb2 ... libvir: QEMU error : XML error: spapr-vio address 0x2000 already in use FAILED I don't know if the change in output is expected or a regression, so I'd feel a bit safer if we waited until after 0.9.12 to apply a fixed v2. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 05/11/2012 06:41 AM, Eric Blake wrote:
On 05/10/2012 03:37 AM, Daniel P. Berrange wrote:
On Thu, May 10, 2012 at 04:39:48PM +0800, Li Zhang wrote:
For pseries guest, the default controller model is ibmvscsi controller, this controller only can work on spapr-vio address.
This patch is to assign spapr-vio address type to ibmvscsi controller.
Signed-off-by: Li Zhang<zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
ACK
Needs a v2; 'make check' failed. In particular, with: $ make -C tests check TESTS=qemuxml2argvtest VIR_TEST_DEBUG=1
I see failures like:
148) QEMU XML-2-ARGV usb-redir ... Offset 457 Expect [bus=pci.0,addr=0x4.0x1] Actual [reg=0x2000]
... FAILED 149) QEMU XML-2-ARGV usb1-usb2 ... libvir: QEMU error : XML error: spapr-vio address 0x2000 already in use FAILED
It is very strange. This patch shouldn't change the address type of usb. I run the test cases with the latest libvirt of master branch, it seems there is only one vscsi test cases fails. No the errors you mentioned. 65) QEMU XML-2-ARGV disk-scsi-vscsi ... Offset 223 Expect [bus=pci.0,addr=0x3 ... FAILED Actual [reg=0x2000 148) QEMU XML-2-ARGV usb-redir ... OK 149) QEMU XML-2-ARGV usb1-usb2 ... OK I think I need to make a little change for vscsi test case. Can you tell me the libvirt version and Qemu version you are using? Thanks.
I don't know if the change in output is expected or a regression, so I'd feel a bit safer if we waited until after 0.9.12 to apply a fixed v2.
-- Best Regards Li IBM LTC, China System&Technology Lab, Beijing

On 05/11/2012 06:41 AM, Eric Blake wrote:
On 05/10/2012 03:37 AM, Daniel P. Berrange wrote:
On Thu, May 10, 2012 at 04:39:48PM +0800, Li Zhang wrote:
For pseries guest, the default controller model is ibmvscsi controller, this controller only can work on spapr-vio address.
This patch is to assign spapr-vio address type to ibmvscsi controller.
Signed-off-by: Li Zhang<zhlcindy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
ACK
Needs a v2; 'make check' failed. In particular, with: $ make -C tests check TESTS=qemuxml2argvtest VIR_TEST_DEBUG=1
I see failures like:
148) QEMU XML-2-ARGV usb-redir ... Offset 457 Expect [bus=pci.0,addr=0x4.0x1] Actual [reg=0x2000]
... FAILED 149) QEMU XML-2-ARGV usb1-usb2 ... libvir: QEMU error : XML error: spapr-vio address 0x2000 already in use FAILED
I don't know if the change in output is expected or a regression, so I'd feel a bit safer if we waited until after 0.9.12 to apply a fixed v2.
A new version has been sent out. The new patch fixes the usb problem. And the disk-scsi-vscsi test case is changed a little. Would you please help to review it? Thanks. -- Best Regards Li IBM LTC, China System&Technology Lab, Beijing
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Li Zhang