On Wed, Aug 08, 2012 at 01:21:10AM +0800, Guannan Ren wrote: > Rename qemuDefaultScsiControllerModel to qemuCheckScsiControllerModel. > When scsi model is given explicitly in XML(model > 0) checking if the > underlying QEMU supports it or not first, raise an error on checking > failure. > When the model is not given(mode <= 0), return LSI by default, if > the QEMU doesn't support it, raise an error. > --- > src/qemu/qemu_command.c | 106 +++++++++++++++++++++++++++++++++++----------- > src/qemu/qemu_command.h | 3 +- > src/qemu/qemu_process.c | 9 +++- > 3 files changed, 88 insertions(+), 30 deletions(-) > > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c > index 9999a05..d4791c6 100644 > --- a/src/qemu/qemu_command.c > +++ b/src/qemu/qemu_command.c > @@ -469,19 +469,58 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk) > } > > static int > -qemuDefaultScsiControllerModel(virDomainDefPtr def) { > - if (STREQ(def->os.arch, "ppc64") && > - STREQ(def->os.machine, "pseries")) { > - return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI; > +qemuCheckScsiControllerModel(virDomainDefPtr def, > + virBitmapPtr qemuCaps, > + int *model) This method is *modifying* the value in the 'model' parameter, so using 'Check' is a horribly misleading name. This should be 'Set' or something similar to make it clear that it is modifying the parameters, not merely checking them.. 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