https://bugzilla.redhat.com/show_bug.cgi?id=1265694
Posting as an RFC mainly to get buyin/feedback over the concept of using
a <flags> field in the <pool> <source> as a way to allow or direct the
pool/storage backend code to use specific algorithms.
The issue is described in the bz, but the shorter version is the disk
backend needs a way to tell libvirt_parthelper to format output for
dm-multipath volumes in a slight different manner. In order to do that
I chose a new flag to call libvirt_parthelper to indicate the way to
output, but I needed a way to have the disk backend determine whether
to add the flag or not. Could have read /etc/multipath.conf - not a
good option... Don't want to read their config file. If there was an
API to get that data, it would have been nice, but then we'd have to
rely on a specific version of multipath that had the API (a dependency
that we don't want). So I chose to roll our own.
I figure there could be other uses of such kind of flags - for example
currently logical volume pools use a model of thin volume support that
is "older". A newer model is there, but IIRC the "format" of the lvs
output wouldn't mesh. So if there was a way to say, use this format of
support in preference, then we could easily add that support with the
caveat that one couldn't expect an "old" thin pool to work. IOW, use
the much improved algorithm knowing that it's a "new" pool rather than
having to mess with "conversions"... Perhaps other pools may find uses,
but this one came to mind since I have a long dormant set of changes
that uses the new thin pool options...
John Ferlan (3):
conf: Add flags to the storage pool source
storage: Add new flag for libvirt_parthelper
conf: Parse/use a flags argument in the storage pool xml
docs/formatstorage.html.in | 33 ++++++++++++++++++++
docs/schemas/storagepool.rng | 9 ++++++
src/conf/storage_conf.c | 41 +++++++++++++++++++++++++
src/conf/storage_conf.h | 11 +++++++
src/storage/parthelper.c | 15 +++++++--
src/storage/storage_backend_disk.c | 7 +++++
tests/storagepoolxml2xmlin/pool-disk-flags.xml | 15 +++++++++
tests/storagepoolxml2xmlout/pool-disk-flags.xml | 15 +++++++++
tests/storagepoolxml2xmltest.c | 1 +
9 files changed, 144 insertions(+), 3 deletions(-)
create mode 100644 tests/storagepoolxml2xmlin/pool-disk-flags.xml
create mode 100644 tests/storagepoolxml2xmlout/pool-disk-flags.xml
--
2.5.0