[PATCH] storage: Don't overwrite error in virISCSIDirectDisconnect()

Jano Tomko jtomko at redhat.com
Tue Jun 8 15:00:06 UTC 2021


On 6/2/21 10:46 AM, Michal Privoznik wrote:
> The iscsi-direct storage pool backend works merely like this: a
> connection is established to the target (usually done via
> virStorageBackendISCSIDirectSetConnection()), intended action is
> executed (e.g. reporting LUNs, volume wiping), and at the end the
> connection is closed via virISCSIDirectDisconnect().
> 
> The problem is that virISCSIDirectDisconnect() reports its own
> errors which may overwrite error that occurred during LUN
> reporting, or volume wiping or whatever.
> 
> To fix this, use virErrorPreserveLast() + virErrorRestore()
> combo, which either preserves previously reported error message,
> or is NOP if there's no error reported.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1797879
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/storage/storage_backend_iscsi_direct.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210608/d8ff1153/attachment-0001.sig>


More information about the libvir-list mailing list