[libvirt] [PATCH v7 00/13] qemu: Add quorum support to libvirt

Matthias Gatto matthias.gatto at outscale.com
Thu Dec 3 14:35:10 UTC 2015


The purpose of these patches is to introduce quorum for libvirt
I've try to follow this proposal:
http://www.redhat.com/archives/libvir-list/2014-May/msg00533.html

This feature ask for 5 task:

1) Allow a _virStorageSource to contain more than one backing store.

Because all the actual libvirt code use the backingStore field
as a pointer and we needs want to change that, I've decide to encapsulate
the backingStore field to simplifie the array manipulation.

2) Add the missing field a quorum need in _virStorageSource and
the VIR_STORAGE_TYPE_QUORUM and VIR_STORAGE_FILE_QUORUM in
their respectives enums.

3) Parse and format the xml
Because a quorum allows to have more than one backing store at the same level
we need to change virDomainDiskDefFormat and virDomainDiskDefParseXML
to call virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse
in a loop.
virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse can
call themself recursively in a loop because a quorum can contain another
quorum

4) Build qemu string
As for the xml, we have to call the function which create quorum recursively.
But this task have the problem explained here:
http://www.redhat.com/archives/libvir-list/2014-October/msg00529.html
The _virStorageSource missing some informations that can be passed to
a child, and therefore this version of quorum is incomplet.

5) Allow to hotplug/change a disk in a quorum
This part is not present in these patches because for this task
we have to use blockdev-add, and currently libvirt use
device_add for hotpluging that doesn't allow to hotplug quorum childs.


V2:
        -Rebase on master
        -Add Documentation

V3:
        -Transforme the backingStore field in virStorageSource into
         an array of pointer instead of a pointer
	-Modify virStorageSourceSetBackingStore to allow it to expand
         the backingStore size.

V4:
        -Rebase on master

V5:
        -Rebase on master
        -patch 1-4/9: use patchs from John Ferlan 
        -patch 4/9: check return of virStorageSourceSetBackingStore
        -patch 5/9: report type of error on virStorageSourceSetBackingStore

v6:
	-Rebase on master
	-Remove node-name patch
	-patch 06/13: Add virStorageSourceIsRAID
	-patch 10/13: Add virDomainDefHasRAID
	-patch 11-13/13: Block all unsupported operations

v7:
	-Rebase on master.
	-Parse unconditionally backing store.
	-fold qemuBuildRAIDFileSourceStr into qemuBuildRAIDStr.
	-use 0/-1 return values when failing instead of bool.
	-virStorageSourceSetBackingStore now free backing store when they are
	already set.

Matthias Gatto (13):
  virstoragefile: Add virStorageSourceGetBackingStore
  virstoragefile: Always use virStorageSourceGetBackingStore to get
    backing store
  virstoragefile: Add virStorageSourceSetBackingStore
  virstoragefile: Always use virStorageSourceSetBackingStore to set
    backing store
  virstoragefile: change backingStore to backingStores.
  virstoragefile: Add virStorageSourceIsRAID
  virstoragefile: Add quorum in virstoragefile
  domain_conf: Read and Write quorum config
  qemu: Add quorum support in qemuBuildDriveDevStr
  domain: Add virDomainDefHasRAID
  qemu: Forbid blocks operations with quorum
  qemu: qemuDomainGetBlockInfo quorum support
  qemu: qemuDiskPathToAlias quorum support

 docs/formatdomain.html.in             |  23 ++++-
 docs/schemas/domaincommon.rng         |  21 +++-
 docs/schemas/storagecommon.rng        |   1 +
 docs/schemas/storagevol.rng           |   1 +
 src/conf/domain_conf.c                | 174 ++++++++++++++++++++++++----------
 src/conf/domain_conf.h                |   1 +
 src/conf/storage_conf.c               |  23 +++--
 src/libvirt_private.syms              |   4 +
 src/qemu/qemu_cgroup.c                |   4 +-
 src/qemu/qemu_command.c               |  78 +++++++++++++++
 src/qemu/qemu_domain.c                |   2 +-
 src/qemu/qemu_driver.c                |  72 ++++++++++----
 src/qemu/qemu_migration.c             |   1 +
 src/qemu/qemu_monitor_json.c          |   4 +-
 src/security/security_dac.c           |   2 +-
 src/security/security_selinux.c       |   4 +-
 src/security/virt-aa-helper.c         |   2 +-
 src/storage/storage_backend.c         |  24 +++--
 src/storage/storage_backend_fs.c      |  45 +++++----
 src/storage/storage_backend_gluster.c |  11 ++-
 src/storage/storage_backend_logical.c |  15 ++-
 src/storage/storage_driver.c          |   3 +-
 src/util/virstoragefile.c             | 121 ++++++++++++++++++++---
 src/util/virstoragefile.h             |  15 ++-
 tests/virstoragetest.c                |  18 ++--
 25 files changed, 518 insertions(+), 151 deletions(-)

-- 
2.6.2




More information about the libvir-list mailing list