Open nak3 opened 7 years ago
Why is this patch needed? What is it resolving? Normally you do not want to close something which was not created. Some functions return nil
, so this could would panic in that situation.
This fix needs to wait for go-tcmu's fix https://github.com/coreos/go-tcmu/pull/8/files (I commented it above.). And it will never return nil
nor cause panic.
The reason why this patch needed is that preEnableTcmu()
in go-tcmu creates the device directories. So, if preEnableTcmu()
was called but Close()
was not called, the directories would remain. Then, restart process will fail.
This patch needs to wait for upstream (go-tcmu)'s fix, since OpenTCMUDevice() doesn't return
device
currently. (c.f device.go)