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@xxxxxxxxxxxxxxxxxx> > --- > 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 :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list