Commit Graph

7 Commits

Author SHA1 Message Date
Michal Privoznik
bfd91dc0c4 storage: Properly terminate secrets
The virSecretGetSecretString() helper looks up a secret for given
pool and returns its value in @secret_value and its length in
@secret_value_size. However, the trailing '\0' is not included in
either of the variables. This is because usually the value of the
secret is passed to some encoder (usually base64 encoder) where
the trailing zero must not be accounted for.

However, in two places we actually want the string as we don't
process it any further.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-08-15 17:11:16 +02:00
Clementine Hayat
e41bfae562 storage: add wipeVol to iscsi-direct storage backend
Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-13 08:44:34 +02:00
Clementine Hayat
e68426f0ad storage: add SetConnection to iscsi-direct backend
The code to set the connection and connect using libiscsi will always be
the same. Add function to avoid code duplication.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-13 08:20:06 +02:00
Clementine Hayat
14bfe9fa84 storage: refactor volume capacity in iscsi-direct backend
The size of blocks inside a volume and the number of blocks are needed
later. Having a function that return thoses information will avoid code
duplication.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-13 08:09:03 +02:00
Clementine Hayat
01dd26811a storage: add findPoolSources to iscsi_direct pool backend
Change the SetContext function to be able to take the session type in
argument.
Took the function findPoolSources of iscsi backend and wired it to my
function since the formatting is essentially the same.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-06 12:24:18 +02:00
Clementine Hayat
91a3d88a61 storage: Implement iscsi_direct pool backend
We need here libiscsi for the storgae pool backend.
For the iscsi-direct storage pool, only checkPool and refreshPool should
be necessary for basic support.
The pool is state-less and just need the informations within the volume
to work.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-06 12:23:55 +02:00
Clementine Hayat
f0bf1be3e7 storage: Introduce iscsi_direct pool type
Introducing the pool as a noop. Integration inside the build
system. Implementation will be in the following commits.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-08-06 12:23:55 +02:00