[libvirt] [PATCH 6/9] virstoragefile: Add quorum in virstoragefile

Michal Privoznik mprivozn at redhat.com
Tue Jan 13 14:46:13 UTC 2015


On 08.12.2014 19:31, Matthias Gatto wrote:
> Add VIR_STORAGE_TYPE_QUORUM in virStorageType.
> Add VIR_STORAGE_FILE_QUORUM in virStorageFileFormat.
>
> Add threshold value in _virStorageSource
>
> Signed-off-by: Matthias Gatto <matthias.gatto at outscale.com>
> ---
>   src/conf/domain_conf.c    |  2 ++
>   src/qemu/qemu_command.c   |  1 +
>   src/qemu/qemu_driver.c    |  4 ++++
>   src/qemu/qemu_migration.c |  1 +
>   src/util/virstoragefile.c | 25 +++++++++++++++++--------
>   src/util/virstoragefile.h |  3 +++
>   6 files changed, 28 insertions(+), 8 deletions(-)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 00e0470..1add21f 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -5445,6 +5445,7 @@ virDomainDiskSourceParse(xmlNodePtr node,
>           if (virDomainDiskSourcePoolDefParse(node, &src->srcpool) < 0)
>               goto cleanup;
>           break;
> +    case VIR_STORAGE_TYPE_QUORUM:
>       case VIR_STORAGE_TYPE_NONE:
>       case VIR_STORAGE_TYPE_LAST:
>           virReportError(VIR_ERR_INTERNAL_ERROR,
> @@ -16412,6 +16413,7 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf,
>                                                    skipSeclabels);
>               break;
>
> +        case VIR_STORAGE_TYPE_QUORUM:
>           case VIR_STORAGE_TYPE_NONE:
>           case VIR_STORAGE_TYPE_LAST:
>               virReportError(VIR_ERR_INTERNAL_ERROR,
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 1831323..525a49c 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -3086,6 +3086,7 @@ qemuGetDriveSourceString(virStorageSourcePtr src,
>               goto cleanup;
>           break;
>
> +    case VIR_STORAGE_TYPE_QUORUM:
>       case VIR_STORAGE_TYPE_VOLUME:
>       case VIR_STORAGE_TYPE_NONE:
>       case VIR_STORAGE_TYPE_LAST:
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 8e3a492..1dc7558 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -12977,6 +12977,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk)
>           }
>           break;
>
> +    case VIR_STORAGE_TYPE_QUORUM:
>       case VIR_STORAGE_TYPE_DIR:
>       case VIR_STORAGE_TYPE_VOLUME:
>       case VIR_STORAGE_TYPE_NONE:
> @@ -13040,6 +13041,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d
>           }
>           break;
>
> +    case VIR_STORAGE_TYPE_QUORUM:
>       case VIR_STORAGE_TYPE_DIR:
>       case VIR_STORAGE_TYPE_VOLUME:
>       case VIR_STORAGE_TYPE_NONE:
> @@ -13064,6 +13066,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayInactive(virDomainSnapshotDiskDefPtr
>       case VIR_STORAGE_TYPE_FILE:
>           return 0;
>
> +    case VIR_STORAGE_TYPE_QUORUM:
>       case VIR_STORAGE_TYPE_NETWORK:
>       case VIR_STORAGE_TYPE_DIR:
>       case VIR_STORAGE_TYPE_VOLUME:
> @@ -13183,6 +13186,7 @@ qemuDomainSnapshotPrepareDiskInternal(virConnectPtr conn,
>           }
>           break;
>
> +    case VIR_STORAGE_TYPE_QUORUM:
>       case VIR_STORAGE_TYPE_DIR:
>       case VIR_STORAGE_TYPE_VOLUME:
>       case VIR_STORAGE_TYPE_NONE:
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 0acbb57..5efd753 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -1515,6 +1515,7 @@ qemuMigrationPrecreateDisk(virConnectPtr conn,
>       case VIR_STORAGE_TYPE_BLOCK:
>       case VIR_STORAGE_TYPE_DIR:
>       case VIR_STORAGE_TYPE_NETWORK:
> +    case VIR_STORAGE_TYPE_QUORUM:
>       case VIR_STORAGE_TYPE_NONE:
>       case VIR_STORAGE_TYPE_LAST:
>           virReportError(VIR_ERR_INTERNAL_ERROR,
> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index 4217a80..ad87e80 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
> @@ -57,7 +57,8 @@ VIR_ENUM_IMPL(virStorage, VIR_STORAGE_TYPE_LAST,
>                 "block",
>                 "dir",
>                 "network",
> -              "volume")
> +              "volume",
> +              "quorum")

This adds new type to domain disk. Any change to XML must go hand in 
hand with documentation and XML schema changes.

>
>   VIR_ENUM_IMPL(virStorageFileFormat,
>                 VIR_STORAGE_FILE_LAST,
> @@ -66,7 +67,7 @@ VIR_ENUM_IMPL(virStorageFileFormat,
>                 "cloop", "dmg", "iso",
>                 "vpc", "vdi",
>                 /* Not direct file formats, but used for various drivers */
> -              "fat", "vhd", "ploop",
> +              "fat", "vhd", "ploop", "quorum",
>                 /* Formats with backing file below here */
>                 "cow", "qcow", "qcow2", "qed", "vmdk")
>

Michal




More information about the libvir-list mailing list