We're going to make some changes here, and the boolean logic
does not lend itself to be easily expanded.
Signed-off-by: Eric Farman <farman(a)linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
---
src/qemu/qemu_conf.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index fa9d65e..64f85dd 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1096,11 +1096,20 @@ qemuAddSharedDisk(virQEMUDriverPtr driver,
static bool
qemuIsSharedHostdev(virDomainHostdevDefPtr hostdev)
{
- return (hostdev->shareable &&
- (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
- hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI
&&
- hostdev->source.subsys.u.scsi.protocol !=
- VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI));
+ if (!hostdev->shareable)
+ return false;
+
+ if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
+ return false;
+
+ if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI)
+ return false;
+
+ if (hostdev->source.subsys.u.scsi.protocol ==
+ VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
+ return false;
+
+ return true;
}
--
1.9.1