]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vbox: handle errors of virDomainHostdevDefAlloc correctly
authorRyota Ozaki <ozaki.ryota@gmail.com>
Sun, 1 Dec 2013 14:46:06 +0000 (23:46 +0900)
committerDaniel Veillard <veillard@redhat.com>
Mon, 2 Dec 2013 02:59:21 +0000 (10:59 +0800)
commit1ed7e014dd37bd1bdad26765743f55de27f5dac0
treee254cb163663e88c387f906b014b261e638aa268
parent82b5dd23f30e54b7caa3b9d82f1e3819a803fda8
vbox: handle errors of virDomainHostdevDefAlloc correctly

The original code ignored errors of virDomainHostdevDefAlloc,
however, we should properly do error return from the function
if it occurs.

The fix pulls out virDomainHostdevDefAlloc from the loop and
executes it all together before the loop. So we can easily
return on errors without the notion of other memory allocations
in the loop.

The deallocation code is separated from the allocation code
because it will be used by a further patch for fixing other error
handlings.

Reported-by: Laine Stump <laine@laine.org>
Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
src/vbox/vbox_tmpl.c