This commit adds MirrorImageInstanceIDList and
MirrorImageInstanceIDIter with necessary helper functions
and tests.
Fixes: #483
Signed-off-by: Rakshith R <rar@redhat.com>
* Add GetMirrorUUID implementing rbd_mirror_uuid_get
This function is be used to get the mirroring uuid for the pool.
Basic tests included.
Signed-off-by: RAJAT SINGH <rajasing@redhat.com>
This adds the function call in the style of an iterator, as the number
of mirrored images in the entire pool could be large. Tests are
included.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
* Add CreateMirrorPeerBootstrapToken implementing rbd_mirror_peer_bootstrap_create
* Add ImportMirrorPeerBootstrapToken implementing rbd_mirror_peer_bootstrap_import
These functions can be used to set up mirroring between pools. Basic tests
included. The tests only verify that functions work, not that they
actually mirror data. That is a job for another day.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
* Add SetMirrorSiteName implementing rbd_mirror_site_name_set
* Add GetMirrorSiteName implementing rbd_mirror_site_name_get
These functions are used to set the name of the site (for an entire
cluster) for rbd mirroring purposes. It's a bit strange that it's
part of rdb and not rados, but such is life.
Tests included.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The MirrorImageStatusSummary returns a map of image mirroring states to
the number of images in those states or an error.
Tests of both the basic conditions and actual mirrored images are added.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This change uses slices on top of C allocated array memory in order
to have a simple (no pointer arithmetic) and safe (boundary-checked)
access to its elements.
Signed-off-by: Sven Anderson <sven@redhat.com>
This function is used to "manually" trigger a snapshot for snapshot
based mirroring. It is needed as a pre-req to test actual cross-cluster
mirroring and the full functionality of GetGlobalMirrorStatus.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This function is added, along with required return types and some helper
functions, to support fetching the global mirroring status component
that makes up a major part of `rbd mirror image status` command's
output.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
RBD was misspelled as RDB. While I was there I made the comments
for both constants more consistently worded.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add functions:
* SetMirrorMode implementing rbd_mirror_mode_set
* GetMirrorMode implementing rbd_mirror_mode_get
* MirrorEnable implementing rbd_mirror_image_enable2
* MirrorDisable implementing rbd_mirror_image_disable
* MirrorPromote implementing rbd_mirror_image_promote
* MirrorDemote implementing rbd_mirror_image_demote
* MirrorResync implementing rbd_mirror_image_resync
* MirrorInstanceId implementing rbd_mirror_image_get_instance_id
For now, these mirroring related functions are only supported on octopus
builds. Right now the demand is for snapshot based mirroring, which is
new in octopus. We can always relax this in the future and add the
necessary support for nautilus, for journaling only based mirroring.
Signed-off-by: John Mulligan <jmulligan@redhat.com>