[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/3] qemu: add two qemu caps for lsi and virtio-scsi SCSI controllers

On 08/08/2012 06:28 PM, Daniel P. Berrange wrote:
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
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")) {
+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..


    Agreed, I will post a patch to change that.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]