]> xenbits.xensource.com Git - libvirt.git/commit
virHostdevPrepareSCSIVHostDevices: Simplify logic
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 15 Jun 2019 07:37:18 +0000 (09:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Jun 2019 08:29:54 +0000 (10:29 +0200)
commitdf07ccc6e1ceb55a34369f9e65ae921d29c05a29
treef16f239e736ca039f5c16955ad6d27b54810b7b8
parent35d61939bc3c4df1d447edfae02efd18f838d7c3
virHostdevPrepareSCSIVHostDevices: Simplify logic

Couple of things happening in this patch:

1) We can mark the device we're adding onto active list as used
   way before - when adding it onto temporary list.

2) When actually moving device from a temporary helper list onto
   the list of active devices we check if the device isn't
   already there. The same check is performed by
   virSCSIVHostDeviceListAdd() later. Drop this duplicity.

3) The 'error' label is renamed to 'rollback' to reflect what it
   is actually doing. While in the rest of the code we don't
   allow random label names, this source file is different.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virhostdev.c