portnov / libvirt-hs

This package provides low-level (at this moment, at least) FFI bindings to libvirt library.
http://hackage.haskell.org/package/libvirt-hs
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

fix openConnection to use the more flexible API #4

Closed abuibrahim closed 8 years ago

abuibrahim commented 8 years ago

openConnection will now prompt for username/password when connecting to ESXi. Tested with VMware vSphere Hypervisor 6.

portnov commented 8 years ago

Hello Did you test this with other hypervisors? Right now I'm just not sure how that supposed to work... Maybe add another function, smth like openConnectionPromptAuth, instead of chaning existing one?

abuibrahim commented 8 years ago

I tested qemu+ssh backend to make sure I didn't brake it. This fixes Hyper-V as well. See https://libvirt.org/drvhyperv.html (authentication section).

I was thinking of adding another openConnectionAuth but exposing the virConnectAuth struct with callbacks and everything to Haskell looked a bit cumbersome. virConnectOpenAuth with virConnectAuthPtrDefault passed in behaves the same as virConnectOpen and unbreaks ESXi and Hyper-V. Since this change doesn't break any existing code we could treat it as improvement of "openConnection" IMHO.