]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vbox: Make FindMedium support old vbox versions
authorTaowei Luo <uaedante@gmail.com>
Fri, 24 Oct 2014 01:46:43 +0000 (09:46 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 29 Oct 2014 00:21:40 +0000 (01:21 +0100)
commit1599319c7e31b8351e7ce2ed17abaa37d86dd3d6
tree642f984ff8af3dffa2df9a8ec21e86964ce8e8cf
parentf67ae174ebd9c1aab2efcb5a129193fba05c229e
vbox: Make FindMedium support old vbox versions

In old version, function FindMedium in UIVirtualBox doesn't work
for vbox2.2 and 3.0. We assume it will not be used when vbox in
these versions.

But when rewriting vboxStorageVolLookupByPath, we found it was
compatibe to use FindMedium to get a IHardDisk object, even in
vbox old versions. To achieve this, first make FindMedium call
FindHardDisk when VBOX_API_VERSION < 4000000.
Then change the argument type **IMedium to **IHardDisk. (As the
rules in heriachy, we can't transfer a IHardDisk to match
IMedium in output)

In vbox 2.2 and 3.0, the caller must be aware that they will get
a IHardDisk object in return.
src/vbox/vbox_common.c
src/vbox/vbox_tmpl.c
src/vbox/vbox_uniformed_api.h