From ead43915621ee05188fd6fade1b345ded9f7e422 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Sat, 4 May 2013 02:07:39 +0800 Subject: [PATCH] Rename virDomainDiskSGIO to virDomainDeviceSGIO SCSI host device will also support "sgio", and perhaps we could use "sgio" in other places too in future, renaming the enum to reuse. --- src/conf/domain_conf.c | 6 +++--- src/conf/domain_conf.h | 14 +++++++------- src/qemu/qemu_conf.c | 6 +++--- src/qemu/qemu_process.c | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 781a7b648a..640c798487 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -274,7 +274,7 @@ VIR_ENUM_IMPL(virDomainDiskIo, VIR_DOMAIN_DISK_IO_LAST, "native", "threads") -VIR_ENUM_IMPL(virDomainDiskSGIO, VIR_DOMAIN_DISK_SGIO_LAST, +VIR_ENUM_IMPL(virDomainDeviceSGIO, VIR_DOMAIN_DEVICE_SGIO_LAST, "default", "filtered", "unfiltered") @@ -5069,7 +5069,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, } if (sgio) { - if ((def->sgio = virDomainDiskSGIOTypeFromString(sgio)) <= 0) { + if ((def->sgio = virDomainDeviceSGIOTypeFromString(sgio)) <= 0) { virReportError(VIR_ERR_XML_ERROR, _("unknown disk sgio mode '%s'"), sgio); goto error; @@ -13711,7 +13711,7 @@ virDomainDiskDefFormat(virBufferPtr buf, const char *ioeventfd = virDomainIoEventFdTypeToString(def->ioeventfd); const char *event_idx = virDomainVirtioEventIdxTypeToString(def->event_idx); const char *copy_on_read = virDomainDiskCopyOnReadTypeToString(def->copy_on_read); - const char *sgio = virDomainDiskSGIOTypeToString(def->sgio); + const char *sgio = virDomainDeviceSGIOTypeToString(def->sgio); const char *discard = virDomainDiskDiscardTypeToString(def->discard); char uuidstr[VIR_UUID_STRING_BUFLEN]; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7716dab608..ff79f587b5 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -618,12 +618,12 @@ enum virDomainDiskSecretType { VIR_DOMAIN_DISK_SECRET_TYPE_LAST }; -enum virDomainDiskSGIO { - VIR_DOMAIN_DISK_SGIO_DEFAULT = 0, - VIR_DOMAIN_DISK_SGIO_FILTERED, - VIR_DOMAIN_DISK_SGIO_UNFILTERED, +enum virDomainDeviceSGIO { + VIR_DOMAIN_DEVICE_SGIO_DEFAULT = 0, + VIR_DOMAIN_DEVICE_SGIO_FILTERED, + VIR_DOMAIN_DEVICE_SGIO_UNFILTERED, - VIR_DOMAIN_DISK_SGIO_LAST + VIR_DOMAIN_DEVICE_SGIO_LAST }; enum virDomainDiskDiscard { @@ -715,7 +715,7 @@ struct _virDomainDiskDef { virStorageEncryptionPtr encryption; bool rawio_specified; int rawio; /* no = 0, yes = 1 */ - int sgio; /* enum virDomainDiskSGIO */ + int sgio; /* enum virDomainDeviceSGIO */ int discard; /* enum virDomainDiskDiscard */ size_t nseclabels; @@ -2472,7 +2472,7 @@ VIR_ENUM_DECL(virDomainDiskProtocol) VIR_ENUM_DECL(virDomainDiskProtocolTransport) VIR_ENUM_DECL(virDomainDiskIo) VIR_ENUM_DECL(virDomainDiskSecretType) -VIR_ENUM_DECL(virDomainDiskSGIO) +VIR_ENUM_DECL(virDomainDeviceSGIO) VIR_ENUM_DECL(virDomainDiskTray) VIR_ENUM_DECL(virDomainDiskDiscard) VIR_ENUM_DECL(virDomainIoEventFd) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index c1109df326..44901384bc 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1025,10 +1025,10 @@ qemuCheckSharedDisk(virHashTablePtr sharedDevices, } if ((val == 0 && - (disk->sgio == VIR_DOMAIN_DISK_SGIO_FILTERED || - disk->sgio == VIR_DOMAIN_DISK_SGIO_DEFAULT)) || + (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_FILTERED || + disk->sgio == VIR_DOMAIN_DEVICE_SGIO_DEFAULT)) || (val == 1 && - disk->sgio == VIR_DOMAIN_DISK_SGIO_UNFILTERED)) + disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED)) goto cleanup; if (disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME) { diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 52636a1523..f9229b6a3d 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3226,7 +3226,7 @@ qemuSetUnprivSGIO(virDomainDiskDefPtr disk) return -1; /* By default, filter the SG_IO commands, i.e. set unpriv_sgio to 0. */ - val = (disk->sgio == VIR_DOMAIN_DISK_SGIO_UNFILTERED); + val = (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED); /* Do not do anything if unpriv_sgio is not supported by the kernel and the * whitelist is enabled. But if requesting unfiltered access, always call -- GitLab