vz: give nice report if network device not found

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
Nikolay Shirokovskiy 2016-04-20 17:05:35 +03:00 committed by Maxim Nestratov
parent 3cea593f35
commit 2e4bed1b81

View File

@ -3073,6 +3073,7 @@ prlsdkFindNetByMAC(PRL_HANDLE sdkdom, virMacAddrPtr mac)
PRL_HANDLE adapter = PRL_INVALID_HANDLE;
char adapterMac[PRL_MAC_STRING_BUFNAME];
char expectedMac[PRL_MAC_STRING_BUFNAME];
char virMac[VIR_MAC_STRING_BUFLEN];
prlsdkFormatMac(mac, expectedMac);
@ -3094,6 +3095,9 @@ prlsdkFindNetByMAC(PRL_HANDLE sdkdom, virMacAddrPtr mac)
adapter = PRL_INVALID_HANDLE;
}
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No net with mac '%s'"), virMacAddrFormat(mac, virMac));
cleanup:
PrlHandle_Free(adapter);
return adapter;