From a9762b730b3eb89e3c82488a7e3878c492344ec0 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Fri, 5 Apr 2013 03:38:02 +0800 Subject: [PATCH] qemu: Support sgio setting for volume type disk --- src/qemu/qemu_conf.c | 15 ++++++++++++--- src/qemu/qemu_process.c | 7 +++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 54d5ad64b0..06bc4d3e1e 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -996,9 +996,18 @@ qemuCheckSharedDisk(virHashTablePtr sharedDisks, disk->sgio == VIR_DOMAIN_DISK_SGIO_UNFILTERED)) goto cleanup; - virReportError(VIR_ERR_OPERATION_INVALID, - _("sgio of shared disk '%s' conflicts with other " - "active domains"), disk->src); + if (disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME) { + virReportError(VIR_ERR_OPERATION_INVALID, + _("sgio of shared disk 'pool=%s' 'volume=%s' conflicts " + "with other active domains"), + disk->srcpool->pool, + disk->srcpool->volume); + } else { + virReportError(VIR_ERR_OPERATION_INVALID, + _("sgio of shared disk '%s' conflicts with other " + "active domains"), disk->src); + } + ret = -1; cleanup: diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 31427edb5c..39c49ce286 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3235,9 +3235,12 @@ qemuSetUnprivSGIO(virDomainDiskDefPtr disk) /* "sgio" is only valid for block disk; cdrom * and floopy disk can have empty source. */ - if (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK || + if (!disk->src || disk->device != VIR_DOMAIN_DISK_DEVICE_LUN || - !disk->src) + (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK && + !(disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME && + disk->srcpool && + disk->srcpool->voltype == VIR_STORAGE_VOL_BLOCK))) return 0; sysfs_path = virGetUnprivSGIOSysfsPath(disk->src, NULL);