• R
    vbox: handle errors of virDomainHostdevDefAlloc correctly · 1ed7e014
    Ryota Ozaki 提交于
    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: NLaine Stump <laine@laine.org>
    Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
    1ed7e014
vbox_tmpl.c 342.4 KB