mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
shunloadtest: Resolve Coverity CHECKED_RETURN error
The shunloadStart function didn't check the status of virInitialize which was flagged by Coverity. Adjust the function and shunloadtest in order to handle the situation.
This commit is contained in:
@@ -36,16 +36,20 @@ static void shunloadError(void *userData ATTRIBUTE_UNUSED,
|
||||
{
|
||||
}
|
||||
|
||||
void shunloadStart(void);
|
||||
int shunloadStart(void);
|
||||
|
||||
void shunloadStart(void) {
|
||||
int shunloadStart(void) {
|
||||
virConnectPtr conn;
|
||||
|
||||
virSetErrorFunc(NULL, shunloadError);
|
||||
virInitialize();
|
||||
if (virInitialize() < 0)
|
||||
return -1;
|
||||
|
||||
conn = virConnectOpen("test:///default");
|
||||
virDomainDestroy(NULL);
|
||||
if (conn)
|
||||
if (conn) {
|
||||
virConnectClose(conn);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user