提交 c66150ec 编写于 作者: J Jovanka Gulicoska 提交者: Cole Robinson

tests: More usage of virGetLastErrorMessage()

Use virGetLastErrorMessage() instead of virGetLastError() in tests
上级 ee7e99fe
...@@ -178,8 +178,7 @@ static int test2(const void *unused ATTRIBUTE_UNUSED) ...@@ -178,8 +178,7 @@ static int test2(const void *unused ATTRIBUTE_UNUSED)
int ret; int ret;
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -190,8 +189,7 @@ static int test2(const void *unused ATTRIBUTE_UNUSED) ...@@ -190,8 +189,7 @@ static int test2(const void *unused ATTRIBUTE_UNUSED)
} }
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -218,8 +216,7 @@ static int test3(const void *unused ATTRIBUTE_UNUSED) ...@@ -218,8 +216,7 @@ static int test3(const void *unused ATTRIBUTE_UNUSED)
VIR_COMMAND_PASS_FD_CLOSE_PARENT); VIR_COMMAND_PASS_FD_CLOSE_PARENT);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
...@@ -260,8 +257,7 @@ static int test4(const void *unused ATTRIBUTE_UNUSED) ...@@ -260,8 +257,7 @@ static int test4(const void *unused ATTRIBUTE_UNUSED)
virCommandDaemonize(cmd); virCommandDaemonize(cmd);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
...@@ -294,8 +290,7 @@ static int test5(const void *unused ATTRIBUTE_UNUSED) ...@@ -294,8 +290,7 @@ static int test5(const void *unused ATTRIBUTE_UNUSED)
virCommandAddEnvPassCommon(cmd); virCommandAddEnvPassCommon(cmd);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -318,8 +313,7 @@ static int test6(const void *unused ATTRIBUTE_UNUSED) ...@@ -318,8 +313,7 @@ static int test6(const void *unused ATTRIBUTE_UNUSED)
virCommandAddEnvPassBlockSUID(cmd, "DOESNOTEXIST", NULL); virCommandAddEnvPassBlockSUID(cmd, "DOESNOTEXIST", NULL);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -343,8 +337,7 @@ static int test7(const void *unused ATTRIBUTE_UNUSED) ...@@ -343,8 +337,7 @@ static int test7(const void *unused ATTRIBUTE_UNUSED)
virCommandAddEnvPassBlockSUID(cmd, "DOESNOTEXIST", NULL); virCommandAddEnvPassBlockSUID(cmd, "DOESNOTEXIST", NULL);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -368,8 +361,7 @@ static int test8(const void *unused ATTRIBUTE_UNUSED) ...@@ -368,8 +361,7 @@ static int test8(const void *unused ATTRIBUTE_UNUSED)
virCommandAddEnvPair(cmd, "USER", "test"); virCommandAddEnvPair(cmd, "USER", "test");
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -406,8 +398,7 @@ static int test9(const void *unused ATTRIBUTE_UNUSED) ...@@ -406,8 +398,7 @@ static int test9(const void *unused ATTRIBUTE_UNUSED)
} }
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -432,8 +423,7 @@ static int test10(const void *unused ATTRIBUTE_UNUSED) ...@@ -432,8 +423,7 @@ static int test10(const void *unused ATTRIBUTE_UNUSED)
virCommandAddArgSet(cmd, args); virCommandAddArgSet(cmd, args);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -456,8 +446,7 @@ static int test11(const void *unused ATTRIBUTE_UNUSED) ...@@ -456,8 +446,7 @@ static int test11(const void *unused ATTRIBUTE_UNUSED)
virCommandPtr cmd = virCommandNewArgs(args); virCommandPtr cmd = virCommandNewArgs(args);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -478,8 +467,7 @@ static int test12(const void *unused ATTRIBUTE_UNUSED) ...@@ -478,8 +467,7 @@ static int test12(const void *unused ATTRIBUTE_UNUSED)
virCommandSetInputBuffer(cmd, "Hello World\n"); virCommandSetInputBuffer(cmd, "Hello World\n");
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
virCommandFree(cmd); virCommandFree(cmd);
return -1; return -1;
} }
...@@ -506,8 +494,7 @@ static int test13(const void *unused ATTRIBUTE_UNUSED) ...@@ -506,8 +494,7 @@ static int test13(const void *unused ATTRIBUTE_UNUSED)
virCommandSetOutputBuffer(cmd, &outactual); virCommandSetOutputBuffer(cmd, &outactual);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
if (!outactual) if (!outactual)
...@@ -559,8 +546,7 @@ static int test14(const void *unused ATTRIBUTE_UNUSED) ...@@ -559,8 +546,7 @@ static int test14(const void *unused ATTRIBUTE_UNUSED)
virCommandSetErrorBuffer(cmd, &erractual); virCommandSetErrorBuffer(cmd, &erractual);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
if (!outactual || !erractual) if (!outactual || !erractual)
...@@ -573,8 +559,7 @@ static int test14(const void *unused ATTRIBUTE_UNUSED) ...@@ -573,8 +559,7 @@ static int test14(const void *unused ATTRIBUTE_UNUSED)
virCommandSetOutputBuffer(cmd, &jointactual); virCommandSetOutputBuffer(cmd, &jointactual);
virCommandSetErrorBuffer(cmd, &jointactual); virCommandSetErrorBuffer(cmd, &jointactual);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
if (!jointactual) if (!jointactual)
...@@ -620,8 +605,7 @@ static int test15(const void *unused ATTRIBUTE_UNUSED) ...@@ -620,8 +605,7 @@ static int test15(const void *unused ATTRIBUTE_UNUSED)
virCommandSetUmask(cmd, 002); virCommandSetUmask(cmd, 002);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
...@@ -651,8 +635,7 @@ static int test16(const void *unused ATTRIBUTE_UNUSED) ...@@ -651,8 +635,7 @@ static int test16(const void *unused ATTRIBUTE_UNUSED)
virCommandAddArg(cmd, "G H"); virCommandAddArg(cmd, "G H");
if ((outactual = virCommandToString(cmd)) == NULL) { if ((outactual = virCommandToString(cmd)) == NULL) {
virErrorPtr err = virGetLastError(); printf("Cannot convert to string: %s\n", virGetLastErrorMessage());
printf("Cannot convert to string: %s\n", err->message);
goto cleanup; goto cleanup;
} }
if ((fd = open(abs_builddir "/commandhelper.log", if ((fd = open(abs_builddir "/commandhelper.log",
...@@ -697,8 +680,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED) ...@@ -697,8 +680,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED)
} }
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
...@@ -720,8 +702,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED) ...@@ -720,8 +702,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED)
} }
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
...@@ -756,8 +737,7 @@ static int test18(const void *unused ATTRIBUTE_UNUSED) ...@@ -756,8 +737,7 @@ static int test18(const void *unused ATTRIBUTE_UNUSED)
alarm(5); alarm(5);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
alarm(0); alarm(0);
...@@ -798,8 +778,7 @@ static int test19(const void *unused ATTRIBUTE_UNUSED) ...@@ -798,8 +778,7 @@ static int test19(const void *unused ATTRIBUTE_UNUSED)
alarm(5); alarm(5);
if (virCommandRunAsync(cmd, &pid) < 0) { if (virCommandRunAsync(cmd, &pid) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
...@@ -848,8 +827,7 @@ static int test20(const void *unused ATTRIBUTE_UNUSED) ...@@ -848,8 +827,7 @@ static int test20(const void *unused ATTRIBUTE_UNUSED)
virCommandSetInputBuffer(cmd, buf); virCommandSetInputBuffer(cmd, buf);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
...@@ -891,8 +869,7 @@ static int test21(const void *unused ATTRIBUTE_UNUSED) ...@@ -891,8 +869,7 @@ static int test21(const void *unused ATTRIBUTE_UNUSED)
virCommandDoAsyncIO(cmd); virCommandDoAsyncIO(cmd);
if (virCommandRunAsync(cmd, NULL) < 0) { if (virCommandRunAsync(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
...@@ -930,8 +907,7 @@ test22(const void *unused ATTRIBUTE_UNUSED) ...@@ -930,8 +907,7 @@ test22(const void *unused ATTRIBUTE_UNUSED)
cmd = virCommandNewArgList("/bin/sh", "-c", "exit 3", NULL); cmd = virCommandNewArgList("/bin/sh", "-c", "exit 3", NULL);
if (virCommandRun(cmd, &status) < 0) { if (virCommandRun(cmd, &status) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
if (status != 3) { if (status != 3) {
...@@ -941,8 +917,7 @@ test22(const void *unused ATTRIBUTE_UNUSED) ...@@ -941,8 +917,7 @@ test22(const void *unused ATTRIBUTE_UNUSED)
virCommandRawStatus(cmd); virCommandRawStatus(cmd);
if (virCommandRun(cmd, &status) < 0) { if (virCommandRun(cmd, &status) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
if (!WIFEXITED(status) || WEXITSTATUS(status) != 3) { if (!WIFEXITED(status) || WEXITSTATUS(status) != 3) {
...@@ -960,8 +935,7 @@ test22(const void *unused ATTRIBUTE_UNUSED) ...@@ -960,8 +935,7 @@ test22(const void *unused ATTRIBUTE_UNUSED)
virCommandRawStatus(cmd); virCommandRawStatus(cmd);
if (virCommandRun(cmd, &status) < 0) { if (virCommandRun(cmd, &status) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
if (!WIFSIGNALED(status) || WTERMSIG(status) != SIGKILL) { if (!WIFSIGNALED(status) || WTERMSIG(status) != SIGKILL) {
...@@ -1057,8 +1031,7 @@ static int test24(const void *unused ATTRIBUTE_UNUSED) ...@@ -1057,8 +1031,7 @@ static int test24(const void *unused ATTRIBUTE_UNUSED)
virCommandPassListenFDs(cmd); virCommandPassListenFDs(cmd);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virErrorPtr err = virGetLastError(); printf("Cannot run child %s\n", virGetLastErrorMessage());
printf("Cannot run child %s\n", err->message);
goto cleanup; goto cleanup;
} }
......
...@@ -102,7 +102,7 @@ testCorrupt(const void *opaque) ...@@ -102,7 +102,7 @@ testCorrupt(const void *opaque)
data->params, data->params,
data->paramnum, data->paramnum,
&type); &type);
virErrorPtr err = NULL; const char *err = NULL;
if (!newdata) if (!newdata)
return -1; return -1;
...@@ -115,15 +115,15 @@ testCorrupt(const void *opaque) ...@@ -115,15 +115,15 @@ testCorrupt(const void *opaque)
goto cleanup; goto cleanup;
} }
err = virGetLastError(); err = virGetLastErrorMessage();
if (!err || !err->message) { if (!err) {
VIR_DEBUG("No error or message %p", err); VIR_DEBUG("No error or message %p", err);
ret = -1; ret = -1;
goto cleanup; goto cleanup;
} }
#if !WITH_SASL #if !WITH_SASL
if (strstr(err->message, "unsupported auth sasl")) { if (strstr(err, "unsupported auth sasl")) {
VIR_DEBUG("sasl unsupported, skipping this config"); VIR_DEBUG("sasl unsupported, skipping this config");
goto cleanup; goto cleanup;
} }
...@@ -131,24 +131,24 @@ testCorrupt(const void *opaque) ...@@ -131,24 +131,24 @@ testCorrupt(const void *opaque)
switch (type) { switch (type) {
case VIR_CONF_ULONG: case VIR_CONF_ULONG:
if (!strstr(err->message, "invalid type: got string; expected unsigned long") && if (!strstr(err, "invalid type: got string; expected unsigned long") &&
!strstr(err->message, "invalid type: got string; expected long")) { !strstr(err, "invalid type: got string; expected long")) {
VIR_DEBUG("Wrong error for long: '%s'", VIR_DEBUG("Wrong error for long: '%s'",
err->message); err);
ret = -1; ret = -1;
} }
break; break;
case VIR_CONF_STRING: case VIR_CONF_STRING:
if (!strstr(err->message, "invalid type: got unsigned long; expected string")) { if (!strstr(err, "invalid type: got unsigned long; expected string")) {
VIR_DEBUG("Wrong error for string: '%s'", VIR_DEBUG("Wrong error for string: '%s'",
err->message); err);
ret = -1; ret = -1;
} }
break; break;
case VIR_CONF_LIST: case VIR_CONF_LIST:
if (!strstr(err->message, "must be a string or list of strings")) { if (!strstr(err, "must be a string or list of strings")) {
VIR_DEBUG("Wrong error for list: '%s'", VIR_DEBUG("Wrong error for list: '%s'",
err->message); err);
ret = -1; ret = -1;
} }
break; break;
...@@ -212,8 +212,8 @@ mymain(void) ...@@ -212,8 +212,8 @@ mymain(void)
} }
if (virFileReadAll(filename, 1024*1024, &filedata) < 0) { if (virFileReadAll(filename, 1024*1024, &filedata) < 0) {
virErrorPtr err = virGetLastError(); const char *err = virGetLastErrorMessage();
fprintf(stderr, "Cannot load %s for testing: %s", filename, err->message); fprintf(stderr, "Cannot load %s for testing: %s", filename, err);
ret = -1; ret = -1;
goto cleanup; goto cleanup;
} }
......
...@@ -75,7 +75,6 @@ testReadNetworkConf(const void *data ATTRIBUTE_UNUSED) ...@@ -75,7 +75,6 @@ testReadNetworkConf(const void *data ATTRIBUTE_UNUSED)
int result = -1; int result = -1;
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
char *actual = NULL; char *actual = NULL;
virErrorPtr err = NULL;
const char *expected = const char *expected =
"<domain type='openvz'>\n" "<domain type='openvz'>\n"
" <uuid>00000000-0000-0000-0000-000000000000</uuid>\n" " <uuid>00000000-0000-0000-0000-000000000000</uuid>\n"
...@@ -110,16 +109,14 @@ testReadNetworkConf(const void *data ATTRIBUTE_UNUSED) ...@@ -110,16 +109,14 @@ testReadNetworkConf(const void *data ATTRIBUTE_UNUSED)
def->os.type = VIR_DOMAIN_OSTYPE_EXE; def->os.type = VIR_DOMAIN_OSTYPE_EXE;
if (openvzReadNetworkConf(def, 1) < 0) { if (openvzReadNetworkConf(def, 1) < 0) {
err = virGetLastError(); fprintf(stderr, "ERROR: %s\n", virGetLastErrorMessage());
fprintf(stderr, "ERROR: %s\n", err != NULL ? err->message : "<unknown>");
goto cleanup; goto cleanup;
} }
actual = virDomainDefFormat(def, NULL, VIR_DOMAIN_DEF_FORMAT_INACTIVE); actual = virDomainDefFormat(def, NULL, VIR_DOMAIN_DEF_FORMAT_INACTIVE);
if (actual == NULL) { if (actual == NULL) {
err = virGetLastError(); fprintf(stderr, "ERROR: %s\n", virGetLastErrorMessage());
fprintf(stderr, "ERROR: %s\n", err != NULL ? err->message : "<unknown>");
goto cleanup; goto cleanup;
} }
......
...@@ -35,9 +35,8 @@ eventLoop(void *opaque ATTRIBUTE_UNUSED) ...@@ -35,9 +35,8 @@ eventLoop(void *opaque ATTRIBUTE_UNUSED)
{ {
while (1) { while (1) {
if (virEventRunDefaultImpl() < 0) { if (virEventRunDefaultImpl() < 0) {
virErrorPtr err = virGetLastError();
fprintf(stderr, "Failed to run event loop: %s\n", fprintf(stderr, "Failed to run event loop: %s\n",
err && err->message ? err->message : "Unknown error"); virGetLastErrorMessage());
} }
} }
} }
...@@ -63,9 +62,8 @@ main(int argc, char **argv) ...@@ -63,9 +62,8 @@ main(int argc, char **argv)
} }
if (virEventRegisterDefaultImpl() < 0) { if (virEventRegisterDefaultImpl() < 0) {
virErrorPtr err = virGetLastError();
fprintf(stderr, "Failed to register event implementation: %s\n", fprintf(stderr, "Failed to register event implementation: %s\n",
err && err->message ? err->message: "Unknown error"); virGetLastErrorMessage());
return EXIT_FAILURE; return EXIT_FAILURE;
} }
......
...@@ -230,8 +230,7 @@ testSELinuxGenLabel(const void *opaque) ...@@ -230,8 +230,7 @@ testSELinuxGenLabel(const void *opaque)
goto cleanup; goto cleanup;
if (virSecurityManagerGenLabel(data->mgr, def) < 0) { if (virSecurityManagerGenLabel(data->mgr, def) < 0) {
virErrorPtr err = virGetLastError(); fprintf(stderr, "Cannot generate label: %s\n", virGetLastErrorMessage());
fprintf(stderr, "Cannot generate label: %s\n", err->message);
goto cleanup; goto cleanup;
} }
...@@ -275,9 +274,8 @@ mymain(void) ...@@ -275,9 +274,8 @@ mymain(void)
if (!(mgr = virSecurityManagerNew("selinux", "QEMU", if (!(mgr = virSecurityManagerNew("selinux", "QEMU",
VIR_SECURITY_MANAGER_DEFAULT_CONFINED | VIR_SECURITY_MANAGER_DEFAULT_CONFINED |
VIR_SECURITY_MANAGER_PRIVILEGED))) { VIR_SECURITY_MANAGER_PRIVILEGED))) {
virErrorPtr err = virGetLastError();
fprintf(stderr, "Unable to initialize security driver: %s\n", fprintf(stderr, "Unable to initialize security driver: %s\n",
err->message); virGetLastErrorMessage());
return EXIT_FAILURE; return EXIT_FAILURE;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册