mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
libvirt,logging: cleanup VIR_XXX0()
These VIR_XXXX0 APIs make us confused, use the non-0-suffix APIs instead. How do these coversions works? The magic is using the gcc extension of ##. When __VA_ARGS__ is empty, "##" will swallow the "," in "fmt," to avoid compile error. example: origin after CPP high_level_api("%d", a_int) low_level_api("%d", a_int) high_level_api("a string") low_level_api("a string") About 400 conversions. 8 special conversions: VIR_XXXX0("") -> VIR_XXXX("msg") (avoid empty format) 2 conversions VIR_XXXX0(string_literal_with_%) -> VIR_XXXX(%->%%) 0 conversions VIR_XXXX0(non_string_literal) -> VIR_XXXX("%s", non_string_literal) (for security) 6 conversions Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
This commit is contained in:
parent
0e5a7ace8a
commit
b65f37a4a1
3
cfg.mk
3
cfg.mk
@ -390,7 +390,6 @@ msg_gen_function += ESX_ERROR
|
|||||||
msg_gen_function += ESX_VI_ERROR
|
msg_gen_function += ESX_VI_ERROR
|
||||||
msg_gen_function += PHYP_ERROR
|
msg_gen_function += PHYP_ERROR
|
||||||
msg_gen_function += VIR_ERROR
|
msg_gen_function += VIR_ERROR
|
||||||
msg_gen_function += VIR_ERROR0
|
|
||||||
msg_gen_function += VMX_ERROR
|
msg_gen_function += VMX_ERROR
|
||||||
msg_gen_function += XENXS_ERROR
|
msg_gen_function += XENXS_ERROR
|
||||||
msg_gen_function += eventReportError
|
msg_gen_function += eventReportError
|
||||||
@ -525,7 +524,7 @@ sc_copyright_format:
|
|||||||
# Some functions/macros produce messages intended solely for developers
|
# Some functions/macros produce messages intended solely for developers
|
||||||
# and maintainers. Do not mark them for translation.
|
# and maintainers. Do not mark them for translation.
|
||||||
sc_prohibit_gettext_markup:
|
sc_prohibit_gettext_markup:
|
||||||
@prohibit='\<VIR_(WARN|DEBUG)0? *\(_\(' \
|
@prohibit='\<VIR_(WARN|DEBUG) *\(_\(' \
|
||||||
halt='do not mark these strings for translation' \
|
halt='do not mark these strings for translation' \
|
||||||
$(_sc_search_regexp)
|
$(_sc_search_regexp)
|
||||||
|
|
||||||
|
@ -413,11 +413,11 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
switch (siginfo.si_signo) {
|
switch (siginfo.si_signo) {
|
||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
VIR_INFO0(_("Reloading configuration on SIGHUP"));
|
VIR_INFO(_("Reloading configuration on SIGHUP"));
|
||||||
virHookCall(VIR_HOOK_DRIVER_DAEMON, "-",
|
virHookCall(VIR_HOOK_DRIVER_DAEMON, "-",
|
||||||
VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL);
|
VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL);
|
||||||
if (virStateReload() < 0)
|
if (virStateReload() < 0)
|
||||||
VIR_WARN0("Error while reloading drivers");
|
VIR_WARN("Error while reloading drivers");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -566,7 +566,7 @@ static int qemudListenUnix(struct qemud_server *server,
|
|||||||
char ebuf[1024];
|
char ebuf[1024];
|
||||||
|
|
||||||
if (VIR_ALLOC(sock) < 0) {
|
if (VIR_ALLOC(sock) < 0) {
|
||||||
VIR_ERROR0(_("Failed to allocate memory for struct qemud_socket"));
|
VIR_ERROR(_("Failed to allocate memory for struct qemud_socket"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -875,7 +875,7 @@ static struct qemud_server *qemudInitialize(void) {
|
|||||||
struct qemud_server *server;
|
struct qemud_server *server;
|
||||||
|
|
||||||
if (VIR_ALLOC(server) < 0) {
|
if (VIR_ALLOC(server) < 0) {
|
||||||
VIR_ERROR0(_("Failed to allocate struct qemud_server"));
|
VIR_ERROR(_("Failed to allocate struct qemud_server"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -883,12 +883,12 @@ static struct qemud_server *qemudInitialize(void) {
|
|||||||
server->sigread = server->sigwrite = -1;
|
server->sigread = server->sigwrite = -1;
|
||||||
|
|
||||||
if (virMutexInit(&server->lock) < 0) {
|
if (virMutexInit(&server->lock) < 0) {
|
||||||
VIR_ERROR0(_("cannot initialize mutex"));
|
VIR_ERROR(_("cannot initialize mutex"));
|
||||||
VIR_FREE(server);
|
VIR_FREE(server);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (virCondInit(&server->job) < 0) {
|
if (virCondInit(&server->job) < 0) {
|
||||||
VIR_ERROR0(_("cannot initialize condition variable"));
|
VIR_ERROR(_("cannot initialize condition variable"));
|
||||||
virMutexDestroy(&server->lock);
|
virMutexDestroy(&server->lock);
|
||||||
VIR_FREE(server);
|
VIR_FREE(server);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1103,7 +1103,7 @@ static int qemudNetworkEnable(struct qemud_server *server) {
|
|||||||
VIR_EVENT_HANDLE_HANGUP,
|
VIR_EVENT_HANDLE_HANGUP,
|
||||||
qemudDispatchServerEvent,
|
qemudDispatchServerEvent,
|
||||||
server, NULL)) < 0) {
|
server, NULL)) < 0) {
|
||||||
VIR_ERROR0(_("Failed to add server event callback"));
|
VIR_ERROR(_("Failed to add server event callback"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1189,29 +1189,29 @@ remoteCheckCertificate(struct qemud_client *client)
|
|||||||
|
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
if (status & GNUTLS_CERT_INVALID)
|
if (status & GNUTLS_CERT_INVALID)
|
||||||
VIR_ERROR0(_("The client certificate is not trusted."));
|
VIR_ERROR(_("The client certificate is not trusted."));
|
||||||
|
|
||||||
if (status & GNUTLS_CERT_SIGNER_NOT_FOUND)
|
if (status & GNUTLS_CERT_SIGNER_NOT_FOUND)
|
||||||
VIR_ERROR0(_("The client certificate has unknown issuer."));
|
VIR_ERROR(_("The client certificate has unknown issuer."));
|
||||||
|
|
||||||
if (status & GNUTLS_CERT_REVOKED)
|
if (status & GNUTLS_CERT_REVOKED)
|
||||||
VIR_ERROR0(_("The client certificate has been revoked."));
|
VIR_ERROR(_("The client certificate has been revoked."));
|
||||||
|
|
||||||
#ifndef GNUTLS_1_0_COMPAT
|
#ifndef GNUTLS_1_0_COMPAT
|
||||||
if (status & GNUTLS_CERT_INSECURE_ALGORITHM)
|
if (status & GNUTLS_CERT_INSECURE_ALGORITHM)
|
||||||
VIR_ERROR0(_("The client certificate uses an insecure algorithm."));
|
VIR_ERROR(_("The client certificate uses an insecure algorithm."));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
goto authdeny;
|
goto authdeny;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gnutls_certificate_type_get(client->tlssession) != GNUTLS_CRT_X509) {
|
if (gnutls_certificate_type_get(client->tlssession) != GNUTLS_CRT_X509) {
|
||||||
VIR_ERROR0(_("Only x509 certificates are supported"));
|
VIR_ERROR(_("Only x509 certificates are supported"));
|
||||||
goto authdeny;
|
goto authdeny;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(certs = gnutls_certificate_get_peers(client->tlssession, &nCerts))) {
|
if (!(certs = gnutls_certificate_get_peers(client->tlssession, &nCerts))) {
|
||||||
VIR_ERROR0(_("The certificate has no peers"));
|
VIR_ERROR(_("The certificate has no peers"));
|
||||||
goto authdeny;
|
goto authdeny;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1221,12 +1221,12 @@ remoteCheckCertificate(struct qemud_client *client)
|
|||||||
gnutls_x509_crt_t cert;
|
gnutls_x509_crt_t cert;
|
||||||
|
|
||||||
if (gnutls_x509_crt_init (&cert) < 0) {
|
if (gnutls_x509_crt_init (&cert) < 0) {
|
||||||
VIR_ERROR0(_("Unable to initialize certificate"));
|
VIR_ERROR(_("Unable to initialize certificate"));
|
||||||
goto authfail;
|
goto authfail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gnutls_x509_crt_import(cert, &certs[i], GNUTLS_X509_FMT_DER) < 0) {
|
if (gnutls_x509_crt_import(cert, &certs[i], GNUTLS_X509_FMT_DER) < 0) {
|
||||||
VIR_ERROR0(_("Unable to load certificate"));
|
VIR_ERROR(_("Unable to load certificate"));
|
||||||
gnutls_x509_crt_deinit (cert);
|
gnutls_x509_crt_deinit (cert);
|
||||||
goto authfail;
|
goto authfail;
|
||||||
}
|
}
|
||||||
@ -1242,7 +1242,7 @@ remoteCheckCertificate(struct qemud_client *client)
|
|||||||
|
|
||||||
if (!remoteCheckDN (name)) {
|
if (!remoteCheckDN (name)) {
|
||||||
/* This is the most common error: make it informative. */
|
/* This is the most common error: make it informative. */
|
||||||
VIR_ERROR0(_("Client's Distinguished Name is not on the list "
|
VIR_ERROR(_("Client's Distinguished Name is not on the list "
|
||||||
"of allowed clients (tls_allowed_dn_list). Use "
|
"of allowed clients (tls_allowed_dn_list). Use "
|
||||||
"'certtool -i --infile clientcert.pem' to view the"
|
"'certtool -i --infile clientcert.pem' to view the"
|
||||||
"Distinguished Name field in the client certificate,"
|
"Distinguished Name field in the client certificate,"
|
||||||
@ -1253,13 +1253,13 @@ remoteCheckCertificate(struct qemud_client *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gnutls_x509_crt_get_expiration_time (cert) < now) {
|
if (gnutls_x509_crt_get_expiration_time (cert) < now) {
|
||||||
VIR_ERROR0(_("The client certificate has expired"));
|
VIR_ERROR(_("The client certificate has expired"));
|
||||||
gnutls_x509_crt_deinit (cert);
|
gnutls_x509_crt_deinit (cert);
|
||||||
goto authdeny;
|
goto authdeny;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gnutls_x509_crt_get_activation_time (cert) > now) {
|
if (gnutls_x509_crt_get_activation_time (cert) > now) {
|
||||||
VIR_ERROR0(_("The client certificate is not yet active"));
|
VIR_ERROR(_("The client certificate is not yet active"));
|
||||||
gnutls_x509_crt_deinit (cert);
|
gnutls_x509_crt_deinit (cert);
|
||||||
goto authdeny;
|
goto authdeny;
|
||||||
}
|
}
|
||||||
@ -1285,10 +1285,10 @@ remoteCheckAccess (struct qemud_client *client)
|
|||||||
|
|
||||||
/* Verify client certificate. */
|
/* Verify client certificate. */
|
||||||
if (remoteCheckCertificate (client) == -1) {
|
if (remoteCheckCertificate (client) == -1) {
|
||||||
VIR_ERROR0(_("remoteCheckCertificate: "
|
VIR_ERROR(_("remoteCheckCertificate: "
|
||||||
"failed to verify client's certificate"));
|
"failed to verify client's certificate"));
|
||||||
if (!tls_no_verify_certificate) return -1;
|
if (!tls_no_verify_certificate) return -1;
|
||||||
else VIR_INFO0(_("remoteCheckCertificate: tls_no_verify_certificate "
|
else VIR_INFO(_("remoteCheckCertificate: tls_no_verify_certificate "
|
||||||
"is set so the bad certificate is ignored"));
|
"is set so the bad certificate is ignored"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1356,7 +1356,7 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!(addrstr = virSocketFormatAddrFull(&addr, true, ";"))) {
|
if (!(addrstr = virSocketFormatAddrFull(&addr, true, ";"))) {
|
||||||
VIR_ERROR0(_("Failed to format addresss: out of memory"));
|
VIR_ERROR(_("Failed to format addresss: out of memory"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1371,7 +1371,7 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
|
|||||||
|
|
||||||
if (VIR_RESIZE_N(server->clients, server->nclients_max,
|
if (VIR_RESIZE_N(server->clients, server->nclients_max,
|
||||||
server->nclients, 1) < 0) {
|
server->nclients, 1) < 0) {
|
||||||
VIR_ERROR0(_("Out of memory allocating clients"));
|
VIR_ERROR(_("Out of memory allocating clients"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1408,7 +1408,7 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
|
|||||||
if (VIR_ALLOC(client) < 0)
|
if (VIR_ALLOC(client) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
if (virMutexInit(&client->lock) < 0) {
|
if (virMutexInit(&client->lock) < 0) {
|
||||||
VIR_ERROR0(_("cannot initialize mutex"));
|
VIR_ERROR(_("cannot initialize mutex"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1845,7 +1845,7 @@ readmore:
|
|||||||
|
|
||||||
if (!xdr_u_int(&x, &len)) {
|
if (!xdr_u_int(&x, &len)) {
|
||||||
xdr_destroy (&x);
|
xdr_destroy (&x);
|
||||||
VIR_DEBUG0("Failed to decode packet length");
|
VIR_DEBUG("Failed to decode packet length");
|
||||||
qemudDispatchClientFailure(client);
|
qemudDispatchClientFailure(client);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2298,10 +2298,10 @@ static void qemudInactiveTimer(int timerid, void *data) {
|
|||||||
|
|
||||||
if (virStateActive() ||
|
if (virStateActive() ||
|
||||||
server->clients) {
|
server->clients) {
|
||||||
VIR_DEBUG0("Timer expired but still active, not shutting down");
|
VIR_DEBUG("Timer expired but still active, not shutting down");
|
||||||
virEventUpdateTimeout(timerid, -1);
|
virEventUpdateTimeout(timerid, -1);
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("Timer expired and inactive, shutting down");
|
VIR_DEBUG("Timer expired and inactive, shutting down");
|
||||||
server->quitEventThread = 1;
|
server->quitEventThread = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2345,7 +2345,7 @@ static void *qemudRunLoop(void *opaque) {
|
|||||||
(timerid = virEventAddTimeout(-1,
|
(timerid = virEventAddTimeout(-1,
|
||||||
qemudInactiveTimer,
|
qemudInactiveTimer,
|
||||||
server, NULL)) < 0) {
|
server, NULL)) < 0) {
|
||||||
VIR_ERROR0(_("Failed to register shutdown timeout"));
|
VIR_ERROR(_("Failed to register shutdown timeout"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2354,7 +2354,7 @@ static void *qemudRunLoop(void *opaque) {
|
|||||||
|
|
||||||
server->nworkers = max_workers;
|
server->nworkers = max_workers;
|
||||||
if (VIR_ALLOC_N(server->workers, server->nworkers) < 0) {
|
if (VIR_ALLOC_N(server->workers, server->nworkers) < 0) {
|
||||||
VIR_ERROR0(_("Failed to allocate workers"));
|
VIR_ERROR(_("Failed to allocate workers"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2389,7 +2389,7 @@ static void *qemudRunLoop(void *opaque) {
|
|||||||
virMutexUnlock(&server->lock);
|
virMutexUnlock(&server->lock);
|
||||||
if (qemudOneLoop() < 0) {
|
if (qemudOneLoop() < 0) {
|
||||||
virMutexLock(&server->lock);
|
virMutexLock(&server->lock);
|
||||||
VIR_DEBUG0("Loop iteration error, exiting");
|
VIR_DEBUG("Loop iteration error, exiting");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
virMutexLock(&server->lock);
|
virMutexLock(&server->lock);
|
||||||
@ -2879,7 +2879,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
|
|||||||
GET_CONF_STR (conf, filename, unix_sock_group);
|
GET_CONF_STR (conf, filename, unix_sock_group);
|
||||||
if (unix_sock_group) {
|
if (unix_sock_group) {
|
||||||
if (!server->privileged) {
|
if (!server->privileged) {
|
||||||
VIR_WARN0("Cannot set group when not running as root");
|
VIR_WARN("Cannot set group when not running as root");
|
||||||
} else {
|
} else {
|
||||||
int ret;
|
int ret;
|
||||||
struct group grpdata, *grp;
|
struct group grpdata, *grp;
|
||||||
@ -2889,7 +2889,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
|
|||||||
maxbuf = 1024;
|
maxbuf = 1024;
|
||||||
|
|
||||||
if (VIR_ALLOC_N(buf, maxbuf) < 0) {
|
if (VIR_ALLOC_N(buf, maxbuf) < 0) {
|
||||||
VIR_ERROR0(_("Failed to allocate memory for buffer"));
|
VIR_ERROR(_("Failed to allocate memory for buffer"));
|
||||||
goto free_and_fail;
|
goto free_and_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2898,7 +2898,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
|
|||||||
&grp)) == ERANGE) {
|
&grp)) == ERANGE) {
|
||||||
maxbuf *= 2;
|
maxbuf *= 2;
|
||||||
if (maxbuf > 65536 || VIR_REALLOC_N(buf, maxbuf) < 0) {
|
if (maxbuf > 65536 || VIR_REALLOC_N(buf, maxbuf) < 0) {
|
||||||
VIR_ERROR0(_("Failed to reallocate enough memory for buffer"));
|
VIR_ERROR(_("Failed to reallocate enough memory for buffer"));
|
||||||
goto free_and_fail;
|
goto free_and_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3012,13 +3012,13 @@ qemudSetupPrivs (void)
|
|||||||
|
|
||||||
if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET,
|
if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET,
|
||||||
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
|
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
|
||||||
VIR_ERROR0(_("additional privileges are required"));
|
VIR_ERROR(_("additional privileges are required"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
|
if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
|
||||||
PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) {
|
PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) {
|
||||||
VIR_ERROR0(_("failed to set reduced privileges"));
|
VIR_ERROR(_("failed to set reduced privileges"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3084,7 +3084,7 @@ daemonSetupSignals(struct qemud_server *server)
|
|||||||
VIR_EVENT_HANDLE_READABLE,
|
VIR_EVENT_HANDLE_READABLE,
|
||||||
qemudDispatchSignalEvent,
|
qemudDispatchSignalEvent,
|
||||||
server, NULL) < 0) {
|
server, NULL) < 0) {
|
||||||
VIR_ERROR0(_("Failed to register callback for signal pipe"));
|
VIR_ERROR(_("Failed to register callback for signal pipe"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3374,7 +3374,7 @@ int main(int argc, char **argv) {
|
|||||||
/* Start the event loop in a background thread, since
|
/* Start the event loop in a background thread, since
|
||||||
* state initialization needs events to be being processed */
|
* state initialization needs events to be being processed */
|
||||||
if (qemudStartEventLoop(server) < 0) {
|
if (qemudStartEventLoop(server) < 0) {
|
||||||
VIR_ERROR0(_("Event thread startup failed"));
|
VIR_ERROR(_("Event thread startup failed"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3383,14 +3383,14 @@ int main(int argc, char **argv) {
|
|||||||
* we're ready, since it can take a long time and this will
|
* we're ready, since it can take a long time and this will
|
||||||
* seriously delay OS bootup process */
|
* seriously delay OS bootup process */
|
||||||
if (virStateInitialize(server->privileged) < 0) {
|
if (virStateInitialize(server->privileged) < 0) {
|
||||||
VIR_ERROR0(_("Driver state initialization failed"));
|
VIR_ERROR(_("Driver state initialization failed"));
|
||||||
goto shutdown;
|
goto shutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start accepting new clients from network */
|
/* Start accepting new clients from network */
|
||||||
virMutexLock(&server->lock);
|
virMutexLock(&server->lock);
|
||||||
if (qemudNetworkEnable(server) < 0) {
|
if (qemudNetworkEnable(server) < 0) {
|
||||||
VIR_ERROR0(_("Network event loop enablement failed"));
|
VIR_ERROR(_("Network event loop enablement failed"));
|
||||||
goto shutdown;
|
goto shutdown;
|
||||||
}
|
}
|
||||||
virMutexUnlock(&server->lock);
|
virMutexUnlock(&server->lock);
|
||||||
|
@ -359,7 +359,7 @@ static int remoteRelayDomainEventGraphics(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
data.subject.subject_len = subject->nidentity;
|
data.subject.subject_len = subject->nidentity;
|
||||||
if (VIR_ALLOC_N(data.subject.subject_val, data.subject.subject_len) < 0) {
|
if (VIR_ALLOC_N(data.subject.subject_val, data.subject.subject_len) < 0) {
|
||||||
VIR_WARN0("cannot allocate memory for graphics event subject");
|
VIR_WARN("cannot allocate memory for graphics event subject");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
for (i = 0 ; i < data.subject.subject_len ; i++) {
|
for (i = 0 ; i < data.subject.subject_len ; i++) {
|
||||||
@ -1754,7 +1754,7 @@ remoteDispatchAuthSaslInit(struct qemud_server *server,
|
|||||||
VIR_DEBUG("Initialize SASL auth %d", client->fd);
|
VIR_DEBUG("Initialize SASL auth %d", client->fd);
|
||||||
if (client->auth != REMOTE_AUTH_SASL ||
|
if (client->auth != REMOTE_AUTH_SASL ||
|
||||||
client->saslconn != NULL) {
|
client->saslconn != NULL) {
|
||||||
VIR_ERROR0(_("client tried invalid SASL init request"));
|
VIR_ERROR(_("client tried invalid SASL init request"));
|
||||||
goto authfail;
|
goto authfail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1808,7 +1808,7 @@ remoteDispatchAuthSaslInit(struct qemud_server *server,
|
|||||||
|
|
||||||
cipher = gnutls_cipher_get(client->tlssession);
|
cipher = gnutls_cipher_get(client->tlssession);
|
||||||
if (!(ssf = (sasl_ssf_t)gnutls_cipher_get_key_size(cipher))) {
|
if (!(ssf = (sasl_ssf_t)gnutls_cipher_get_key_size(cipher))) {
|
||||||
VIR_ERROR0(_("cannot get TLS cipher size"));
|
VIR_ERROR(_("cannot get TLS cipher size"));
|
||||||
sasl_dispose(&client->saslconn);
|
sasl_dispose(&client->saslconn);
|
||||||
client->saslconn = NULL;
|
client->saslconn = NULL;
|
||||||
goto authfail;
|
goto authfail;
|
||||||
@ -1870,7 +1870,7 @@ remoteDispatchAuthSaslInit(struct qemud_server *server,
|
|||||||
VIR_DEBUG("Available mechanisms for client: '%s'", mechlist);
|
VIR_DEBUG("Available mechanisms for client: '%s'", mechlist);
|
||||||
ret->mechlist = strdup(mechlist);
|
ret->mechlist = strdup(mechlist);
|
||||||
if (!ret->mechlist) {
|
if (!ret->mechlist) {
|
||||||
VIR_ERROR0(_("cannot allocate mechlist"));
|
VIR_ERROR(_("cannot allocate mechlist"));
|
||||||
sasl_dispose(&client->saslconn);
|
sasl_dispose(&client->saslconn);
|
||||||
client->saslconn = NULL;
|
client->saslconn = NULL;
|
||||||
goto authfail;
|
goto authfail;
|
||||||
@ -1954,7 +1954,7 @@ remoteSASLCheckAccess(struct qemud_server *server,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (val == NULL) {
|
if (val == NULL) {
|
||||||
VIR_ERROR0(_("no client username was found"));
|
VIR_ERROR(_("no client username was found"));
|
||||||
remoteDispatchAuthError(rerr);
|
remoteDispatchAuthError(rerr);
|
||||||
sasl_dispose(&client->saslconn);
|
sasl_dispose(&client->saslconn);
|
||||||
client->saslconn = NULL;
|
client->saslconn = NULL;
|
||||||
@ -1964,7 +1964,7 @@ remoteSASLCheckAccess(struct qemud_server *server,
|
|||||||
|
|
||||||
client->saslUsername = strdup((const char*)val);
|
client->saslUsername = strdup((const char*)val);
|
||||||
if (client->saslUsername == NULL) {
|
if (client->saslUsername == NULL) {
|
||||||
VIR_ERROR0(_("out of memory copying username"));
|
VIR_ERROR(_("out of memory copying username"));
|
||||||
remoteDispatchAuthError(rerr);
|
remoteDispatchAuthError(rerr);
|
||||||
sasl_dispose(&client->saslconn);
|
sasl_dispose(&client->saslconn);
|
||||||
client->saslconn = NULL;
|
client->saslconn = NULL;
|
||||||
@ -2014,7 +2014,7 @@ remoteDispatchAuthSaslStart(struct qemud_server *server,
|
|||||||
VIR_DEBUG("Start SASL auth %d", client->fd);
|
VIR_DEBUG("Start SASL auth %d", client->fd);
|
||||||
if (client->auth != REMOTE_AUTH_SASL ||
|
if (client->auth != REMOTE_AUTH_SASL ||
|
||||||
client->saslconn == NULL) {
|
client->saslconn == NULL) {
|
||||||
VIR_ERROR0(_("client tried invalid SASL start request"));
|
VIR_ERROR(_("client tried invalid SASL start request"));
|
||||||
goto authfail;
|
goto authfail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2115,7 +2115,7 @@ remoteDispatchAuthSaslStep(struct qemud_server *server,
|
|||||||
VIR_DEBUG("Step SASL auth %d", client->fd);
|
VIR_DEBUG("Step SASL auth %d", client->fd);
|
||||||
if (client->auth != REMOTE_AUTH_SASL ||
|
if (client->auth != REMOTE_AUTH_SASL ||
|
||||||
client->saslconn == NULL) {
|
client->saslconn == NULL) {
|
||||||
VIR_ERROR0(_("client tried invalid SASL start request"));
|
VIR_ERROR(_("client tried invalid SASL start request"));
|
||||||
goto authfail;
|
goto authfail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2207,7 +2207,7 @@ remoteDispatchAuthSaslInit(struct qemud_server *server ATTRIBUTE_UNUSED,
|
|||||||
void *args ATTRIBUTE_UNUSED,
|
void *args ATTRIBUTE_UNUSED,
|
||||||
remote_auth_sasl_init_ret *ret ATTRIBUTE_UNUSED)
|
remote_auth_sasl_init_ret *ret ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
VIR_ERROR0(_("client tried unsupported SASL init request"));
|
VIR_ERROR(_("client tried unsupported SASL init request"));
|
||||||
PROBE(CLIENT_AUTH_FAIL, "fd=%d, auth=%d", client->fd, REMOTE_AUTH_SASL);
|
PROBE(CLIENT_AUTH_FAIL, "fd=%d, auth=%d", client->fd, REMOTE_AUTH_SASL);
|
||||||
remoteDispatchAuthError(rerr);
|
remoteDispatchAuthError(rerr);
|
||||||
return -1;
|
return -1;
|
||||||
@ -2222,7 +2222,7 @@ remoteDispatchAuthSaslStart(struct qemud_server *server ATTRIBUTE_UNUSED,
|
|||||||
remote_auth_sasl_start_args *args ATTRIBUTE_UNUSED,
|
remote_auth_sasl_start_args *args ATTRIBUTE_UNUSED,
|
||||||
remote_auth_sasl_start_ret *ret ATTRIBUTE_UNUSED)
|
remote_auth_sasl_start_ret *ret ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
VIR_ERROR0(_("client tried unsupported SASL start request"));
|
VIR_ERROR(_("client tried unsupported SASL start request"));
|
||||||
PROBE(CLIENT_AUTH_FAIL, "fd=%d, auth=%d", client->fd, REMOTE_AUTH_SASL);
|
PROBE(CLIENT_AUTH_FAIL, "fd=%d, auth=%d", client->fd, REMOTE_AUTH_SASL);
|
||||||
remoteDispatchAuthError(rerr);
|
remoteDispatchAuthError(rerr);
|
||||||
return -1;
|
return -1;
|
||||||
@ -2237,7 +2237,7 @@ remoteDispatchAuthSaslStep(struct qemud_server *server ATTRIBUTE_UNUSED,
|
|||||||
remote_auth_sasl_step_args *args ATTRIBUTE_UNUSED,
|
remote_auth_sasl_step_args *args ATTRIBUTE_UNUSED,
|
||||||
remote_auth_sasl_step_ret *ret ATTRIBUTE_UNUSED)
|
remote_auth_sasl_step_ret *ret ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
VIR_ERROR0(_("client tried unsupported SASL step request"));
|
VIR_ERROR(_("client tried unsupported SASL step request"));
|
||||||
PROBE(CLIENT_AUTH_FAIL, "fd=%d, auth=%d", client->fd, REMOTE_AUTH_SASL);
|
PROBE(CLIENT_AUTH_FAIL, "fd=%d, auth=%d", client->fd, REMOTE_AUTH_SASL);
|
||||||
remoteDispatchAuthError(rerr);
|
remoteDispatchAuthError(rerr);
|
||||||
return -1;
|
return -1;
|
||||||
@ -2283,12 +2283,12 @@ remoteDispatchAuthPolkit(struct qemud_server *server,
|
|||||||
|
|
||||||
VIR_DEBUG("Start PolicyKit auth %d", client->fd);
|
VIR_DEBUG("Start PolicyKit auth %d", client->fd);
|
||||||
if (client->auth != REMOTE_AUTH_POLKIT) {
|
if (client->auth != REMOTE_AUTH_POLKIT) {
|
||||||
VIR_ERROR0(_("client tried invalid PolicyKit init request"));
|
VIR_ERROR(_("client tried invalid PolicyKit init request"));
|
||||||
goto authfail;
|
goto authfail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemudGetSocketIdentity(client->fd, &callerUid, &callerPid) < 0) {
|
if (qemudGetSocketIdentity(client->fd, &callerUid, &callerPid) < 0) {
|
||||||
VIR_ERROR0(_("cannot get peer socket identity"));
|
VIR_ERROR(_("cannot get peer socket identity"));
|
||||||
goto authfail;
|
goto authfail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2375,12 +2375,12 @@ remoteDispatchAuthPolkit(struct qemud_server *server,
|
|||||||
|
|
||||||
VIR_DEBUG("Start PolicyKit auth %d", client->fd);
|
VIR_DEBUG("Start PolicyKit auth %d", client->fd);
|
||||||
if (client->auth != REMOTE_AUTH_POLKIT) {
|
if (client->auth != REMOTE_AUTH_POLKIT) {
|
||||||
VIR_ERROR0(_("client tried invalid PolicyKit init request"));
|
VIR_ERROR(_("client tried invalid PolicyKit init request"));
|
||||||
goto authfail;
|
goto authfail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemudGetSocketIdentity(client->fd, &callerUid, &callerPid) < 0) {
|
if (qemudGetSocketIdentity(client->fd, &callerUid, &callerPid) < 0) {
|
||||||
VIR_ERROR0(_("cannot get peer socket identity"));
|
VIR_ERROR(_("cannot get peer socket identity"));
|
||||||
goto authfail;
|
goto authfail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2485,7 +2485,7 @@ remoteDispatchAuthPolkit(struct qemud_server *server ATTRIBUTE_UNUSED,
|
|||||||
void *args ATTRIBUTE_UNUSED,
|
void *args ATTRIBUTE_UNUSED,
|
||||||
remote_auth_polkit_ret *ret ATTRIBUTE_UNUSED)
|
remote_auth_polkit_ret *ret ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
VIR_ERROR0(_("client tried unsupported PolicyKit init request"));
|
VIR_ERROR(_("client tried unsupported PolicyKit init request"));
|
||||||
remoteDispatchAuthError(rerr);
|
remoteDispatchAuthError(rerr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,7 @@ remoteStreamHandleWriteData(struct qemud_client *client,
|
|||||||
/* Blocking, so indicate we have more todo later */
|
/* Blocking, so indicate we have more todo later */
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
VIR_INFO0("Stream send failed");
|
VIR_INFO("Stream send failed");
|
||||||
stream->closed = 1;
|
stream->closed = 1;
|
||||||
remoteDispatchError(&rerr);
|
remoteDispatchError(&rerr);
|
||||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||||
|
@ -8,10 +8,8 @@
|
|||||||
#include <libvirt/libvirt.h>
|
#include <libvirt/libvirt.h>
|
||||||
#include <libvirt/virterror.h>
|
#include <libvirt/virterror.h>
|
||||||
|
|
||||||
#define VIR_DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \
|
|
||||||
__func__, __LINE__)
|
|
||||||
#define VIR_DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
|
#define VIR_DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
|
||||||
__func__, __LINE__, __VA_ARGS__)
|
__func__, __LINE__, ##__VA_ARGS__)
|
||||||
#define STREQ(a,b) (strcmp(a,b) == 0)
|
#define STREQ(a,b) (strcmp(a,b) == 0)
|
||||||
|
|
||||||
#ifndef ATTRIBUTE_UNUSED
|
#ifndef ATTRIBUTE_UNUSED
|
||||||
@ -304,7 +302,7 @@ int main(int argc, char **argv)
|
|||||||
sigaction(SIGTERM, &action_stop, NULL);
|
sigaction(SIGTERM, &action_stop, NULL);
|
||||||
sigaction(SIGINT, &action_stop, NULL);
|
sigaction(SIGINT, &action_stop, NULL);
|
||||||
|
|
||||||
VIR_DEBUG0("Registering domain event cbs");
|
VIR_DEBUG("Registering domain event cbs");
|
||||||
|
|
||||||
/* Add 2 callbacks to prove this works with more than just one */
|
/* Add 2 callbacks to prove this works with more than just one */
|
||||||
callback1ret = virConnectDomainEventRegister(dconn, myDomainEventCallback1,
|
callback1ret = virConnectDomainEventRegister(dconn, myDomainEventCallback1,
|
||||||
@ -355,7 +353,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Deregistering event handlers");
|
VIR_DEBUG("Deregistering event handlers");
|
||||||
virConnectDomainEventDeregister(dconn, myDomainEventCallback1);
|
virConnectDomainEventDeregister(dconn, myDomainEventCallback1);
|
||||||
virConnectDomainEventDeregisterAny(dconn, callback2ret);
|
virConnectDomainEventDeregisterAny(dconn, callback2ret);
|
||||||
virConnectDomainEventDeregisterAny(dconn, callback3ret);
|
virConnectDomainEventDeregisterAny(dconn, callback3ret);
|
||||||
@ -365,7 +363,7 @@ int main(int argc, char **argv)
|
|||||||
virConnectDomainEventDeregisterAny(dconn, callback7ret);
|
virConnectDomainEventDeregisterAny(dconn, callback7ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Closing connection");
|
VIR_DEBUG("Closing connection");
|
||||||
if (dconn && virConnectClose(dconn) < 0) {
|
if (dconn && virConnectClose(dconn) < 0) {
|
||||||
printf("error closing\n");
|
printf("error closing\n");
|
||||||
}
|
}
|
||||||
|
@ -1183,7 +1183,7 @@ x86Compute(virCPUDefPtr host,
|
|||||||
x86DataSubtract(cpu_require->data, cpu_disable->data);
|
x86DataSubtract(cpu_require->data, cpu_disable->data);
|
||||||
result = x86ModelCompare(host_model, cpu_require);
|
result = x86ModelCompare(host_model, cpu_require);
|
||||||
if (result == SUBSET || result == UNRELATED) {
|
if (result == SUBSET || result == UNRELATED) {
|
||||||
VIR_DEBUG0("Host CPU does not provide all required features");
|
VIR_DEBUG("Host CPU does not provide all required features");
|
||||||
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
|
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -1204,7 +1204,7 @@ x86Compute(virCPUDefPtr host,
|
|||||||
if (ret == VIR_CPU_COMPARE_SUPERSET
|
if (ret == VIR_CPU_COMPARE_SUPERSET
|
||||||
&& cpu->type == VIR_CPU_TYPE_GUEST
|
&& cpu->type == VIR_CPU_TYPE_GUEST
|
||||||
&& cpu->match == VIR_CPU_MATCH_STRICT) {
|
&& cpu->match == VIR_CPU_MATCH_STRICT) {
|
||||||
VIR_DEBUG0("Host CPU does not strictly match guest CPU");
|
VIR_DEBUG("Host CPU does not strictly match guest CPU");
|
||||||
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
|
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -734,7 +734,7 @@ esxConnectToHost(esxPrivate *priv, virConnectAuthPtr auth,
|
|||||||
|
|
||||||
/* Warn if host is in maintenance mode */
|
/* Warn if host is in maintenance mode */
|
||||||
if (inMaintenanceMode == esxVI_Boolean_True) {
|
if (inMaintenanceMode == esxVI_Boolean_True) {
|
||||||
VIR_WARN0("The server is in maintenance mode");
|
VIR_WARN("The server is in maintenance mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*vCenterIpAddress != NULL) {
|
if (*vCenterIpAddress != NULL) {
|
||||||
@ -2342,7 +2342,7 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (priv->usedCpuTimeCounterId < 0) {
|
if (priv->usedCpuTimeCounterId < 0) {
|
||||||
VIR_WARN0("Could not find 'used CPU time' performance counter");
|
VIR_WARN("Could not find 'used CPU time' performance counter");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2374,7 +2374,7 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
|
|||||||
for (perfEntityMetricBase = perfEntityMetricBaseList;
|
for (perfEntityMetricBase = perfEntityMetricBaseList;
|
||||||
perfEntityMetricBase != NULL;
|
perfEntityMetricBase != NULL;
|
||||||
perfEntityMetricBase = perfEntityMetricBase->_next) {
|
perfEntityMetricBase = perfEntityMetricBase->_next) {
|
||||||
VIR_DEBUG0("perfEntityMetric ...");
|
VIR_DEBUG("perfEntityMetric ...");
|
||||||
|
|
||||||
perfEntityMetric =
|
perfEntityMetric =
|
||||||
esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase);
|
esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase);
|
||||||
@ -2398,7 +2398,7 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
|
|||||||
|
|
||||||
for (; perfMetricIntSeries != NULL;
|
for (; perfMetricIntSeries != NULL;
|
||||||
perfMetricIntSeries = perfMetricIntSeries->_next) {
|
perfMetricIntSeries = perfMetricIntSeries->_next) {
|
||||||
VIR_DEBUG0("perfMetricIntSeries ...");
|
VIR_DEBUG("perfMetricIntSeries ...");
|
||||||
|
|
||||||
for (value = perfMetricIntSeries->value;
|
for (value = perfMetricIntSeries->value;
|
||||||
value != NULL;
|
value != NULL;
|
||||||
|
@ -200,7 +200,7 @@ esxVI_CURL_Debug(CURL *curl ATTRIBUTE_UNUSED, curl_infotype type,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
VIR_DEBUG0("unknown");
|
VIR_DEBUG("unknown");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ ESX_VI__TEMPLATE__FREE(SharedCURL,
|
|||||||
|
|
||||||
if (item->count > 0) {
|
if (item->count > 0) {
|
||||||
/* Better leak than crash */
|
/* Better leak than crash */
|
||||||
VIR_ERROR0(_("Trying to free SharedCURL object that is still in use"));
|
VIR_ERROR(_("Trying to free SharedCURL object that is still in use"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2143,7 +2143,7 @@ esxVI_GetVirtualMachineIdentity(esxVI_ObjectContent *virtualMachine,
|
|||||||
} else {
|
} else {
|
||||||
memset(uuid, 0, VIR_UUID_BUFLEN);
|
memset(uuid, 0, VIR_UUID_BUFLEN);
|
||||||
|
|
||||||
VIR_WARN0("Cannot access UUID, because 'configStatus' property "
|
VIR_WARN("Cannot access UUID, because 'configStatus' property "
|
||||||
"indicates a config problem");
|
"indicates a config problem");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3715,12 +3715,12 @@ esxVI_WaitForTaskCompletion(esxVI_Context *ctx,
|
|||||||
if (taskInfo->cancelable == esxVI_Boolean_True) {
|
if (taskInfo->cancelable == esxVI_Boolean_True) {
|
||||||
if (esxVI_CancelTask(ctx, task) < 0 &&
|
if (esxVI_CancelTask(ctx, task) < 0 &&
|
||||||
blocked == esxVI_Boolean_True) {
|
blocked == esxVI_Boolean_True) {
|
||||||
VIR_ERROR0(_("Cancelable task is blocked by an "
|
VIR_ERROR(_("Cancelable task is blocked by an "
|
||||||
"unanswered question but cancelation "
|
"unanswered question but cancelation "
|
||||||
"failed"));
|
"failed"));
|
||||||
}
|
}
|
||||||
} else if (blocked == esxVI_Boolean_True) {
|
} else if (blocked == esxVI_Boolean_True) {
|
||||||
VIR_ERROR0(_("Non-cancelable task is blocked by an "
|
VIR_ERROR(_("Non-cancelable task is blocked by an "
|
||||||
"unanswered question"));
|
"unanswered question"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3776,7 +3776,7 @@ esxVI_WaitForTaskCompletion(esxVI_Context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (esxVI_DestroyPropertyFilter(ctx, propertyFilter) < 0) {
|
if (esxVI_DestroyPropertyFilter(ctx, propertyFilter) < 0) {
|
||||||
VIR_DEBUG0("DestroyPropertyFilter failed");
|
VIR_DEBUG("DestroyPropertyFilter failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (esxVI_TaskInfoState_CastFromAnyType(propertyValue, finalState) < 0) {
|
if (esxVI_TaskInfoState_CastFromAnyType(propertyValue, finalState) < 0) {
|
||||||
|
@ -357,7 +357,7 @@ virInitialize(void)
|
|||||||
|
|
||||||
virLogSetFromEnv();
|
virLogSetFromEnv();
|
||||||
|
|
||||||
VIR_DEBUG0("register drivers");
|
VIR_DEBUG("register drivers");
|
||||||
|
|
||||||
#if HAVE_WINSOCK2_H
|
#if HAVE_WINSOCK2_H
|
||||||
if (winsock_init () == -1) return -1;
|
if (winsock_init () == -1) return -1;
|
||||||
@ -1026,7 +1026,7 @@ do_open (const char *name,
|
|||||||
NULLSTR(ret->uri->user), ret->uri->port,
|
NULLSTR(ret->uri->user), ret->uri->port,
|
||||||
NULLSTR(ret->uri->path));
|
NULLSTR(ret->uri->path));
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("no name, allowing driver auto-select");
|
VIR_DEBUG("no name, allowing driver auto-select");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cleansing flags */
|
/* Cleansing flags */
|
||||||
|
@ -729,14 +729,14 @@ libxlStartup(int privileged) {
|
|||||||
|
|
||||||
/* Disable libxl driver if non-root */
|
/* Disable libxl driver if non-root */
|
||||||
if (!privileged) {
|
if (!privileged) {
|
||||||
VIR_INFO0("Not running privileged, disabling libxenlight driver");
|
VIR_INFO("Not running privileged, disabling libxenlight driver");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disable driver if legacy xen toolstack (xend) is in use */
|
/* Disable driver if legacy xen toolstack (xend) is in use */
|
||||||
cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL);
|
cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL);
|
||||||
if (virCommandRun(cmd, &status) == 0 && status == 0) {
|
if (virCommandRun(cmd, &status) == 0 && status == 0) {
|
||||||
VIR_INFO0("Legacy xen tool stack seems to be in use, disabling "
|
VIR_INFO("Legacy xen tool stack seems to be in use, disabling "
|
||||||
"libxenlight driver.");
|
"libxenlight driver.");
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return 0;
|
return 0;
|
||||||
@ -747,7 +747,7 @@ libxlStartup(int privileged) {
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virMutexInit(&libxl_driver->lock) < 0) {
|
if (virMutexInit(&libxl_driver->lock) < 0) {
|
||||||
VIR_ERROR0(_("cannot initialize mutex"));
|
VIR_ERROR(_("cannot initialize mutex"));
|
||||||
VIR_FREE(libxl_driver);
|
VIR_FREE(libxl_driver);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -835,19 +835,19 @@ libxlStartup(int privileged) {
|
|||||||
libxl_driver->logger =
|
libxl_driver->logger =
|
||||||
(xentoollog_logger *)xtl_createlogger_stdiostream(libxl_driver->logger_file, XTL_DEBUG, 0);
|
(xentoollog_logger *)xtl_createlogger_stdiostream(libxl_driver->logger_file, XTL_DEBUG, 0);
|
||||||
if (!libxl_driver->logger) {
|
if (!libxl_driver->logger) {
|
||||||
VIR_ERROR0(_("cannot create logger for libxenlight"));
|
VIR_ERROR(_("cannot create logger for libxenlight"));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (libxl_ctx_init(&libxl_driver->ctx,
|
if (libxl_ctx_init(&libxl_driver->ctx,
|
||||||
LIBXL_VERSION,
|
LIBXL_VERSION,
|
||||||
libxl_driver->logger)) {
|
libxl_driver->logger)) {
|
||||||
VIR_ERROR0(_("cannot initialize libxenlight context"));
|
VIR_ERROR(_("cannot initialize libxenlight context"));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
|
if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
|
||||||
VIR_ERROR0(_("cannot version information from libxenlight"));
|
VIR_ERROR(_("cannot version information from libxenlight"));
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
libxl_driver->version = (ver_info->xen_version_major * 1000000) +
|
libxl_driver->version = (ver_info->xen_version_major * 1000000) +
|
||||||
@ -855,7 +855,7 @@ libxlStartup(int privileged) {
|
|||||||
|
|
||||||
if ((libxl_driver->caps =
|
if ((libxl_driver->caps =
|
||||||
libxlMakeCapabilities(&libxl_driver->ctx)) == NULL) {
|
libxlMakeCapabilities(&libxl_driver->ctx)) == NULL) {
|
||||||
VIR_ERROR0(_("cannot create capabilities for libxenlight"));
|
VIR_ERROR(_("cannot create capabilities for libxenlight"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1957,7 +1957,7 @@ libxlDomainXMLFromNative(virConnectPtr conn, const char * nativeFormat,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
|
if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
|
||||||
VIR_ERROR0(_("cannot get version information from libxenlight"));
|
VIR_ERROR(_("cannot get version information from libxenlight"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1998,7 +1998,7 @@ libxlDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
|
if ((ver_info = libxl_get_version_info(&driver->ctx)) == NULL) {
|
||||||
VIR_ERROR0(_("cannot get version information from libxenlight"));
|
VIR_ERROR(_("cannot get version information from libxenlight"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ virCapsPtr lxcCapsInit(void)
|
|||||||
*/
|
*/
|
||||||
if (nodeCapsInitNUMA(caps) < 0) {
|
if (nodeCapsInitNUMA(caps) < 0) {
|
||||||
virCapabilitiesFreeNUMAInfo(caps);
|
virCapabilitiesFreeNUMAInfo(caps);
|
||||||
VIR_WARN0("Failed to query host NUMA topology, disabling NUMA capabilities");
|
VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virGetHostUUID(caps->host.host_uuid)) {
|
if (virGetHostUUID(caps->host.host_uuid)) {
|
||||||
@ -151,7 +151,7 @@ int lxcLoadDriverConfig(lxc_driver_t *driver)
|
|||||||
p = virConfGetValue(conf, "log_with_libvirtd");
|
p = virConfGetValue(conf, "log_with_libvirtd");
|
||||||
if (p) {
|
if (p) {
|
||||||
if (p->type != VIR_CONF_LONG)
|
if (p->type != VIR_CONF_LONG)
|
||||||
VIR_WARN0("lxcLoadDriverConfig: invalid setting: log_with_libvirtd");
|
VIR_WARN("lxcLoadDriverConfig: invalid setting: log_with_libvirtd");
|
||||||
else
|
else
|
||||||
driver->log_libvirtd = p->l;
|
driver->log_libvirtd = p->l;
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ static int lxcContainerWaitForContinue(int control)
|
|||||||
}
|
}
|
||||||
VIR_FORCE_CLOSE(control);
|
VIR_FORCE_CLOSE(control);
|
||||||
|
|
||||||
VIR_DEBUG0("Received container continue message");
|
VIR_DEBUG("Received container continue message");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -729,7 +729,7 @@ static int lxcContainerDropCapabilities(void)
|
|||||||
* be unmasked - they can never escape the bounding set. */
|
* be unmasked - they can never escape the bounding set. */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
VIR_WARN0("libcap-ng support not compiled in, unable to clear capabilities");
|
VIR_WARN("libcap-ng support not compiled in, unable to clear capabilities");
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -888,12 +888,12 @@ int lxcContainerStart(virDomainDefPtr def,
|
|||||||
flags = CLONE_NEWPID|CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|SIGCHLD;
|
flags = CLONE_NEWPID|CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|SIGCHLD;
|
||||||
|
|
||||||
if (userns_supported()) {
|
if (userns_supported()) {
|
||||||
VIR_DEBUG0("Enable user namespaces");
|
VIR_DEBUG("Enable user namespaces");
|
||||||
flags |= CLONE_NEWUSER;
|
flags |= CLONE_NEWUSER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->nets != NULL) {
|
if (def->nets != NULL) {
|
||||||
VIR_DEBUG0("Enable network namespaces");
|
VIR_DEBUG("Enable network namespaces");
|
||||||
flags |= CLONE_NEWNET;
|
flags |= CLONE_NEWNET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -932,7 +932,7 @@ int lxcContainerAvailable(int features)
|
|||||||
flags |= CLONE_NEWNET;
|
flags |= CLONE_NEWNET;
|
||||||
|
|
||||||
if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
|
if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
|
||||||
VIR_DEBUG0("Unable to allocate stack");
|
VIR_DEBUG("Unable to allocate stack");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ static int lxcControllerClearCapabilities(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
VIR_WARN0("libcap-ng support not compiled in, unable to clear capabilities");
|
VIR_WARN("libcap-ng support not compiled in, unable to clear capabilities");
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -655,7 +655,7 @@ lxcControllerRun(virDomainDefPtr def,
|
|||||||
* marked as shared
|
* marked as shared
|
||||||
*/
|
*/
|
||||||
if (root) {
|
if (root) {
|
||||||
VIR_DEBUG0("Setting up private /dev/pts");
|
VIR_DEBUG("Setting up private /dev/pts");
|
||||||
if (unshare(CLONE_NEWNS) < 0) {
|
if (unshare(CLONE_NEWNS) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("Cannot unshare mount namespace"));
|
_("Cannot unshare mount namespace"));
|
||||||
@ -691,7 +691,7 @@ lxcControllerRun(virDomainDefPtr def,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (access(devptmx, R_OK) < 0) {
|
if (access(devptmx, R_OK) < 0) {
|
||||||
VIR_WARN0("Kernel does not support private devpts, using shared devpts");
|
VIR_WARN("Kernel does not support private devpts, using shared devpts");
|
||||||
VIR_FREE(devptmx);
|
VIR_FREE(devptmx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -707,7 +707,7 @@ lxcControllerRun(virDomainDefPtr def,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("Opening tty on shared /dev/ptmx");
|
VIR_DEBUG("Opening tty on shared /dev/ptmx");
|
||||||
if (virFileOpenTty(&containerPty,
|
if (virFileOpenTty(&containerPty,
|
||||||
&containerPtyPath,
|
&containerPtyPath,
|
||||||
0) < 0) {
|
0) < 0) {
|
||||||
|
@ -1076,7 +1076,7 @@ static int lxcSetupInterfaces(virConnectPtr conn,
|
|||||||
goto error_exit;
|
goto error_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("calling vethCreate()");
|
VIR_DEBUG("calling vethCreate()");
|
||||||
parentVeth = def->nets[i]->ifname;
|
parentVeth = def->nets[i]->ifname;
|
||||||
if (vethCreate(&parentVeth, &containerVeth) < 0)
|
if (vethCreate(&parentVeth, &containerVeth) < 0)
|
||||||
goto error_exit;
|
goto error_exit;
|
||||||
@ -1957,19 +1957,19 @@ static int lxcStartup(int privileged)
|
|||||||
*/
|
*/
|
||||||
ld = getenv("LD_PRELOAD");
|
ld = getenv("LD_PRELOAD");
|
||||||
if (ld && strstr(ld, "vgpreload")) {
|
if (ld && strstr(ld, "vgpreload")) {
|
||||||
VIR_INFO0("Running under valgrind, disabling driver");
|
VIR_INFO("Running under valgrind, disabling driver");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check that the user is root, silently disable if not */
|
/* Check that the user is root, silently disable if not */
|
||||||
if (!privileged) {
|
if (!privileged) {
|
||||||
VIR_INFO0("Not running privileged, disabling driver");
|
VIR_INFO("Not running privileged, disabling driver");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check that this is a container enabled kernel */
|
/* Check that this is a container enabled kernel */
|
||||||
if (lxcContainerAvailable(0) < 0) {
|
if (lxcContainerAvailable(0) < 0) {
|
||||||
VIR_INFO0("LXC support not available in this kernel, disabling driver");
|
VIR_INFO("LXC support not available in this kernel, disabling driver");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2467,7 +2467,7 @@ static int lxcFreezeContainer(lxc_driver_t *driver, virDomainObjPtr vm)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (r == -EBUSY)
|
if (r == -EBUSY)
|
||||||
VIR_DEBUG0("Writing freezer.state gets EBUSY");
|
VIR_DEBUG("Writing freezer.state gets EBUSY");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unfortunately, returning 0 (success) is likely to happen
|
* Unfortunately, returning 0 (success) is likely to happen
|
||||||
@ -2507,7 +2507,7 @@ static int lxcFreezeContainer(lxc_driver_t *driver, virDomainObjPtr vm)
|
|||||||
check_interval *= exp;
|
check_interval *= exp;
|
||||||
VIR_FREE(state);
|
VIR_FREE(state);
|
||||||
}
|
}
|
||||||
VIR_DEBUG0("lxcFreezeContainer timeout");
|
VIR_DEBUG("lxcFreezeContainer timeout");
|
||||||
error:
|
error:
|
||||||
/*
|
/*
|
||||||
* If timeout or an error on reading the state occurs,
|
* If timeout or an error on reading the state occurs,
|
||||||
|
@ -1197,7 +1197,7 @@ networkAddGeneralIptablesRules(struct network_driver *driver,
|
|||||||
network->def->bridge, 68) < 0)) {
|
network->def->bridge, 68) < 0)) {
|
||||||
VIR_WARN("Could not add rule to fixup DHCP response checksums "
|
VIR_WARN("Could not add rule to fixup DHCP response checksums "
|
||||||
"on network '%s'.", network->def->name);
|
"on network '%s'.", network->def->name);
|
||||||
VIR_WARN0("May need to update iptables package & kernel to support CHECKSUM rule.");
|
VIR_WARN("May need to update iptables package & kernel to support CHECKSUM rule.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allow DNS requests through to dnsmasq */
|
/* allow DNS requests through to dnsmasq */
|
||||||
@ -1407,7 +1407,7 @@ networkReloadIptablesRules(struct network_driver *driver)
|
|||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
VIR_INFO0(_("Reloading iptables rules"));
|
VIR_INFO(_("Reloading iptables rules"));
|
||||||
|
|
||||||
for (i = 0 ; i < driver->networks.count ; i++) {
|
for (i = 0 ; i < driver->networks.count ; i++) {
|
||||||
virNetworkObjLock(driver->networks.objs[i]);
|
virNetworkObjLock(driver->networks.objs[i]);
|
||||||
|
@ -514,7 +514,7 @@ static void dev_refresh(const char *udi)
|
|||||||
static void device_added(LibHalContext *ctx ATTRIBUTE_UNUSED,
|
static void device_added(LibHalContext *ctx ATTRIBUTE_UNUSED,
|
||||||
const char *udi)
|
const char *udi)
|
||||||
{
|
{
|
||||||
VIR_DEBUG0(hal_name(udi));
|
VIR_DEBUG("%s", hal_name(udi));
|
||||||
dev_create(udi);
|
dev_create(udi);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,7 +527,7 @@ static void device_removed(LibHalContext *ctx ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
nodeDeviceLock(driverState);
|
nodeDeviceLock(driverState);
|
||||||
dev = virNodeDeviceFindByName(&driverState->devs,name);
|
dev = virNodeDeviceFindByName(&driverState->devs,name);
|
||||||
VIR_DEBUG0(name);
|
VIR_DEBUG("%s", name);
|
||||||
if (dev)
|
if (dev)
|
||||||
virNodeDeviceObjRemove(&driverState->devs, dev);
|
virNodeDeviceObjRemove(&driverState->devs, dev);
|
||||||
else
|
else
|
||||||
@ -718,12 +718,12 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
|||||||
dbus_error_init(&err);
|
dbus_error_init(&err);
|
||||||
hal_ctx = libhal_ctx_new();
|
hal_ctx = libhal_ctx_new();
|
||||||
if (hal_ctx == NULL) {
|
if (hal_ctx == NULL) {
|
||||||
VIR_ERROR0(_("libhal_ctx_new returned NULL"));
|
VIR_ERROR(_("libhal_ctx_new returned NULL"));
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
|
dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
|
||||||
if (dbus_conn == NULL) {
|
if (dbus_conn == NULL) {
|
||||||
VIR_ERROR0(_("dbus_bus_get failed"));
|
VIR_ERROR(_("dbus_bus_get failed"));
|
||||||
/* We don't want to show a fatal error here,
|
/* We don't want to show a fatal error here,
|
||||||
otherwise entire libvirtd shuts down when
|
otherwise entire libvirtd shuts down when
|
||||||
D-Bus isn't running */
|
D-Bus isn't running */
|
||||||
@ -733,11 +733,11 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
|||||||
dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE);
|
dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE);
|
||||||
|
|
||||||
if (!libhal_ctx_set_dbus_connection(hal_ctx, dbus_conn)) {
|
if (!libhal_ctx_set_dbus_connection(hal_ctx, dbus_conn)) {
|
||||||
VIR_ERROR0(_("libhal_ctx_set_dbus_connection failed"));
|
VIR_ERROR(_("libhal_ctx_set_dbus_connection failed"));
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
if (!libhal_ctx_init(hal_ctx, &err)) {
|
if (!libhal_ctx_init(hal_ctx, &err)) {
|
||||||
VIR_ERROR0(_("libhal_ctx_init failed, haldaemon is probably not running"));
|
VIR_ERROR(_("libhal_ctx_init failed, haldaemon is probably not running"));
|
||||||
/* We don't want to show a fatal error here,
|
/* We don't want to show a fatal error here,
|
||||||
otherwise entire libvirtd shuts down when
|
otherwise entire libvirtd shuts down when
|
||||||
hald isn't running */
|
hald isn't running */
|
||||||
@ -751,7 +751,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
|||||||
remove_dbus_watch,
|
remove_dbus_watch,
|
||||||
toggle_dbus_watch,
|
toggle_dbus_watch,
|
||||||
NULL, NULL)) {
|
NULL, NULL)) {
|
||||||
VIR_ERROR0(_("dbus_connection_set_watch_functions failed"));
|
VIR_ERROR(_("dbus_connection_set_watch_functions failed"));
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -772,13 +772,13 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
|||||||
!libhal_ctx_set_device_lost_capability(hal_ctx, device_cap_lost) ||
|
!libhal_ctx_set_device_lost_capability(hal_ctx, device_cap_lost) ||
|
||||||
!libhal_ctx_set_device_property_modified(hal_ctx, device_prop_modified) ||
|
!libhal_ctx_set_device_property_modified(hal_ctx, device_prop_modified) ||
|
||||||
!libhal_device_property_watch_all(hal_ctx, &err)) {
|
!libhal_device_property_watch_all(hal_ctx, &err)) {
|
||||||
VIR_ERROR0(_("setting up HAL callbacks failed"));
|
VIR_ERROR(_("setting up HAL callbacks failed"));
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
|
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
|
||||||
if (udi == NULL) {
|
if (udi == NULL) {
|
||||||
VIR_ERROR0(_("libhal_get_all_devices failed"));
|
VIR_ERROR(_("libhal_get_all_devices failed"));
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_devs; i++) {
|
for (i = 0; i < num_devs; i++) {
|
||||||
@ -828,18 +828,18 @@ static int halDeviceMonitorReload(void)
|
|||||||
int num_devs, i;
|
int num_devs, i;
|
||||||
LibHalContext *hal_ctx;
|
LibHalContext *hal_ctx;
|
||||||
|
|
||||||
VIR_INFO0("Reloading HAL device state");
|
VIR_INFO("Reloading HAL device state");
|
||||||
nodeDeviceLock(driverState);
|
nodeDeviceLock(driverState);
|
||||||
VIR_INFO0("Removing existing objects");
|
VIR_INFO("Removing existing objects");
|
||||||
virNodeDeviceObjListFree(&driverState->devs);
|
virNodeDeviceObjListFree(&driverState->devs);
|
||||||
nodeDeviceUnlock(driverState);
|
nodeDeviceUnlock(driverState);
|
||||||
|
|
||||||
hal_ctx = DRV_STATE_HAL_CTX(driverState);
|
hal_ctx = DRV_STATE_HAL_CTX(driverState);
|
||||||
VIR_INFO0("Creating new objects");
|
VIR_INFO("Creating new objects");
|
||||||
dbus_error_init(&err);
|
dbus_error_init(&err);
|
||||||
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
|
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
|
||||||
if (udi == NULL) {
|
if (udi == NULL) {
|
||||||
VIR_ERROR0(_("libhal_get_all_devices failed"));
|
VIR_ERROR(_("libhal_get_all_devices failed"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_devs; i++) {
|
for (i = 0; i < num_devs; i++) {
|
||||||
@ -847,7 +847,7 @@ static int halDeviceMonitorReload(void)
|
|||||||
VIR_FREE(udi[i]);
|
VIR_FREE(udi[i]);
|
||||||
}
|
}
|
||||||
VIR_FREE(udi);
|
VIR_FREE(udi);
|
||||||
VIR_INFO0("HAL device reload complete");
|
VIR_INFO("HAL device reload complete");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ static int get_sriov_function(const char *device_link,
|
|||||||
VIR_DEBUG("SR IOV device path is '%s'", device_path);
|
VIR_DEBUG("SR IOV device path is '%s'", device_path);
|
||||||
config_address = basename(device_path);
|
config_address = basename(device_path);
|
||||||
if (VIR_ALLOC(*bdf) != 0) {
|
if (VIR_ALLOC(*bdf) != 0) {
|
||||||
VIR_ERROR0(_("Failed to allocate memory for PCI device name"));
|
VIR_ERROR(_("Failed to allocate memory for PCI device name"));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1454,7 +1454,7 @@ static void udevEventHandleCallback(int watch ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
device = udev_monitor_receive_device(udev_monitor);
|
device = udev_monitor_receive_device(udev_monitor);
|
||||||
if (device == NULL) {
|
if (device == NULL) {
|
||||||
VIR_ERROR0(_("udev_monitor_receive_device returned NULL"));
|
VIR_ERROR(_("udev_monitor_receive_device returned NULL"));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1636,7 +1636,7 @@ static int udevDeviceMonitorStartup(int privileged)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virMutexInit(&driverState->lock) < 0) {
|
if (virMutexInit(&driverState->lock) < 0) {
|
||||||
VIR_ERROR0(_("Failed to initialize mutex for driverState"));
|
VIR_ERROR(_("Failed to initialize mutex for driverState"));
|
||||||
VIR_FREE(priv);
|
VIR_FREE(priv);
|
||||||
VIR_FREE(driverState);
|
VIR_FREE(driverState);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
@ -1657,7 +1657,7 @@ static int udevDeviceMonitorStartup(int privileged)
|
|||||||
priv->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
|
priv->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
|
||||||
if (priv->udev_monitor == NULL) {
|
if (priv->udev_monitor == NULL) {
|
||||||
VIR_FREE(priv);
|
VIR_FREE(priv);
|
||||||
VIR_ERROR0(_("udev_monitor_new_from_netlink returned NULL"));
|
VIR_ERROR(_("udev_monitor_new_from_netlink returned NULL"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
@ -1755,7 +1755,7 @@ static virStateDriver udevStateDriver = {
|
|||||||
|
|
||||||
int udevNodeRegister(void)
|
int udevNodeRegister(void)
|
||||||
{
|
{
|
||||||
VIR_DEBUG0("Registering udev node device backend");
|
VIR_DEBUG("Registering udev node device backend");
|
||||||
|
|
||||||
registerCommonNodeFuncs(&udevDeviceMonitor);
|
registerCommonNodeFuncs(&udevDeviceMonitor);
|
||||||
if (virRegisterDeviceMonitor(&udevDeviceMonitor) < 0) {
|
if (virRegisterDeviceMonitor(&udevDeviceMonitor) < 0) {
|
||||||
|
@ -3303,7 +3303,7 @@ iptablesCheckBridgeNFCallEnabled(bool isIPv6)
|
|||||||
"'echo 1 > %s'"),
|
"'echo 1 > %s'"),
|
||||||
isIPv6 ? "6" : "",
|
isIPv6 ? "6" : "",
|
||||||
pathname);
|
pathname);
|
||||||
VIR_WARN0(msg);
|
VIR_WARN("%s", msg);
|
||||||
if (isIPv6)
|
if (isIPv6)
|
||||||
lastReportIPv6 = now;
|
lastReportIPv6 = now;
|
||||||
else
|
else
|
||||||
|
@ -211,7 +211,7 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (openvzDomainDefineCmd(prog, OPENVZ_MAX_ARG, vmdef) < 0) {
|
if (openvzDomainDefineCmd(prog, OPENVZ_MAX_ARG, vmdef) < 0) {
|
||||||
VIR_ERROR0(_("Error creating command for container"));
|
VIR_ERROR(_("Error creating command for container"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -878,7 +878,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
|
|||||||
vm->persistent = 1;
|
vm->persistent = 1;
|
||||||
|
|
||||||
if (openvzSetInitialConfig(vm->def) < 0) {
|
if (openvzSetInitialConfig(vm->def) < 0) {
|
||||||
VIR_ERROR0(_("Error creating initial configuration"));
|
VIR_ERROR(_("Error creating initial configuration"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -966,7 +966,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
|
|||||||
vm->persistent = 1;
|
vm->persistent = 1;
|
||||||
|
|
||||||
if (openvzSetInitialConfig(vm->def) < 0) {
|
if (openvzSetInitialConfig(vm->def) < 0) {
|
||||||
VIR_ERROR0(_("Error creating initial configuration"));
|
VIR_ERROR(_("Error creating initial configuration"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ phypCapsInit(void)
|
|||||||
*/
|
*/
|
||||||
if (nodeCapsInitNUMA(caps) < 0) {
|
if (nodeCapsInitNUMA(caps) < 0) {
|
||||||
virCapabilitiesFreeNUMAInfo(caps);
|
virCapabilitiesFreeNUMAInfo(caps);
|
||||||
VIR_WARN0
|
VIR_WARN
|
||||||
("Failed to query host NUMA topology, disabling NUMA capabilities");
|
("Failed to query host NUMA topology, disabling NUMA capabilities");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,13 +449,13 @@ phypUUIDTable_WriteFile(virConnectPtr conn)
|
|||||||
if (safewrite(fd, &uuid_table->lpars[i]->id,
|
if (safewrite(fd, &uuid_table->lpars[i]->id,
|
||||||
sizeof(uuid_table->lpars[i]->id)) !=
|
sizeof(uuid_table->lpars[i]->id)) !=
|
||||||
sizeof(uuid_table->lpars[i]->id)) {
|
sizeof(uuid_table->lpars[i]->id)) {
|
||||||
VIR_ERROR0(_("Unable to write information to local file."));
|
VIR_ERROR(_("Unable to write information to local file."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (safewrite(fd, uuid_table->lpars[i]->uuid, VIR_UUID_BUFLEN) !=
|
if (safewrite(fd, uuid_table->lpars[i]->uuid, VIR_UUID_BUFLEN) !=
|
||||||
VIR_UUID_BUFLEN) {
|
VIR_UUID_BUFLEN) {
|
||||||
VIR_ERROR0(_("Unable to write information to local file."));
|
VIR_ERROR(_("Unable to write information to local file."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -507,12 +507,12 @@ phypUUIDTable_Push(virConnectPtr conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stat(local_file, &local_fileinfo) == -1) {
|
if (stat(local_file, &local_fileinfo) == -1) {
|
||||||
VIR_WARN0("Unable to stat local file.");
|
VIR_WARN("Unable to stat local file.");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(fd = fopen(local_file, "rb"))) {
|
if (!(fd = fopen(local_file, "rb"))) {
|
||||||
VIR_WARN0("Unable to open local file.");
|
VIR_WARN("Unable to open local file.");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -649,7 +649,7 @@ phypUUIDTable_ReadFile(virConnectPtr conn)
|
|||||||
int id;
|
int id;
|
||||||
|
|
||||||
if ((fd = open(local_file, O_RDONLY)) == -1) {
|
if ((fd = open(local_file, O_RDONLY)) == -1) {
|
||||||
VIR_WARN0("Unable to write information to local file.");
|
VIR_WARN("Unable to write information to local file.");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -665,14 +665,14 @@ phypUUIDTable_ReadFile(virConnectPtr conn)
|
|||||||
}
|
}
|
||||||
uuid_table->lpars[i]->id = id;
|
uuid_table->lpars[i]->id = id;
|
||||||
} else {
|
} else {
|
||||||
VIR_WARN0
|
VIR_WARN
|
||||||
("Unable to read from information to local file.");
|
("Unable to read from information to local file.");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = read(fd, uuid_table->lpars[i]->uuid, VIR_UUID_BUFLEN);
|
rc = read(fd, uuid_table->lpars[i]->uuid, VIR_UUID_BUFLEN);
|
||||||
if (rc != VIR_UUID_BUFLEN) {
|
if (rc != VIR_UUID_BUFLEN) {
|
||||||
VIR_WARN0("Unable to read information to local file.");
|
VIR_WARN("Unable to read information to local file.");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -753,7 +753,7 @@ phypUUIDTable_Pull(virConnectPtr conn)
|
|||||||
rc = libssh2_channel_read(channel, buffer, amount);
|
rc = libssh2_channel_read(channel, buffer, amount);
|
||||||
if (rc > 0) {
|
if (rc > 0) {
|
||||||
if (safewrite(fd, buffer, rc) != rc)
|
if (safewrite(fd, buffer, rc) != rc)
|
||||||
VIR_WARN0
|
VIR_WARN
|
||||||
("Unable to write information to local file.");
|
("Unable to write information to local file.");
|
||||||
|
|
||||||
got += rc;
|
got += rc;
|
||||||
@ -828,7 +828,7 @@ phypUUIDTable_Init(virConnectPtr conn)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (nids_numdomains != nids_listdomains) {
|
if (nids_numdomains != nids_listdomains) {
|
||||||
VIR_ERROR0(_("Unable to determine number of domains."));
|
VIR_ERROR(_("Unable to determine number of domains."));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1559,7 +1559,7 @@ phypGetVIOSNextSlotNumber(virConnectPtr conn)
|
|||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!(profile = phypGetLparProfile(conn, vios_id))) {
|
if (!(profile = phypGetLparProfile(conn, vios_id))) {
|
||||||
VIR_ERROR0(_("Unable to get VIOS profile name."));
|
VIR_ERROR(_("Unable to get VIOS profile name."));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1599,17 +1599,17 @@ phypCreateServerSCSIAdapter(virConnectPtr conn)
|
|||||||
if (!
|
if (!
|
||||||
(vios_name =
|
(vios_name =
|
||||||
phypGetLparNAME(session, managed_system, vios_id, conn))) {
|
phypGetLparNAME(session, managed_system, vios_id, conn))) {
|
||||||
VIR_ERROR0(_("Unable to get VIOS name"));
|
VIR_ERROR(_("Unable to get VIOS name"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(profile = phypGetLparProfile(conn, vios_id))) {
|
if (!(profile = phypGetLparProfile(conn, vios_id))) {
|
||||||
VIR_ERROR0(_("Unable to get VIOS profile name."));
|
VIR_ERROR(_("Unable to get VIOS profile name."));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((slot = phypGetVIOSNextSlotNumber(conn)) == -1) {
|
if ((slot = phypGetVIOSNextSlotNumber(conn)) == -1) {
|
||||||
VIR_ERROR0(_("Unable to get free slot number"));
|
VIR_ERROR(_("Unable to get free slot number"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1742,7 +1742,7 @@ phypAttachDevice(virDomainPtr domain, const char *xml)
|
|||||||
if (!
|
if (!
|
||||||
(vios_name =
|
(vios_name =
|
||||||
phypGetLparNAME(session, managed_system, vios_id, conn))) {
|
phypGetLparNAME(session, managed_system, vios_id, conn))) {
|
||||||
VIR_ERROR0(_("Unable to get VIOS name"));
|
VIR_ERROR(_("Unable to get VIOS name"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1752,11 +1752,11 @@ phypAttachDevice(virDomainPtr domain, const char *xml)
|
|||||||
/* If not found, let's create one.
|
/* If not found, let's create one.
|
||||||
* */
|
* */
|
||||||
if (phypCreateServerSCSIAdapter(conn) == -1) {
|
if (phypCreateServerSCSIAdapter(conn) == -1) {
|
||||||
VIR_ERROR0(_("Unable to create new virtual adapter"));
|
VIR_ERROR(_("Unable to create new virtual adapter"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else {
|
} else {
|
||||||
if (!(scsi_adapter = phypGetVIOSFreeSCSIAdapter(conn))) {
|
if (!(scsi_adapter = phypGetVIOSFreeSCSIAdapter(conn))) {
|
||||||
VIR_ERROR0(_("Unable to create new virtual adapter"));
|
VIR_ERROR(_("Unable to create new virtual adapter"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1777,7 +1777,7 @@ phypAttachDevice(virDomainPtr domain, const char *xml)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(profile = phypGetLparProfile(conn, domain->id))) {
|
if (!(profile = phypGetLparProfile(conn, domain->id))) {
|
||||||
VIR_ERROR0(_("Unable to get VIOS profile name."));
|
VIR_ERROR(_("Unable to get VIOS profile name."));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1835,7 +1835,7 @@ phypAttachDevice(virDomainPtr domain, const char *xml)
|
|||||||
ret = phypExecBuffer(session, &buf, &exit_status, conn, false);
|
ret = phypExecBuffer(session, &buf, &exit_status, conn, false);
|
||||||
|
|
||||||
if (exit_status < 0 || ret == NULL) {
|
if (exit_status < 0 || ret == NULL) {
|
||||||
VIR_ERROR0(_
|
VIR_ERROR(_
|
||||||
("Possibly you don't have IBM Tools installed in your LPAR."
|
("Possibly you don't have IBM Tools installed in your LPAR."
|
||||||
"Contact your support to enable this feature."));
|
"Contact your support to enable this feature."));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -2018,18 +2018,18 @@ phypStorageVolCreateXML(virStoragePoolPtr pool,
|
|||||||
if (pool->name != NULL) {
|
if (pool->name != NULL) {
|
||||||
spdef->name = pool->name;
|
spdef->name = pool->name;
|
||||||
} else {
|
} else {
|
||||||
VIR_ERROR0(_("Unable to determine storage pool's name."));
|
VIR_ERROR(_("Unable to determine storage pool's name."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memcpy(spdef->uuid, pool->uuid, VIR_UUID_BUFLEN) == NULL) {
|
if (memcpy(spdef->uuid, pool->uuid, VIR_UUID_BUFLEN) == NULL) {
|
||||||
VIR_ERROR0(_("Unable to determine storage pool's uuid."));
|
VIR_ERROR(_("Unable to determine storage pool's uuid."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((spdef->capacity =
|
if ((spdef->capacity =
|
||||||
phypGetStoragePoolSize(pool->conn, pool->name)) == -1) {
|
phypGetStoragePoolSize(pool->conn, pool->name)) == -1) {
|
||||||
VIR_ERROR0(_("Unable to determine storage pools's size."));
|
VIR_ERROR(_("Unable to determine storage pools's size."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2042,18 +2042,18 @@ phypStorageVolCreateXML(virStoragePoolPtr pool,
|
|||||||
/*XXX source adapter not working properly, should show hdiskX */
|
/*XXX source adapter not working properly, should show hdiskX */
|
||||||
if ((spdef->source.adapter =
|
if ((spdef->source.adapter =
|
||||||
phypGetStoragePoolDevice(pool->conn, pool->name)) == NULL) {
|
phypGetStoragePoolDevice(pool->conn, pool->name)) == NULL) {
|
||||||
VIR_ERROR0(_("Unable to determine storage pools's source adapter."));
|
VIR_ERROR(_("Unable to determine storage pools's source adapter."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((voldef = virStorageVolDefParseString(spdef, xml)) == NULL) {
|
if ((voldef = virStorageVolDefParseString(spdef, xml)) == NULL) {
|
||||||
VIR_ERROR0(_("Error parsing volume XML."));
|
VIR_ERROR(_("Error parsing volume XML."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* checking if this name already exists on this system */
|
/* checking if this name already exists on this system */
|
||||||
if (phypVolumeLookupByName(pool, voldef->name) != NULL) {
|
if (phypVolumeLookupByName(pool, voldef->name) != NULL) {
|
||||||
VIR_ERROR0(_("StoragePool name already exists."));
|
VIR_ERROR(_("StoragePool name already exists."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2061,12 +2061,12 @@ phypStorageVolCreateXML(virStoragePoolPtr pool,
|
|||||||
* in the moment you create the volume.
|
* in the moment you create the volume.
|
||||||
* */
|
* */
|
||||||
if (voldef->key) {
|
if (voldef->key) {
|
||||||
VIR_ERROR0(_("Key must be empty, Power Hypervisor will create one for you."));
|
VIR_ERROR(_("Key must be empty, Power Hypervisor will create one for you."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (voldef->capacity) {
|
if (voldef->capacity) {
|
||||||
VIR_ERROR0(_("Capacity cannot be empty."));
|
VIR_ERROR(_("Capacity cannot be empty."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2242,17 +2242,17 @@ phypVolumeGetXMLDesc(virStorageVolPtr vol, unsigned int flags)
|
|||||||
if (sp->name != NULL) {
|
if (sp->name != NULL) {
|
||||||
pool.name = sp->name;
|
pool.name = sp->name;
|
||||||
} else {
|
} else {
|
||||||
VIR_ERROR0(_("Unable to determine storage sp's name."));
|
VIR_ERROR(_("Unable to determine storage sp's name."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memcpy(pool.uuid, sp->uuid, VIR_UUID_BUFLEN) == NULL) {
|
if (memcpy(pool.uuid, sp->uuid, VIR_UUID_BUFLEN) == NULL) {
|
||||||
VIR_ERROR0(_("Unable to determine storage sp's uuid."));
|
VIR_ERROR(_("Unable to determine storage sp's uuid."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pool.capacity = phypGetStoragePoolSize(sp->conn, sp->name)) == -1) {
|
if ((pool.capacity = phypGetStoragePoolSize(sp->conn, sp->name)) == -1) {
|
||||||
VIR_ERROR0(_("Unable to determine storage sps's size."));
|
VIR_ERROR(_("Unable to determine storage sps's size."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2264,14 +2264,14 @@ phypVolumeGetXMLDesc(virStorageVolPtr vol, unsigned int flags)
|
|||||||
|
|
||||||
if ((pool.source.adapter =
|
if ((pool.source.adapter =
|
||||||
phypGetStoragePoolDevice(sp->conn, sp->name)) == NULL) {
|
phypGetStoragePoolDevice(sp->conn, sp->name)) == NULL) {
|
||||||
VIR_ERROR0(_("Unable to determine storage sps's source adapter."));
|
VIR_ERROR(_("Unable to determine storage sps's source adapter."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vol->name != NULL)
|
if (vol->name != NULL)
|
||||||
voldef.name = vol->name;
|
voldef.name = vol->name;
|
||||||
else {
|
else {
|
||||||
VIR_ERROR0(_("Unable to determine storage pool's name."));
|
VIR_ERROR(_("Unable to determine storage pool's name."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2684,13 +2684,13 @@ phypStoragePoolCreateXML(virConnectPtr conn,
|
|||||||
|
|
||||||
/* checking if this name already exists on this system */
|
/* checking if this name already exists on this system */
|
||||||
if (phypStoragePoolLookupByName(conn, def->name) != NULL) {
|
if (phypStoragePoolLookupByName(conn, def->name) != NULL) {
|
||||||
VIR_WARN0("StoragePool name already exists.");
|
VIR_WARN("StoragePool name already exists.");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* checking if ID or UUID already exists on this system */
|
/* checking if ID or UUID already exists on this system */
|
||||||
if (phypGetStoragePoolLookUpByUUID(conn, def->uuid) != NULL) {
|
if (phypGetStoragePoolLookUpByUUID(conn, def->uuid) != NULL) {
|
||||||
VIR_WARN0("StoragePool uuid already exists.");
|
VIR_WARN("StoragePool uuid already exists.");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2720,18 +2720,18 @@ phypGetStoragePoolXMLDesc(virStoragePoolPtr pool, unsigned int flags)
|
|||||||
if (pool->name != NULL)
|
if (pool->name != NULL)
|
||||||
def.name = pool->name;
|
def.name = pool->name;
|
||||||
else {
|
else {
|
||||||
VIR_ERROR0(_("Unable to determine storage pool's name."));
|
VIR_ERROR(_("Unable to determine storage pool's name."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memcpy(def.uuid, pool->uuid, VIR_UUID_BUFLEN) == NULL) {
|
if (memcpy(def.uuid, pool->uuid, VIR_UUID_BUFLEN) == NULL) {
|
||||||
VIR_ERROR0(_("Unable to determine storage pool's uuid."));
|
VIR_ERROR(_("Unable to determine storage pool's uuid."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((def.capacity =
|
if ((def.capacity =
|
||||||
phypGetStoragePoolSize(pool->conn, pool->name)) == -1) {
|
phypGetStoragePoolSize(pool->conn, pool->name)) == -1) {
|
||||||
VIR_ERROR0(_("Unable to determine storage pools's size."));
|
VIR_ERROR(_("Unable to determine storage pools's size."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2744,7 +2744,7 @@ phypGetStoragePoolXMLDesc(virStoragePoolPtr pool, unsigned int flags)
|
|||||||
/*XXX source adapter not working properly, should show hdiskX */
|
/*XXX source adapter not working properly, should show hdiskX */
|
||||||
if ((def.source.adapter =
|
if ((def.source.adapter =
|
||||||
phypGetStoragePoolDevice(pool->conn, pool->name)) == NULL) {
|
phypGetStoragePoolDevice(pool->conn, pool->name)) == NULL) {
|
||||||
VIR_ERROR0(_("Unable to determine storage pools's source adapter."));
|
VIR_ERROR(_("Unable to determine storage pools's source adapter."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3319,30 +3319,30 @@ phypDomainGetXMLDesc(virDomainPtr dom, int flags)
|
|||||||
dom->conn);
|
dom->conn);
|
||||||
|
|
||||||
if (lpar_name == NULL) {
|
if (lpar_name == NULL) {
|
||||||
VIR_ERROR0(_("Unable to determine domain's name."));
|
VIR_ERROR(_("Unable to determine domain's name."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phypGetLparUUID(def.uuid, dom->id, dom->conn) == -1) {
|
if (phypGetLparUUID(def.uuid, dom->id, dom->conn) == -1) {
|
||||||
VIR_ERROR0(_("Unable to generate random uuid."));
|
VIR_ERROR(_("Unable to generate random uuid."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((def.mem.max_balloon =
|
if ((def.mem.max_balloon =
|
||||||
phypGetLparMem(dom->conn, managed_system, dom->id, 0)) == 0) {
|
phypGetLparMem(dom->conn, managed_system, dom->id, 0)) == 0) {
|
||||||
VIR_ERROR0(_("Unable to determine domain's max memory."));
|
VIR_ERROR(_("Unable to determine domain's max memory."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((def.mem.cur_balloon =
|
if ((def.mem.cur_balloon =
|
||||||
phypGetLparMem(dom->conn, managed_system, dom->id, 1)) == 0) {
|
phypGetLparMem(dom->conn, managed_system, dom->id, 1)) == 0) {
|
||||||
VIR_ERROR0(_("Unable to determine domain's memory."));
|
VIR_ERROR(_("Unable to determine domain's memory."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((def.maxvcpus = def.vcpus =
|
if ((def.maxvcpus = def.vcpus =
|
||||||
phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0) {
|
phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0) {
|
||||||
VIR_ERROR0(_("Unable to determine domain's CPU."));
|
VIR_ERROR(_("Unable to determine domain's CPU."));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3457,15 +3457,15 @@ phypDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
|
|||||||
|
|
||||||
if ((info->maxMem =
|
if ((info->maxMem =
|
||||||
phypGetLparMem(dom->conn, managed_system, dom->id, 0)) == 0)
|
phypGetLparMem(dom->conn, managed_system, dom->id, 0)) == 0)
|
||||||
VIR_WARN0("Unable to determine domain's max memory.");
|
VIR_WARN("Unable to determine domain's max memory.");
|
||||||
|
|
||||||
if ((info->memory =
|
if ((info->memory =
|
||||||
phypGetLparMem(dom->conn, managed_system, dom->id, 1)) == 0)
|
phypGetLparMem(dom->conn, managed_system, dom->id, 1)) == 0)
|
||||||
VIR_WARN0("Unable to determine domain's memory.");
|
VIR_WARN("Unable to determine domain's memory.");
|
||||||
|
|
||||||
if ((info->nrVirtCpu =
|
if ((info->nrVirtCpu =
|
||||||
phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0)
|
phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0)
|
||||||
VIR_WARN0("Unable to determine domain's CPU.");
|
VIR_WARN("Unable to determine domain's CPU.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3560,7 +3560,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (phypUUIDTable_AddLpar(conn, def->uuid, def->id) == -1) {
|
if (phypUUIDTable_AddLpar(conn, def->uuid, def->id) == -1) {
|
||||||
VIR_ERROR0(_("Unable to add LPAR to the table"));
|
VIR_ERROR(_("Unable to add LPAR to the table"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3596,14 +3596,14 @@ phypDomainCreateAndStart(virConnectPtr conn,
|
|||||||
|
|
||||||
/* checking if this name already exists on this system */
|
/* checking if this name already exists on this system */
|
||||||
if (phypGetLparID(session, managed_system, def->name, conn) != -1) {
|
if (phypGetLparID(session, managed_system, def->name, conn) != -1) {
|
||||||
VIR_WARN0("LPAR name already exists.");
|
VIR_WARN("LPAR name already exists.");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* checking if ID or UUID already exists on this system */
|
/* checking if ID or UUID already exists on this system */
|
||||||
for (i = 0; i < uuid_table->nlpars; i++) {
|
for (i = 0; i < uuid_table->nlpars; i++) {
|
||||||
if (lpars[i]->id == def->id || lpars[i]->uuid == def->uuid) {
|
if (lpars[i]->id == def->id || lpars[i]->uuid == def->uuid) {
|
||||||
VIR_WARN0("LPAR ID or UUID already exists.");
|
VIR_WARN("LPAR ID or UUID already exists.");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3663,7 +3663,7 @@ phypDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (nvcpus > phypGetLparCPUMAX(dom)) {
|
if (nvcpus > phypGetLparCPUMAX(dom)) {
|
||||||
VIR_ERROR0(_("You are trying to set a number of CPUs bigger than "
|
VIR_ERROR(_("You are trying to set a number of CPUs bigger than "
|
||||||
"the max possible."));
|
"the max possible."));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3686,7 +3686,7 @@ phypDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
ret = phypExecBuffer(session, &buf, &exit_status, dom->conn, false);
|
ret = phypExecBuffer(session, &buf, &exit_status, dom->conn, false);
|
||||||
|
|
||||||
if (exit_status < 0) {
|
if (exit_status < 0) {
|
||||||
VIR_ERROR0(_
|
VIR_ERROR(_
|
||||||
("Possibly you don't have IBM Tools installed in your LPAR."
|
("Possibly you don't have IBM Tools installed in your LPAR."
|
||||||
" Contact your support to enable this feature."));
|
" Contact your support to enable this feature."));
|
||||||
}
|
}
|
||||||
|
@ -69,20 +69,20 @@ qemuAuditDisk(virDomainObjPtr vm,
|
|||||||
|
|
||||||
virUUIDFormat(vm->def->uuid, uuidstr);
|
virUUIDFormat(vm->def->uuid, uuidstr);
|
||||||
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(oldsrc = virAuditEncode("old-disk",
|
if (!(oldsrc = virAuditEncode("old-disk",
|
||||||
oldDef && oldDef->src ?
|
oldDef && oldDef->src ?
|
||||||
oldDef->src : "?"))) {
|
oldDef->src : "?"))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (!(newsrc = virAuditEncode("new-disk",
|
if (!(newsrc = virAuditEncode("new-disk",
|
||||||
newDef && newDef->src ?
|
newDef && newDef->src ?
|
||||||
newDef->src : "?"))) {
|
newDef->src : "?"))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ qemuAuditNet(virDomainObjPtr vm,
|
|||||||
if (newDef)
|
if (newDef)
|
||||||
virFormatMacAddr(newDef->mac, newMacstr);
|
virFormatMacAddr(newDef->mac, newMacstr);
|
||||||
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ qemuAuditNetDevice(virDomainDefPtr vmDef, virDomainNetDefPtr netDef,
|
|||||||
|
|
||||||
if (!(vmname = virAuditEncode("vm", vmDef->name)) ||
|
if (!(vmname = virAuditEncode("vm", vmDef->name)) ||
|
||||||
!(devname = virAuditEncode("path", device))) {
|
!(devname = virAuditEncode("path", device))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ qemuAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
|
|||||||
|
|
||||||
virUUIDFormat(vm->def->uuid, uuidstr);
|
virUUIDFormat(vm->def->uuid, uuidstr);
|
||||||
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ qemuAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
|
|||||||
hostdev->source.subsys.u.pci.bus,
|
hostdev->source.subsys.u.pci.bus,
|
||||||
hostdev->source.subsys.u.pci.slot,
|
hostdev->source.subsys.u.pci.slot,
|
||||||
hostdev->source.subsys.u.pci.function) < 0) {
|
hostdev->source.subsys.u.pci.function) < 0) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -208,7 +208,7 @@ qemuAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
|
|||||||
if (virAsprintf(&address, "%.3d.%.3d",
|
if (virAsprintf(&address, "%.3d.%.3d",
|
||||||
hostdev->source.subsys.u.usb.bus,
|
hostdev->source.subsys.u.usb.bus,
|
||||||
hostdev->source.subsys.u.usb.device) < 0) {
|
hostdev->source.subsys.u.usb.device) < 0) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -219,7 +219,7 @@ qemuAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(device = virAuditEncode("device", VIR_AUDIT_STR(address)))) {
|
if (!(device = virAuditEncode("device", VIR_AUDIT_STR(address)))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ qemuAuditCgroup(virDomainObjPtr vm, virCgroupPtr cgroup,
|
|||||||
|
|
||||||
virUUIDFormat(vm->def->uuid, uuidstr);
|
virUUIDFormat(vm->def->uuid, uuidstr);
|
||||||
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ qemuAuditCgroupMajor(virDomainObjPtr vm, virCgroupPtr cgroup,
|
|||||||
|
|
||||||
if (virAsprintf(&extra, "major category=%s maj=%02X acl=%s",
|
if (virAsprintf(&extra, "major category=%s maj=%02X acl=%s",
|
||||||
name, maj, perms) < 0) {
|
name, maj, perms) < 0) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ qemuAuditCgroupPath(virDomainObjPtr vm, virCgroupPtr cgroup,
|
|||||||
if (!(detail = virAuditEncode("path", path)) ||
|
if (!(detail = virAuditEncode("path", path)) ||
|
||||||
virAsprintf(&extra, "path path=%s rdev=%s acl=%s",
|
virAsprintf(&extra, "path path=%s rdev=%s acl=%s",
|
||||||
path, VIR_AUDIT_STR(rdev), perms) < 0) {
|
path, VIR_AUDIT_STR(rdev), perms) < 0) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ qemuAuditResource(virDomainObjPtr vm, const char *resource,
|
|||||||
|
|
||||||
virUUIDFormat(vm->def->uuid, uuidstr);
|
virUUIDFormat(vm->def->uuid, uuidstr);
|
||||||
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,7 +409,7 @@ qemuAuditLifecycle(virDomainObjPtr vm, const char *op,
|
|||||||
virUUIDFormat(vm->def->uuid, uuidstr);
|
virUUIDFormat(vm->def->uuid, uuidstr);
|
||||||
|
|
||||||
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,7 +462,7 @@ qemuAuditSecurityLabel(virDomainObjPtr vm, bool success)
|
|||||||
|
|
||||||
virUUIDFormat(vm->def->uuid, uuidstr);
|
virUUIDFormat(vm->def->uuid, uuidstr);
|
||||||
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
|
||||||
VIR_WARN0("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -806,12 +806,12 @@ virCapsPtr qemuCapsInit(virCapsPtr old_caps)
|
|||||||
*/
|
*/
|
||||||
if (nodeCapsInitNUMA(caps) < 0) {
|
if (nodeCapsInitNUMA(caps) < 0) {
|
||||||
virCapabilitiesFreeNUMAInfo(caps);
|
virCapabilitiesFreeNUMAInfo(caps);
|
||||||
VIR_WARN0("Failed to query host NUMA topology, disabling NUMA capabilities");
|
VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old_caps == NULL || old_caps->host.cpu == NULL) {
|
if (old_caps == NULL || old_caps->host.cpu == NULL) {
|
||||||
if (qemuCapsInitCPU(caps, utsname.machine) < 0)
|
if (qemuCapsInitCPU(caps, utsname.machine) < 0)
|
||||||
VIR_WARN0("Failed to get host CPU");
|
VIR_WARN("Failed to get host CPU");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
caps->host.cpu = old_caps->host.cpu;
|
caps->host.cpu = old_caps->host.cpu;
|
||||||
|
@ -218,7 +218,7 @@ int qemuSetupCgroup(struct qemud_driver *driver,
|
|||||||
qemuAuditCgroup(vm, cgroup, "deny", "all", rc == 0);
|
qemuAuditCgroup(vm, cgroup, "deny", "all", rc == 0);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
if (rc == -EPERM) {
|
if (rc == -EPERM) {
|
||||||
VIR_WARN0("Group devices ACL is not accessible, disabling whitelisting");
|
VIR_WARN("Group devices ACL is not accessible, disabling whitelisting");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
|
|||||||
for (i = 0, pp = p->list; pp; ++i, pp = pp->next) {
|
for (i = 0, pp = p->list; pp; ++i, pp = pp->next) {
|
||||||
int ctl;
|
int ctl;
|
||||||
if (pp->type != VIR_CONF_STRING) {
|
if (pp->type != VIR_CONF_STRING) {
|
||||||
VIR_ERROR0(_("cgroup_controllers must be a list of strings"));
|
VIR_ERROR(_("cgroup_controllers must be a list of strings"));
|
||||||
virConfFree(conf);
|
virConfFree(conf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -327,7 +327,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
for (i = 0, pp = p->list; pp; ++i, pp = pp->next) {
|
for (i = 0, pp = p->list; pp; ++i, pp = pp->next) {
|
||||||
if (pp->type != VIR_CONF_STRING) {
|
if (pp->type != VIR_CONF_STRING) {
|
||||||
VIR_ERROR0(_("cgroup_device_acl must be a list of strings"));
|
VIR_ERROR(_("cgroup_device_acl must be a list of strings"));
|
||||||
virConfFree(conf);
|
virConfFree(conf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ static void qemuDomainObjPrivateFree(void *data)
|
|||||||
|
|
||||||
/* This should never be non-NULL if we get here, but just in case... */
|
/* This should never be non-NULL if we get here, but just in case... */
|
||||||
if (priv->mon) {
|
if (priv->mon) {
|
||||||
VIR_ERROR0(_("Unexpected QEMU monitor still active during domain deletion"));
|
VIR_ERROR(_("Unexpected QEMU monitor still active during domain deletion"));
|
||||||
qemuMonitorClose(priv->mon);
|
qemuMonitorClose(priv->mon);
|
||||||
}
|
}
|
||||||
VIR_FREE(priv);
|
VIR_FREE(priv);
|
||||||
|
@ -217,7 +217,7 @@ qemuSecurityInit(struct qemud_driver *driver)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_ERROR0(_("Failed to initialize security drivers"));
|
VIR_ERROR(_("Failed to initialize security drivers"));
|
||||||
virSecurityManagerFree(mgr);
|
virSecurityManagerFree(mgr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -318,7 +318,7 @@ static void qemuDomainSnapshotLoad(void *payload,
|
|||||||
VIR_INFO("Loading snapshot file '%s'", entry->d_name);
|
VIR_INFO("Loading snapshot file '%s'", entry->d_name);
|
||||||
|
|
||||||
if (virAsprintf(&fullpath, "%s/%s", snapDir, entry->d_name) < 0) {
|
if (virAsprintf(&fullpath, "%s/%s", snapDir, entry->d_name) < 0) {
|
||||||
VIR_ERROR0(_("Failed to allocate memory for path"));
|
VIR_ERROR(_("Failed to allocate memory for path"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,7 +380,7 @@ qemudStartup(int privileged) {
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virMutexInit(&qemu_driver->lock) < 0) {
|
if (virMutexInit(&qemu_driver->lock) < 0) {
|
||||||
VIR_ERROR0(_("cannot initialize mutex"));
|
VIR_ERROR(_("cannot initialize mutex"));
|
||||||
VIR_FREE(qemu_driver);
|
VIR_FREE(qemu_driver);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1015,7 +1015,7 @@ qemudGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, int pid,
|
|||||||
"%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*d %d",
|
"%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*d %d",
|
||||||
&usertime, &systime, &cpu) != 3) {
|
&usertime, &systime, &cpu) != 3) {
|
||||||
VIR_FORCE_FCLOSE(pidinfo);
|
VIR_FORCE_FCLOSE(pidinfo);
|
||||||
VIR_WARN0("cannot parse process status data");
|
VIR_WARN("cannot parse process status data");
|
||||||
errno = -EINVAL;
|
errno = -EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -2118,7 +2118,7 @@ endjob:
|
|||||||
if (header.was_running && virDomainObjIsActive(vm)) {
|
if (header.was_running && virDomainObjIsActive(vm)) {
|
||||||
rc = qemuProcessStartCPUs(driver, vm, dom->conn);
|
rc = qemuProcessStartCPUs(driver, vm, dom->conn);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
VIR_WARN0("Unable to resume guest CPUs after save failure");
|
VIR_WARN("Unable to resume guest CPUs after save failure");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (qemuDomainObjEndJob(vm) == 0)
|
if (qemuDomainObjEndJob(vm) == 0)
|
||||||
|
@ -291,7 +291,7 @@ cleanup:
|
|||||||
(controller->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
|
(controller->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
|
||||||
releaseaddr &&
|
releaseaddr &&
|
||||||
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &controller->info) < 0)
|
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &controller->info) < 0)
|
||||||
VIR_WARN0("Unable to release PCI address on controller");
|
VIR_WARN("Unable to release PCI address on controller");
|
||||||
|
|
||||||
VIR_FREE(devstr);
|
VIR_FREE(devstr);
|
||||||
return ret;
|
return ret;
|
||||||
@ -326,7 +326,7 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
|
|||||||
cont->idx = controller;
|
cont->idx = controller;
|
||||||
cont->model = -1;
|
cont->model = -1;
|
||||||
|
|
||||||
VIR_INFO0("No SCSI controller present, hotplugging one");
|
VIR_INFO("No SCSI controller present, hotplugging one");
|
||||||
if (qemuDomainAttachPciControllerDevice(driver,
|
if (qemuDomainAttachPciControllerDevice(driver,
|
||||||
vm, cont) < 0) {
|
vm, cont) < 0) {
|
||||||
VIR_FREE(cont);
|
VIR_FREE(cont);
|
||||||
@ -698,7 +698,7 @@ cleanup:
|
|||||||
(net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
|
(net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
|
||||||
releaseaddr &&
|
releaseaddr &&
|
||||||
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &net->info) < 0)
|
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &net->info) < 0)
|
||||||
VIR_WARN0("Unable to release PCI address on NIC");
|
VIR_WARN("Unable to release PCI address on NIC");
|
||||||
|
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
virDomainConfNWFilterTeardown(net);
|
virDomainConfNWFilterTeardown(net);
|
||||||
@ -729,7 +729,7 @@ try_remove:
|
|||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
VIR_FREE(netdev_name);
|
VIR_FREE(netdev_name);
|
||||||
} else {
|
} else {
|
||||||
VIR_WARN0("Unable to remove network backend");
|
VIR_WARN("Unable to remove network backend");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char *hostnet_name;
|
char *hostnet_name;
|
||||||
@ -829,7 +829,7 @@ error:
|
|||||||
(hostdev->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
|
(hostdev->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
|
||||||
releaseaddr &&
|
releaseaddr &&
|
||||||
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &hostdev->info) < 0)
|
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &hostdev->info) < 0)
|
||||||
VIR_WARN0("Unable to release PCI address on host device");
|
VIR_WARN("Unable to release PCI address on host device");
|
||||||
|
|
||||||
qemuDomainReAttachHostdevDevices(driver, &hostdev, 1);
|
qemuDomainReAttachHostdevDevices(driver, &hostdev, 1);
|
||||||
|
|
||||||
@ -964,7 +964,7 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
|
|||||||
error:
|
error:
|
||||||
if (virSecurityManagerRestoreHostdevLabel(driver->securityManager,
|
if (virSecurityManagerRestoreHostdevLabel(driver->securityManager,
|
||||||
vm, hostdev) < 0)
|
vm, hostdev) < 0)
|
||||||
VIR_WARN0("Unable to restore host device labelling on hotplug fail");
|
VIR_WARN("Unable to restore host device labelling on hotplug fail");
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1072,7 +1072,7 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
|
|||||||
olddev->data.spice.auth.validTo = dev->data.spice.auth.validTo;
|
olddev->data.spice.auth.validTo = dev->data.spice.auth.validTo;
|
||||||
olddev->data.spice.auth.expires = dev->data.spice.auth.expires;
|
olddev->data.spice.auth.expires = dev->data.spice.auth.expires;
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("Not updating since password didn't change");
|
VIR_DEBUG("Not updating since password didn't change");
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1393,7 +1393,7 @@ int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
|
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
|
||||||
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
|
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
|
||||||
VIR_WARN0("Unable to release PCI address on controller");
|
VIR_WARN("Unable to release PCI address on controller");
|
||||||
|
|
||||||
virDomainControllerDefFree(detach);
|
virDomainControllerDefFree(detach);
|
||||||
|
|
||||||
@ -1485,7 +1485,7 @@ int qemuDomainDetachNetDevice(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
|
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
|
||||||
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
|
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
|
||||||
VIR_WARN0("Unable to release PCI address on NIC");
|
VIR_WARN("Unable to release PCI address on NIC");
|
||||||
|
|
||||||
virDomainConfNWFilterTeardown(detach);
|
virDomainConfNWFilterTeardown(detach);
|
||||||
|
|
||||||
@ -1602,7 +1602,7 @@ int qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
|
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
|
||||||
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
|
qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0)
|
||||||
VIR_WARN0("Unable to release PCI address on host device");
|
VIR_WARN("Unable to release PCI address on host device");
|
||||||
|
|
||||||
if (vm->def->nhostdevs > 1) {
|
if (vm->def->nhostdevs > 1) {
|
||||||
memmove(vm->def->hostdevs + i,
|
memmove(vm->def->hostdevs + i,
|
||||||
@ -1731,7 +1731,7 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (virSecurityManagerRestoreHostdevLabel(driver->securityManager,
|
if (virSecurityManagerRestoreHostdevLabel(driver->securityManager,
|
||||||
vm, dev->data.hostdev) < 0)
|
vm, dev->data.hostdev) < 0)
|
||||||
VIR_WARN0("Failed to restore host device labelling");
|
VIR_WARN("Failed to restore host device labelling");
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -122,18 +122,18 @@ qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr vm)
|
|||||||
|
|
||||||
if (priv->jobSignals & QEMU_JOB_SIGNAL_CANCEL) {
|
if (priv->jobSignals & QEMU_JOB_SIGNAL_CANCEL) {
|
||||||
priv->jobSignals ^= QEMU_JOB_SIGNAL_CANCEL;
|
priv->jobSignals ^= QEMU_JOB_SIGNAL_CANCEL;
|
||||||
VIR_DEBUG0("Cancelling job at client request");
|
VIR_DEBUG("Cancelling job at client request");
|
||||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
||||||
rc = qemuMonitorMigrateCancel(priv->mon);
|
rc = qemuMonitorMigrateCancel(priv->mon);
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
VIR_WARN0("Unable to cancel job");
|
VIR_WARN("Unable to cancel job");
|
||||||
}
|
}
|
||||||
} else if (priv->jobSignals & QEMU_JOB_SIGNAL_SUSPEND) {
|
} else if (priv->jobSignals & QEMU_JOB_SIGNAL_SUSPEND) {
|
||||||
priv->jobSignals ^= QEMU_JOB_SIGNAL_SUSPEND;
|
priv->jobSignals ^= QEMU_JOB_SIGNAL_SUSPEND;
|
||||||
VIR_DEBUG0("Pausing domain for non-live migration");
|
VIR_DEBUG("Pausing domain for non-live migration");
|
||||||
if (qemuMigrationSetOffline(driver, vm) < 0)
|
if (qemuMigrationSetOffline(driver, vm) < 0)
|
||||||
VIR_WARN0("Unable to pause domain");
|
VIR_WARN("Unable to pause domain");
|
||||||
} else if (priv->jobSignals & QEMU_JOB_SIGNAL_MIGRATE_DOWNTIME) {
|
} else if (priv->jobSignals & QEMU_JOB_SIGNAL_MIGRATE_DOWNTIME) {
|
||||||
unsigned long long ms = priv->jobSignalsData.migrateDowntime;
|
unsigned long long ms = priv->jobSignalsData.migrateDowntime;
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr vm)
|
|||||||
rc = qemuMonitorSetMigrationDowntime(priv->mon, ms);
|
rc = qemuMonitorSetMigrationDowntime(priv->mon, ms);
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
VIR_WARN0("Unable to set migration downtime");
|
VIR_WARN("Unable to set migration downtime");
|
||||||
} else if (priv->jobSignals & QEMU_JOB_SIGNAL_MIGRATE_SPEED) {
|
} else if (priv->jobSignals & QEMU_JOB_SIGNAL_MIGRATE_SPEED) {
|
||||||
unsigned long bandwidth = priv->jobSignalsData.migrateBandwidth;
|
unsigned long bandwidth = priv->jobSignalsData.migrateBandwidth;
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr vm)
|
|||||||
rc = qemuMonitorSetMigrationSpeed(priv->mon, bandwidth);
|
rc = qemuMonitorSetMigrationSpeed(priv->mon, bandwidth);
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
VIR_WARN0("Unable to set migration speed");
|
VIR_WARN("Unable to set migration speed");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Repeat check because the job signals might have caused
|
/* Repeat check because the job signals might have caused
|
||||||
@ -1364,7 +1364,7 @@ qemuMigrationToFile(struct qemud_driver *driver, virDomainObjPtr vm,
|
|||||||
pipeFD[1]);
|
pipeFD[1]);
|
||||||
if (VIR_CLOSE(pipeFD[0]) < 0 ||
|
if (VIR_CLOSE(pipeFD[0]) < 0 ||
|
||||||
VIR_CLOSE(pipeFD[1]) < 0)
|
VIR_CLOSE(pipeFD[1]) < 0)
|
||||||
VIR_WARN0("failed to close intermediate pipe");
|
VIR_WARN("failed to close intermediate pipe");
|
||||||
} else {
|
} else {
|
||||||
rc = qemuMonitorMigrateToFile(priv->mon,
|
rc = qemuMonitorMigrateToFile(priv->mon,
|
||||||
QEMU_MONITOR_MIGRATE_BACKGROUND,
|
QEMU_MONITOR_MIGRATE_BACKGROUND,
|
||||||
|
@ -1429,7 +1429,7 @@ int qemuMonitorMigrateToFd(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (qemuMonitorCloseFileHandle(mon, "migrate") < 0)
|
if (qemuMonitorCloseFileHandle(mon, "migrate") < 0)
|
||||||
VIR_WARN0("failed to close migration handle");
|
VIR_WARN("failed to close migration handle");
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -84,7 +84,7 @@ qemuMonitorJSONIOProcessEvent(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
type = virJSONValueObjectGetString(obj, "event");
|
type = virJSONValueObjectGetString(obj, "event");
|
||||||
if (!type) {
|
if (!type) {
|
||||||
VIR_WARN0("missing event type in message");
|
VIR_WARN("missing event type in message");
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -112,18 +112,18 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("Line [%s]", line);
|
VIR_DEBUG("Line [%s]", line);
|
||||||
|
|
||||||
if (!(obj = virJSONValueFromString(line))) {
|
if (!(obj = virJSONValueFromString(line))) {
|
||||||
VIR_DEBUG0("Parsing JSON string failed");
|
VIR_DEBUG("Parsing JSON string failed");
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->type != VIR_JSON_TYPE_OBJECT) {
|
if (obj->type != VIR_JSON_TYPE_OBJECT) {
|
||||||
VIR_DEBUG0("Parsed JSON string isn't an object");
|
VIR_DEBUG("Parsed JSON string isn't an object");
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectHasKey(obj, "QMP") == 1) {
|
if (virJSONValueObjectHasKey(obj, "QMP") == 1) {
|
||||||
VIR_DEBUG0("Got QMP capabilities data");
|
VIR_DEBUG("Got QMP capabilities data");
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -537,7 +537,7 @@ static void qemuMonitorJSONHandleRTCChange(qemuMonitorPtr mon, virJSONValuePtr d
|
|||||||
{
|
{
|
||||||
long long offset = 0;
|
long long offset = 0;
|
||||||
if (virJSONValueObjectGetNumberLong(data, "offset", &offset) < 0) {
|
if (virJSONValueObjectGetNumberLong(data, "offset", &offset) < 0) {
|
||||||
VIR_WARN0("missing offset in RTC change event");
|
VIR_WARN("missing offset in RTC change event");
|
||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
qemuMonitorEmitRTCChange(mon, offset);
|
qemuMonitorEmitRTCChange(mon, offset);
|
||||||
@ -552,7 +552,7 @@ static void qemuMonitorJSONHandleWatchdog(qemuMonitorPtr mon, virJSONValuePtr da
|
|||||||
const char *action;
|
const char *action;
|
||||||
int actionID;
|
int actionID;
|
||||||
if (!(action = virJSONValueObjectGetString(data, "action"))) {
|
if (!(action = virJSONValueObjectGetString(data, "action"))) {
|
||||||
VIR_WARN0("missing action in watchdog event");
|
VIR_WARN("missing action in watchdog event");
|
||||||
}
|
}
|
||||||
if (action) {
|
if (action) {
|
||||||
if ((actionID = qemuMonitorWatchdogActionTypeFromString(action)) < 0) {
|
if ((actionID = qemuMonitorWatchdogActionTypeFromString(action)) < 0) {
|
||||||
@ -582,17 +582,17 @@ static void qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr dat
|
|||||||
to the application */
|
to the application */
|
||||||
|
|
||||||
if ((action = virJSONValueObjectGetString(data, "action")) == NULL) {
|
if ((action = virJSONValueObjectGetString(data, "action")) == NULL) {
|
||||||
VIR_WARN0("Missing action in disk io error event");
|
VIR_WARN("Missing action in disk io error event");
|
||||||
action = "ignore";
|
action = "ignore";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((device = virJSONValueObjectGetString(data, "device")) == NULL) {
|
if ((device = virJSONValueObjectGetString(data, "device")) == NULL) {
|
||||||
VIR_WARN0("missing device in disk io error event");
|
VIR_WARN("missing device in disk io error event");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if ((reason = virJSONValueObjectGetString(data, "reason")) == NULL) {
|
if ((reason = virJSONValueObjectGetString(data, "reason")) == NULL) {
|
||||||
VIR_WARN0("missing reason in disk io error event");
|
VIR_WARN("missing reason in disk io error event");
|
||||||
reason = "";
|
reason = "";
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -622,11 +622,11 @@ static void qemuMonitorJSONHandleVNC(qemuMonitorPtr mon, virJSONValuePtr data, i
|
|||||||
virJSONValuePtr server;
|
virJSONValuePtr server;
|
||||||
|
|
||||||
if (!(client = virJSONValueObjectGet(data, "client"))) {
|
if (!(client = virJSONValueObjectGet(data, "client"))) {
|
||||||
VIR_WARN0("missing client info in VNC event");
|
VIR_WARN("missing client info in VNC event");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(server = virJSONValueObjectGet(data, "server"))) {
|
if (!(server = virJSONValueObjectGet(data, "server"))) {
|
||||||
VIR_WARN0("missing server info in VNC event");
|
VIR_WARN("missing server info in VNC event");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1504,7 +1504,7 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
||||||
qemuMonitorCheckHMP(mon, "cpu_set")) {
|
qemuMonitorCheckHMP(mon, "cpu_set")) {
|
||||||
VIR_DEBUG0("cpu_set command not found, trying HMP");
|
VIR_DEBUG("cpu_set command not found, trying HMP");
|
||||||
ret = qemuMonitorTextSetCPU(mon, cpu, online);
|
ret = qemuMonitorTextSetCPU(mon, cpu, online);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -2301,7 +2301,7 @@ int qemuMonitorJSONAddDrive(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
||||||
qemuMonitorCheckHMP(mon, "drive_add")) {
|
qemuMonitorCheckHMP(mon, "drive_add")) {
|
||||||
VIR_DEBUG0("drive_add command not found, trying HMP");
|
VIR_DEBUG("drive_add command not found, trying HMP");
|
||||||
ret = qemuMonitorTextAddDrive(mon, drivestr);
|
ret = qemuMonitorTextAddDrive(mon, drivestr);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -2334,10 +2334,10 @@ int qemuMonitorJSONDriveDel(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
|
if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
|
||||||
if (qemuMonitorCheckHMP(mon, "drive_del")) {
|
if (qemuMonitorCheckHMP(mon, "drive_del")) {
|
||||||
VIR_DEBUG0("drive_del command not found, trying HMP");
|
VIR_DEBUG("drive_del command not found, trying HMP");
|
||||||
ret = qemuMonitorTextDriveDel(mon, drivestr);
|
ret = qemuMonitorTextDriveDel(mon, drivestr);
|
||||||
} else {
|
} else {
|
||||||
VIR_ERROR0(_("deleting disk is not supported. "
|
VIR_ERROR(_("deleting disk is not supported. "
|
||||||
"This may leak data if disk is reassigned"));
|
"This may leak data if disk is reassigned"));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
@ -2404,7 +2404,7 @@ int qemuMonitorJSONCreateSnapshot(qemuMonitorPtr mon, const char *name)
|
|||||||
|
|
||||||
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
||||||
qemuMonitorCheckHMP(mon, "savevm")) {
|
qemuMonitorCheckHMP(mon, "savevm")) {
|
||||||
VIR_DEBUG0("savevm command not found, trying HMP");
|
VIR_DEBUG("savevm command not found, trying HMP");
|
||||||
ret = qemuMonitorTextCreateSnapshot(mon, name);
|
ret = qemuMonitorTextCreateSnapshot(mon, name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -2434,7 +2434,7 @@ int qemuMonitorJSONLoadSnapshot(qemuMonitorPtr mon, const char *name)
|
|||||||
|
|
||||||
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
||||||
qemuMonitorCheckHMP(mon, "loadvm")) {
|
qemuMonitorCheckHMP(mon, "loadvm")) {
|
||||||
VIR_DEBUG0("loadvm command not found, trying HMP");
|
VIR_DEBUG("loadvm command not found, trying HMP");
|
||||||
ret = qemuMonitorTextLoadSnapshot(mon, name);
|
ret = qemuMonitorTextLoadSnapshot(mon, name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -2464,7 +2464,7 @@ int qemuMonitorJSONDeleteSnapshot(qemuMonitorPtr mon, const char *name)
|
|||||||
|
|
||||||
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
||||||
qemuMonitorCheckHMP(mon, "delvm")) {
|
qemuMonitorCheckHMP(mon, "delvm")) {
|
||||||
VIR_DEBUG0("delvm command not found, trying HMP");
|
VIR_DEBUG("delvm command not found, trying HMP");
|
||||||
ret = qemuMonitorTextDeleteSnapshot(mon, name);
|
ret = qemuMonitorTextDeleteSnapshot(mon, name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -2529,7 +2529,7 @@ int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon)
|
|||||||
|
|
||||||
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
|
||||||
qemuMonitorCheckHMP(mon, "inject-nmi")) {
|
qemuMonitorCheckHMP(mon, "inject-nmi")) {
|
||||||
VIR_DEBUG0("inject-nmi command not found, trying HMP");
|
VIR_DEBUG("inject-nmi command not found, trying HMP");
|
||||||
ret = qemuMonitorTextInjectNMI(mon);
|
ret = qemuMonitorTextInjectNMI(mon);
|
||||||
} else {
|
} else {
|
||||||
ret = qemuMonitorJSONCheckError(cmd, reply);
|
ret = qemuMonitorJSONCheckError(cmd, reply);
|
||||||
|
@ -84,7 +84,7 @@ int qemuMonitorTextIOProcess(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
|||||||
not consumed anything. We'll restart when more data arrives. */
|
not consumed anything. We'll restart when more data arrives. */
|
||||||
if (!offset) {
|
if (!offset) {
|
||||||
#if DEBUG_IO
|
#if DEBUG_IO
|
||||||
VIR_DEBUG0("Partial greeting seen, getting out & waiting for more");
|
VIR_DEBUG("Partial greeting seen, getting out & waiting for more");
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ int qemuMonitorTextIOProcess(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
|||||||
used = offset - data + strlen(GREETING_POSTFIX);
|
used = offset - data + strlen(GREETING_POSTFIX);
|
||||||
|
|
||||||
#if DEBUG_IO
|
#if DEBUG_IO
|
||||||
VIR_DEBUG0("Discarded monitor greeting");
|
VIR_DEBUG("Discarded monitor greeting");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ int qemuMonitorTextIOProcess(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
|||||||
#if DEBUG_IO
|
#if DEBUG_IO
|
||||||
VIR_DEBUG("Finished %d byte reply [%s]", want, msg->rxBuffer);
|
VIR_DEBUG("Finished %d byte reply [%s]", want, msg->rxBuffer);
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("Finished 0 byte reply");
|
VIR_DEBUG("Finished 0 byte reply");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
msg->finished = 1;
|
msg->finished = 1;
|
||||||
@ -2386,7 +2386,7 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strstr(reply, "unknown command:")) {
|
if (strstr(reply, "unknown command:")) {
|
||||||
VIR_ERROR0(_("deleting drive is not supported. "
|
VIR_ERROR(_("deleting drive is not supported. "
|
||||||
"This may leak data if disk is reassigned"));
|
"This may leak data if disk is reassigned"));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -382,7 +382,7 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
|||||||
vm->def->clock.data.adjustment = offset;
|
vm->def->clock.data.adjustment = offset;
|
||||||
|
|
||||||
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
|
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
|
||||||
VIR_WARN0("unable to save domain status with RTC change");
|
VIR_WARN("unable to save domain status with RTC change");
|
||||||
|
|
||||||
virDomainObjUnlock(vm);
|
virDomainObjUnlock(vm);
|
||||||
|
|
||||||
@ -1091,7 +1091,7 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
|
|||||||
unsigned char *cpumap;
|
unsigned char *cpumap;
|
||||||
int cpumaplen;
|
int cpumaplen;
|
||||||
|
|
||||||
VIR_DEBUG0("Setting CPU affinity");
|
VIR_DEBUG("Setting CPU affinity");
|
||||||
|
|
||||||
if (nodeGetInfo(NULL, &nodeinfo) < 0)
|
if (nodeGetInfo(NULL, &nodeinfo) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1995,7 +1995,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
hookData.vm = vm;
|
hookData.vm = vm;
|
||||||
hookData.driver = driver;
|
hookData.driver = driver;
|
||||||
|
|
||||||
VIR_DEBUG0("Beginning VM startup process");
|
VIR_DEBUG("Beginning VM startup process");
|
||||||
|
|
||||||
if (virDomainObjIsActive(vm)) {
|
if (virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
@ -2007,7 +2007,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
* runtime state to vm->def that won't be persisted. This let's us
|
* runtime state to vm->def that won't be persisted. This let's us
|
||||||
* report implicit runtime defaults in the XML, like vnc listen/socket
|
* report implicit runtime defaults in the XML, like vnc listen/socket
|
||||||
*/
|
*/
|
||||||
VIR_DEBUG0("Setting current domain def as transient");
|
VIR_DEBUG("Setting current domain def as transient");
|
||||||
if (virDomainObjSetDefTransient(driver->caps, vm, true) < 0)
|
if (virDomainObjSetDefTransient(driver->caps, vm, true) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -2030,11 +2030,11 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Must be run before security labelling */
|
/* Must be run before security labelling */
|
||||||
VIR_DEBUG0("Preparing host devices");
|
VIR_DEBUG("Preparing host devices");
|
||||||
if (qemuPrepareHostDevices(driver, vm->def) < 0)
|
if (qemuPrepareHostDevices(driver, vm->def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG0("Preparing chr devices");
|
VIR_DEBUG("Preparing chr devices");
|
||||||
if (virDomainChrDefForeach(vm->def,
|
if (virDomainChrDefForeach(vm->def,
|
||||||
true,
|
true,
|
||||||
qemuProcessPrepareChardevDevice,
|
qemuProcessPrepareChardevDevice,
|
||||||
@ -2043,14 +2043,14 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
|
|
||||||
/* If you are using a SecurityDriver with dynamic labelling,
|
/* If you are using a SecurityDriver with dynamic labelling,
|
||||||
then generate a security label for isolation */
|
then generate a security label for isolation */
|
||||||
VIR_DEBUG0("Generating domain security label (if required)");
|
VIR_DEBUG("Generating domain security label (if required)");
|
||||||
if (virSecurityManagerGenLabel(driver->securityManager, vm) < 0) {
|
if (virSecurityManagerGenLabel(driver->securityManager, vm) < 0) {
|
||||||
qemuAuditSecurityLabel(vm, false);
|
qemuAuditSecurityLabel(vm, false);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
qemuAuditSecurityLabel(vm, true);
|
qemuAuditSecurityLabel(vm, true);
|
||||||
|
|
||||||
VIR_DEBUG0("Generating setting domain security labels (if required)");
|
VIR_DEBUG("Generating setting domain security labels (if required)");
|
||||||
if (virSecurityManagerSetAllLabel(driver->securityManager,
|
if (virSecurityManagerSetAllLabel(driver->securityManager,
|
||||||
vm, stdin_path) < 0)
|
vm, stdin_path) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -2061,7 +2061,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
*/
|
*/
|
||||||
struct stat stdin_sb;
|
struct stat stdin_sb;
|
||||||
|
|
||||||
VIR_DEBUG0("setting security label on pipe used for migration");
|
VIR_DEBUG("setting security label on pipe used for migration");
|
||||||
|
|
||||||
if (fstat(stdin_fd, &stdin_sb) < 0) {
|
if (fstat(stdin_fd, &stdin_sb) < 0) {
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
@ -2075,7 +2075,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
|
|
||||||
/* Ensure no historical cgroup for this VM is lying around bogus
|
/* Ensure no historical cgroup for this VM is lying around bogus
|
||||||
* settings */
|
* settings */
|
||||||
VIR_DEBUG0("Ensuring no historical cgroup is lying around");
|
VIR_DEBUG("Ensuring no historical cgroup is lying around");
|
||||||
qemuRemoveCgroup(driver, vm, 1);
|
qemuRemoveCgroup(driver, vm, 1);
|
||||||
|
|
||||||
if (vm->def->ngraphics == 1) {
|
if (vm->def->ngraphics == 1) {
|
||||||
@ -2121,11 +2121,11 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Creating domain log file");
|
VIR_DEBUG("Creating domain log file");
|
||||||
if ((logfile = qemuDomainCreateLog(driver, vm, false)) < 0)
|
if ((logfile = qemuDomainCreateLog(driver, vm, false)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG0("Determining emulator version");
|
VIR_DEBUG("Determining emulator version");
|
||||||
qemuCapsFree(priv->qemuCaps);
|
qemuCapsFree(priv->qemuCaps);
|
||||||
priv->qemuCaps = NULL;
|
priv->qemuCaps = NULL;
|
||||||
if (qemuCapsExtractVersionInfo(vm->def->emulator, vm->def->os.arch,
|
if (qemuCapsExtractVersionInfo(vm->def->emulator, vm->def->os.arch,
|
||||||
@ -2133,7 +2133,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
&priv->qemuCaps) < 0)
|
&priv->qemuCaps) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG0("Setting up domain cgroup (if required)");
|
VIR_DEBUG("Setting up domain cgroup (if required)");
|
||||||
if (qemuSetupCgroup(driver, vm) < 0)
|
if (qemuSetupCgroup(driver, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -2142,7 +2142,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Preparing monitor state");
|
VIR_DEBUG("Preparing monitor state");
|
||||||
if (qemuProcessPrepareMonitorChr(driver, priv->monConfig, vm->def->name) < 0)
|
if (qemuProcessPrepareMonitorChr(driver, priv->monConfig, vm->def->name) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -2176,7 +2176,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
* use in hotplug
|
* use in hotplug
|
||||||
*/
|
*/
|
||||||
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
||||||
VIR_DEBUG0("Assigning domain PCI addresses");
|
VIR_DEBUG("Assigning domain PCI addresses");
|
||||||
/* Populate cache with current addresses */
|
/* Populate cache with current addresses */
|
||||||
if (priv->pciaddrs) {
|
if (priv->pciaddrs) {
|
||||||
qemuDomainPCIAddressSetFree(priv->pciaddrs);
|
qemuDomainPCIAddressSetFree(priv->pciaddrs);
|
||||||
@ -2195,7 +2195,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
priv->persistentAddrs = 0;
|
priv->persistentAddrs = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Building emulator command line");
|
VIR_DEBUG("Building emulator command line");
|
||||||
if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
|
if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
|
||||||
priv->monJSON != 0, priv->qemuCaps,
|
priv->monJSON != 0, priv->qemuCaps,
|
||||||
migrateFrom, stdin_fd,
|
migrateFrom, stdin_fd,
|
||||||
@ -2297,31 +2297,31 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
if (ret == -1) /* The VM failed to start */
|
if (ret == -1) /* The VM failed to start */
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG0("Waiting for monitor to show up");
|
VIR_DEBUG("Waiting for monitor to show up");
|
||||||
if (qemuProcessWaitForMonitor(driver, vm, pos) < 0)
|
if (qemuProcessWaitForMonitor(driver, vm, pos) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG0("Detecting VCPU PIDs");
|
VIR_DEBUG("Detecting VCPU PIDs");
|
||||||
if (qemuProcessDetectVcpuPIDs(driver, vm) < 0)
|
if (qemuProcessDetectVcpuPIDs(driver, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG0("Setting VCPU affinities");
|
VIR_DEBUG("Setting VCPU affinities");
|
||||||
if (qemuProcessSetVcpuAffinites(conn, vm) < 0)
|
if (qemuProcessSetVcpuAffinites(conn, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG0("Setting any required VM passwords");
|
VIR_DEBUG("Setting any required VM passwords");
|
||||||
if (qemuProcessInitPasswords(conn, driver, vm) < 0)
|
if (qemuProcessInitPasswords(conn, driver, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* If we have -device, then addresses are assigned explicitly.
|
/* If we have -device, then addresses are assigned explicitly.
|
||||||
* If not, then we have to detect dynamic ones here */
|
* If not, then we have to detect dynamic ones here */
|
||||||
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
||||||
VIR_DEBUG0("Determining domain device PCI addresses");
|
VIR_DEBUG("Determining domain device PCI addresses");
|
||||||
if (qemuProcessInitPCIAddresses(driver, vm) < 0)
|
if (qemuProcessInitPCIAddresses(driver, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Setting initial memory amount");
|
VIR_DEBUG("Setting initial memory amount");
|
||||||
cur_balloon = vm->def->mem.cur_balloon;
|
cur_balloon = vm->def->mem.cur_balloon;
|
||||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
||||||
if (qemuMonitorSetBalloon(priv->mon, cur_balloon) < 0) {
|
if (qemuMonitorSetBalloon(priv->mon, cur_balloon) < 0) {
|
||||||
@ -2331,7 +2331,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
|
|
||||||
if (!start_paused) {
|
if (!start_paused) {
|
||||||
VIR_DEBUG0("Starting domain CPUs");
|
VIR_DEBUG("Starting domain CPUs");
|
||||||
/* Allow the CPUS to start executing */
|
/* Allow the CPUS to start executing */
|
||||||
if (qemuProcessStartCPUs(driver, vm, conn) < 0) {
|
if (qemuProcessStartCPUs(driver, vm, conn) < 0) {
|
||||||
if (virGetLastError() == NULL)
|
if (virGetLastError() == NULL)
|
||||||
@ -2342,7 +2342,7 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VIR_DEBUG0("Writing domain status to disk");
|
VIR_DEBUG("Writing domain status to disk");
|
||||||
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
|
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -923,21 +923,21 @@ doRemoteOpen (virConnectPtr conn,
|
|||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Adding Handler for remote events");
|
VIR_DEBUG("Adding Handler for remote events");
|
||||||
/* Set up a callback to listen on the socket data */
|
/* Set up a callback to listen on the socket data */
|
||||||
if ((priv->watch = virEventAddHandle(priv->sock,
|
if ((priv->watch = virEventAddHandle(priv->sock,
|
||||||
VIR_EVENT_HANDLE_READABLE,
|
VIR_EVENT_HANDLE_READABLE,
|
||||||
remoteDomainEventFired,
|
remoteDomainEventFired,
|
||||||
conn, NULL)) < 0) {
|
conn, NULL)) < 0) {
|
||||||
VIR_DEBUG0("virEventAddHandle failed: No addHandleImpl defined."
|
VIR_DEBUG("virEventAddHandle failed: No addHandleImpl defined."
|
||||||
" continuing without events.");
|
" continuing without events.");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
VIR_DEBUG0("Adding Timeout for remote event queue flushing");
|
VIR_DEBUG("Adding Timeout for remote event queue flushing");
|
||||||
if ( (priv->eventFlushTimer = virEventAddTimeout(-1,
|
if ( (priv->eventFlushTimer = virEventAddTimeout(-1,
|
||||||
remoteDomainEventQueueFlush,
|
remoteDomainEventQueueFlush,
|
||||||
conn, NULL)) < 0) {
|
conn, NULL)) < 0) {
|
||||||
VIR_DEBUG0("virEventAddTimeout failed: No addTimeoutImpl defined. "
|
VIR_DEBUG("virEventAddTimeout failed: No addTimeoutImpl defined. "
|
||||||
"continuing without events.");
|
"continuing without events.");
|
||||||
virEventRemoveHandle(priv->watch);
|
virEventRemoveHandle(priv->watch);
|
||||||
priv->watch = -1;
|
priv->watch = -1;
|
||||||
@ -1086,7 +1086,7 @@ remoteOpen (virConnectPtr conn,
|
|||||||
(STREQ(conn->uri->path, "/session") ||
|
(STREQ(conn->uri->path, "/session") ||
|
||||||
STRPREFIX(conn->uri->scheme, "test+")) &&
|
STRPREFIX(conn->uri->scheme, "test+")) &&
|
||||||
getuid() > 0) {
|
getuid() > 0) {
|
||||||
VIR_DEBUG0("Auto-spawn user daemon instance");
|
VIR_DEBUG("Auto-spawn user daemon instance");
|
||||||
rflags |= VIR_DRV_OPEN_REMOTE_USER;
|
rflags |= VIR_DRV_OPEN_REMOTE_USER;
|
||||||
if (!autostart ||
|
if (!autostart ||
|
||||||
STRNEQ(autostart, "0"))
|
STRNEQ(autostart, "0"))
|
||||||
@ -1100,10 +1100,10 @@ remoteOpen (virConnectPtr conn,
|
|||||||
* to the UNIX socket anyway.
|
* to the UNIX socket anyway.
|
||||||
*/
|
*/
|
||||||
if (!conn->uri) {
|
if (!conn->uri) {
|
||||||
VIR_DEBUG0("Auto-probe remote URI");
|
VIR_DEBUG("Auto-probe remote URI");
|
||||||
#ifndef __sun
|
#ifndef __sun
|
||||||
if (getuid() > 0) {
|
if (getuid() > 0) {
|
||||||
VIR_DEBUG0("Auto-spawn user daemon instance");
|
VIR_DEBUG("Auto-spawn user daemon instance");
|
||||||
rflags |= VIR_DRV_OPEN_REMOTE_USER;
|
rflags |= VIR_DRV_OPEN_REMOTE_USER;
|
||||||
if (!autostart ||
|
if (!autostart ||
|
||||||
STRNEQ(autostart, "0"))
|
STRNEQ(autostart, "0"))
|
||||||
@ -1406,7 +1406,7 @@ negotiate_gnutls_on_connection (virConnectPtr conn,
|
|||||||
|
|
||||||
/* Verify certificate. */
|
/* Verify certificate. */
|
||||||
if (verify_certificate (conn, priv, session) == -1) {
|
if (verify_certificate (conn, priv, session) == -1) {
|
||||||
VIR_DEBUG0("failed to verify peer's certificate");
|
VIR_DEBUG("failed to verify peer's certificate");
|
||||||
if (!no_verify)
|
if (!no_verify)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -3415,7 +3415,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
const char *mechlist;
|
const char *mechlist;
|
||||||
|
|
||||||
VIR_DEBUG0("Client initialize SASL authentication");
|
VIR_DEBUG("Client initialize SASL authentication");
|
||||||
/* Sets up the SASL library as a whole */
|
/* Sets up the SASL library as a whole */
|
||||||
err = sasl_client_init(NULL);
|
err = sasl_client_init(NULL);
|
||||||
if (err != SASL_OK) {
|
if (err != SASL_OK) {
|
||||||
@ -3697,7 +3697,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
priv->is_secure = 1;
|
priv->is_secure = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("SASL authentication complete");
|
VIR_DEBUG("SASL authentication complete");
|
||||||
priv->saslconn = saslconn;
|
priv->saslconn = saslconn;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -3723,7 +3723,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED)
|
virConnectAuthPtr auth ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
remote_auth_polkit_ret ret;
|
remote_auth_polkit_ret ret;
|
||||||
VIR_DEBUG0("Client initialize PolicyKit-1 authentication");
|
VIR_DEBUG("Client initialize PolicyKit-1 authentication");
|
||||||
|
|
||||||
memset (&ret, 0, sizeof ret);
|
memset (&ret, 0, sizeof ret);
|
||||||
if (call (conn, priv, in_open, REMOTE_PROC_AUTH_POLKIT,
|
if (call (conn, priv, in_open, REMOTE_PROC_AUTH_POLKIT,
|
||||||
@ -3732,7 +3732,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
return -1; /* virError already set by call */
|
return -1; /* virError already set by call */
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("PolicyKit-1 authentication complete");
|
VIR_DEBUG("PolicyKit-1 authentication complete");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
# elif HAVE_POLKIT0
|
# elif HAVE_POLKIT0
|
||||||
@ -3752,7 +3752,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
VIR_DEBUG0("Client initialize PolicyKit-0 authentication");
|
VIR_DEBUG("Client initialize PolicyKit-0 authentication");
|
||||||
|
|
||||||
if (auth && auth->cb) {
|
if (auth && auth->cb) {
|
||||||
/* Check if the necessary credential type for PolicyKit is supported */
|
/* Check if the necessary credential type for PolicyKit is supported */
|
||||||
@ -3762,7 +3762,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (allowcb) {
|
if (allowcb) {
|
||||||
VIR_DEBUG0("Client run callback for PolicyKit authentication");
|
VIR_DEBUG("Client run callback for PolicyKit authentication");
|
||||||
/* Run the authentication callback */
|
/* Run the authentication callback */
|
||||||
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
|
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
|
||||||
remoteError(VIR_ERR_AUTH_FAILED, "%s",
|
remoteError(VIR_ERR_AUTH_FAILED, "%s",
|
||||||
@ -3770,10 +3770,10 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("Client auth callback does not support PolicyKit");
|
VIR_DEBUG("Client auth callback does not support PolicyKit");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("No auth callback provided");
|
VIR_DEBUG("No auth callback provided");
|
||||||
}
|
}
|
||||||
|
|
||||||
memset (&ret, 0, sizeof ret);
|
memset (&ret, 0, sizeof ret);
|
||||||
@ -3783,7 +3783,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
return -1; /* virError already set by call */
|
return -1; /* virError already set by call */
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("PolicyKit-0 authentication complete");
|
VIR_DEBUG("PolicyKit-0 authentication complete");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
# endif /* HAVE_POLKIT0 */
|
# endif /* HAVE_POLKIT0 */
|
||||||
@ -4195,10 +4195,10 @@ remoteStreamEventTimerUpdate(struct private_stream_data *privst)
|
|||||||
if ((privst->incomingOffset &&
|
if ((privst->incomingOffset &&
|
||||||
(privst->cbEvents & VIR_STREAM_EVENT_READABLE)) ||
|
(privst->cbEvents & VIR_STREAM_EVENT_READABLE)) ||
|
||||||
(privst->cbEvents & VIR_STREAM_EVENT_WRITABLE)) {
|
(privst->cbEvents & VIR_STREAM_EVENT_WRITABLE)) {
|
||||||
VIR_DEBUG0("Enabling event timer");
|
VIR_DEBUG("Enabling event timer");
|
||||||
virEventUpdateTimeout(privst->cbTimer, 0);
|
virEventUpdateTimeout(privst->cbTimer, 0);
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("Disabling event timer");
|
VIR_DEBUG("Disabling event timer");
|
||||||
virEventUpdateTimeout(privst->cbTimer, -1);
|
virEventUpdateTimeout(privst->cbTimer, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4308,7 +4308,7 @@ remoteStreamHasError(virStreamPtr st) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Raising async error");
|
VIR_DEBUG("Raising async error");
|
||||||
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__,
|
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__,
|
||||||
privst->err.domain,
|
privst->err.domain,
|
||||||
privst->err.code,
|
privst->err.code,
|
||||||
@ -4400,7 +4400,7 @@ remoteStreamRecv(virStreamPtr st,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (st->flags & VIR_STREAM_NONBLOCK) {
|
if (st->flags & VIR_STREAM_NONBLOCK) {
|
||||||
VIR_DEBUG0("Non-blocking mode and no data available");
|
VIR_DEBUG("Non-blocking mode and no data available");
|
||||||
rv = -2;
|
rv = -2;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -5555,7 +5555,7 @@ processCallDispatchMessage(virConnectPtr conn, struct private_data *priv,
|
|||||||
|
|
||||||
if (virDomainEventQueuePush(priv->domainEvents,
|
if (virDomainEventQueuePush(priv->domainEvents,
|
||||||
event) < 0) {
|
event) < 0) {
|
||||||
VIR_DEBUG0("Error adding event to queue");
|
VIR_DEBUG("Error adding event to queue");
|
||||||
virDomainEventFree(event);
|
virDomainEventFree(event);
|
||||||
}
|
}
|
||||||
virEventUpdateTimeout(priv->eventFlushTimer, 0);
|
virEventUpdateTimeout(priv->eventFlushTimer, 0);
|
||||||
@ -5599,7 +5599,7 @@ processCallDispatchStream(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
case REMOTE_CONTINUE: {
|
case REMOTE_CONTINUE: {
|
||||||
int avail = privst->incomingLength - privst->incomingOffset;
|
int avail = privst->incomingLength - privst->incomingOffset;
|
||||||
int need = priv->bufferLength - priv->bufferOffset;
|
int need = priv->bufferLength - priv->bufferOffset;
|
||||||
VIR_DEBUG0("Got a stream data packet");
|
VIR_DEBUG("Got a stream data packet");
|
||||||
|
|
||||||
/* XXX flag stream as complete somwhere if need==0 */
|
/* XXX flag stream as complete somwhere if need==0 */
|
||||||
|
|
||||||
@ -5607,7 +5607,7 @@ processCallDispatchStream(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
int extra = need - avail;
|
int extra = need - avail;
|
||||||
if (VIR_REALLOC_N(privst->incoming,
|
if (VIR_REALLOC_N(privst->incoming,
|
||||||
privst->incomingLength + extra) < 0) {
|
privst->incomingLength + extra) < 0) {
|
||||||
VIR_DEBUG0("Out of memory handling stream data");
|
VIR_DEBUG("Out of memory handling stream data");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
privst->incomingLength += extra;
|
privst->incomingLength += extra;
|
||||||
@ -5629,9 +5629,9 @@ processCallDispatchStream(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
case REMOTE_OK:
|
case REMOTE_OK:
|
||||||
VIR_DEBUG0("Got a synchronous confirm");
|
VIR_DEBUG("Got a synchronous confirm");
|
||||||
if (!thecall) {
|
if (!thecall) {
|
||||||
VIR_DEBUG0("Got unexpected stream finish confirmation");
|
VIR_DEBUG("Got unexpected stream finish confirmation");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
thecall->mode = REMOTE_MODE_COMPLETE;
|
thecall->mode = REMOTE_MODE_COMPLETE;
|
||||||
@ -5639,7 +5639,7 @@ processCallDispatchStream(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
case REMOTE_ERROR:
|
case REMOTE_ERROR:
|
||||||
if (thecall && thecall->want_reply) {
|
if (thecall && thecall->want_reply) {
|
||||||
VIR_DEBUG0("Got a synchronous error");
|
VIR_DEBUG("Got a synchronous error");
|
||||||
/* Give the error straight to this call */
|
/* Give the error straight to this call */
|
||||||
memset (&thecall->err, 0, sizeof thecall->err);
|
memset (&thecall->err, 0, sizeof thecall->err);
|
||||||
if (!xdr_remote_error (xdr, &thecall->err)) {
|
if (!xdr_remote_error (xdr, &thecall->err)) {
|
||||||
@ -5648,16 +5648,16 @@ processCallDispatchStream(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
thecall->mode = REMOTE_MODE_ERROR;
|
thecall->mode = REMOTE_MODE_ERROR;
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("Got a asynchronous error");
|
VIR_DEBUG("Got a asynchronous error");
|
||||||
/* No call, so queue the error against the stream */
|
/* No call, so queue the error against the stream */
|
||||||
if (privst->has_error) {
|
if (privst->has_error) {
|
||||||
VIR_DEBUG0("Got unexpected duplicate stream error");
|
VIR_DEBUG("Got unexpected duplicate stream error");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
privst->has_error = 1;
|
privst->has_error = 1;
|
||||||
memset (&privst->err, 0, sizeof privst->err);
|
memset (&privst->err, 0, sizeof privst->err);
|
||||||
if (!xdr_remote_error (xdr, &privst->err)) {
|
if (!xdr_remote_error (xdr, &privst->err)) {
|
||||||
VIR_DEBUG0("Failed to unmarshall error");
|
VIR_DEBUG("Failed to unmarshall error");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5818,7 +5818,7 @@ remoteIOEventLoop(virConnectPtr conn,
|
|||||||
|
|
||||||
if (fds[1].revents) {
|
if (fds[1].revents) {
|
||||||
ssize_t s;
|
ssize_t s;
|
||||||
VIR_DEBUG0("Woken up from poll by other thread");
|
VIR_DEBUG("Woken up from poll by other thread");
|
||||||
s = saferead(priv->wakeupReadFD, &ignore, sizeof(ignore));
|
s = saferead(priv->wakeupReadFD, &ignore, sizeof(ignore));
|
||||||
if (s < 0) {
|
if (s < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
@ -6204,7 +6204,7 @@ remoteDomainEventFired(int watch,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (remoteIOHandleInput(conn, priv, 0) < 0)
|
if (remoteIOHandleInput(conn, priv, 0) < 0)
|
||||||
VIR_DEBUG0("Something went wrong during async message processing");
|
VIR_DEBUG("Something went wrong during async message processing");
|
||||||
|
|
||||||
done:
|
done:
|
||||||
remoteDriverUnlock(priv);
|
remoteDriverUnlock(priv);
|
||||||
|
@ -1021,7 +1021,7 @@ secretDriverStartup(int privileged)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_of_memory:
|
out_of_memory:
|
||||||
VIR_ERROR0(_("Out of memory initializing secrets"));
|
VIR_ERROR(_("Out of memory initializing secrets"));
|
||||||
error:
|
error:
|
||||||
VIR_FREE(base);
|
VIR_FREE(base);
|
||||||
secretDriverUnlock(driverState);
|
secretDriverUnlock(driverState);
|
||||||
|
@ -332,7 +332,7 @@ virStorageBackendLogicalFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
* worst that happens is that scanning doesn't pick everything up
|
* worst that happens is that scanning doesn't pick everything up
|
||||||
*/
|
*/
|
||||||
if (virRun(scanprog, &exitstatus) < 0) {
|
if (virRun(scanprog, &exitstatus) < 0) {
|
||||||
VIR_WARN0("Failure when running vgscan to refresh physical volumes");
|
VIR_WARN("Failure when running vgscan to refresh physical volumes");
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&sourceList, 0, sizeof(sourceList));
|
memset(&sourceList, 0, sizeof(sourceList));
|
||||||
|
@ -1164,7 +1164,7 @@ static virDrvOpenStatus testOpen(virConnectPtr conn,
|
|||||||
|
|
||||||
if ((privconn->domainEventTimer =
|
if ((privconn->domainEventTimer =
|
||||||
virEventAddTimeout(-1, testDomainEventFlush, privconn, NULL)) < 0)
|
virEventAddTimeout(-1, testDomainEventFlush, privconn, NULL)) < 0)
|
||||||
VIR_DEBUG0("virEventAddTimeout failed: No addTimeoutImpl defined. "
|
VIR_DEBUG("virEventAddTimeout failed: No addTimeoutImpl defined. "
|
||||||
"continuing without events.");
|
"continuing without events.");
|
||||||
testDriverUnlock(privconn);
|
testDriverUnlock(privconn);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ virCapsPtr umlCapsInit(void) {
|
|||||||
*/
|
*/
|
||||||
if (nodeCapsInitNUMA(caps) < 0) {
|
if (nodeCapsInitNUMA(caps) < 0) {
|
||||||
virCapabilitiesFreeNUMAInfo(caps);
|
virCapabilitiesFreeNUMAInfo(caps);
|
||||||
VIR_WARN0("Failed to query host NUMA topology, disabling NUMA capabilities");
|
VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virGetHostUUID(caps->host.host_uuid)) {
|
if (virGetHostUUID(caps->host.host_uuid)) {
|
||||||
|
@ -123,7 +123,7 @@ static int umlSetCloseExec(int fd) {
|
|||||||
goto error;
|
goto error;
|
||||||
return 0;
|
return 0;
|
||||||
error:
|
error:
|
||||||
VIR_ERROR0(_("Failed to set close-on-exec file descriptor flag"));
|
VIR_ERROR(_("Failed to set close-on-exec file descriptor flag"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,10 +322,10 @@ reread:
|
|||||||
dom->state = VIR_DOMAIN_RUNNING;
|
dom->state = VIR_DOMAIN_RUNNING;
|
||||||
|
|
||||||
if (umlOpenMonitor(driver, dom) < 0) {
|
if (umlOpenMonitor(driver, dom) < 0) {
|
||||||
VIR_WARN0("Could not open monitor for new domain");
|
VIR_WARN("Could not open monitor for new domain");
|
||||||
umlShutdownVMDaemon(NULL, driver, dom);
|
umlShutdownVMDaemon(NULL, driver, dom);
|
||||||
} else if (umlIdentifyChrPTY(driver, dom) < 0) {
|
} else if (umlIdentifyChrPTY(driver, dom) < 0) {
|
||||||
VIR_WARN0("Could not identify charater devices for new domain");
|
VIR_WARN("Could not identify charater devices for new domain");
|
||||||
umlShutdownVMDaemon(NULL, driver, dom);
|
umlShutdownVMDaemon(NULL, driver, dom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -413,7 +413,7 @@ umlStartup(int privileged)
|
|||||||
uml_driver->caps->privateDataFreeFunc = umlDomainObjPrivateFree;
|
uml_driver->caps->privateDataFreeFunc = umlDomainObjPrivateFree;
|
||||||
|
|
||||||
if ((uml_driver->inotifyFD = inotify_init()) < 0) {
|
if ((uml_driver->inotifyFD = inotify_init()) < 0) {
|
||||||
VIR_ERROR0(_("cannot initialize inotify"));
|
VIR_ERROR(_("cannot initialize inotify"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ umlStartup(int privileged)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_of_memory:
|
out_of_memory:
|
||||||
VIR_ERROR0(_("umlStartup: out of memory"));
|
VIR_ERROR(_("umlStartup: out of memory"));
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(userdir);
|
VIR_FREE(userdir);
|
||||||
@ -782,7 +782,7 @@ static int umlCleanupTapDevices(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
int err;
|
int err;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
brControl *brctl = NULL;
|
brControl *brctl = NULL;
|
||||||
VIR_ERROR0(_("Cleanup tap"));
|
VIR_ERROR(_("Cleanup tap"));
|
||||||
if (brInit(&brctl) < 0)
|
if (brInit(&brctl) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -800,7 +800,7 @@ static int umlCleanupTapDevices(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VIR_ERROR0(_("Cleanup tap done"));
|
VIR_ERROR(_("Cleanup tap done"));
|
||||||
brShutdown(brctl);
|
brShutdown(brctl);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -428,13 +428,13 @@ brProbeVnetHdr(int tapfd)
|
|||||||
struct ifreq dummy;
|
struct ifreq dummy;
|
||||||
|
|
||||||
if (ioctl(tapfd, TUNGETFEATURES, &features) != 0) {
|
if (ioctl(tapfd, TUNGETFEATURES, &features) != 0) {
|
||||||
VIR_INFO0(_("Not enabling IFF_VNET_HDR; "
|
VIR_INFO(_("Not enabling IFF_VNET_HDR; "
|
||||||
"TUNGETFEATURES ioctl() not implemented"));
|
"TUNGETFEATURES ioctl() not implemented"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(features & IFF_VNET_HDR)) {
|
if (!(features & IFF_VNET_HDR)) {
|
||||||
VIR_INFO0(_("Not enabling IFF_VNET_HDR; "
|
VIR_INFO(_("Not enabling IFF_VNET_HDR; "
|
||||||
"TUNGETFEATURES ioctl() reports no IFF_VNET_HDR"));
|
"TUNGETFEATURES ioctl() reports no IFF_VNET_HDR"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -443,17 +443,17 @@ brProbeVnetHdr(int tapfd)
|
|||||||
* If TUNGETIFF is not implemented then errno == EBADFD.
|
* If TUNGETIFF is not implemented then errno == EBADFD.
|
||||||
*/
|
*/
|
||||||
if (ioctl(tapfd, TUNGETIFF, &dummy) != -1 || errno != EBADFD) {
|
if (ioctl(tapfd, TUNGETIFF, &dummy) != -1 || errno != EBADFD) {
|
||||||
VIR_INFO0(_("Not enabling IFF_VNET_HDR; "
|
VIR_INFO(_("Not enabling IFF_VNET_HDR; "
|
||||||
"TUNGETIFF ioctl() not implemented"));
|
"TUNGETIFF ioctl() not implemented"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_INFO0(_("Enabling IFF_VNET_HDR"));
|
VIR_INFO(_("Enabling IFF_VNET_HDR"));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
# else
|
# else
|
||||||
(void) tapfd;
|
(void) tapfd;
|
||||||
VIR_INFO0(_("Not enabling IFF_VNET_HDR; disabled at build time"));
|
VIR_INFO(_("Not enabling IFF_VNET_HDR; disabled at build time"));
|
||||||
return 0;
|
return 0;
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ static int virCgroupDetectMounts(virCgroupPtr group)
|
|||||||
|
|
||||||
mounts = fopen("/proc/mounts", "r");
|
mounts = fopen("/proc/mounts", "r");
|
||||||
if (mounts == NULL) {
|
if (mounts == NULL) {
|
||||||
VIR_ERROR0(_("Unable to open /proc/mounts"));
|
VIR_ERROR(_("Unable to open /proc/mounts"));
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ static int virCgroupDetectPlacement(virCgroupPtr group)
|
|||||||
|
|
||||||
mapping = fopen("/proc/self/cgroup", "r");
|
mapping = fopen("/proc/self/cgroup", "r");
|
||||||
if (mapping == NULL) {
|
if (mapping == NULL) {
|
||||||
VIR_ERROR0(_("Unable to open /proc/self/cgroup"));
|
VIR_ERROR(_("Unable to open /proc/self/cgroup"));
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,7 +572,7 @@ virCommandSetWorkingDirectory(virCommandPtr cmd, const char *pwd)
|
|||||||
|
|
||||||
if (cmd->pwd) {
|
if (cmd->pwd) {
|
||||||
cmd->has_error = -1;
|
cmd->has_error = -1;
|
||||||
VIR_DEBUG0("cannot set directory twice");
|
VIR_DEBUG("cannot set directory twice");
|
||||||
} else {
|
} else {
|
||||||
cmd->pwd = strdup(pwd);
|
cmd->pwd = strdup(pwd);
|
||||||
if (!cmd->pwd)
|
if (!cmd->pwd)
|
||||||
@ -592,7 +592,7 @@ virCommandSetInputBuffer(virCommandPtr cmd, const char *inbuf)
|
|||||||
|
|
||||||
if (cmd->infd != -1 || cmd->inbuf) {
|
if (cmd->infd != -1 || cmd->inbuf) {
|
||||||
cmd->has_error = -1;
|
cmd->has_error = -1;
|
||||||
VIR_DEBUG0("cannot specify input twice");
|
VIR_DEBUG("cannot specify input twice");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -617,7 +617,7 @@ virCommandSetOutputBuffer(virCommandPtr cmd, char **outbuf)
|
|||||||
|
|
||||||
if (cmd->outfdptr) {
|
if (cmd->outfdptr) {
|
||||||
cmd->has_error = -1;
|
cmd->has_error = -1;
|
||||||
VIR_DEBUG0("cannot specify output twice");
|
VIR_DEBUG("cannot specify output twice");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ virCommandSetErrorBuffer(virCommandPtr cmd, char **errbuf)
|
|||||||
|
|
||||||
if (cmd->errfdptr) {
|
if (cmd->errfdptr) {
|
||||||
cmd->has_error = -1;
|
cmd->has_error = -1;
|
||||||
VIR_DEBUG0("cannot specify stderr twice");
|
VIR_DEBUG("cannot specify stderr twice");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,12 +661,12 @@ virCommandSetInputFD(virCommandPtr cmd, int infd)
|
|||||||
|
|
||||||
if (cmd->infd != -1 || cmd->inbuf) {
|
if (cmd->infd != -1 || cmd->inbuf) {
|
||||||
cmd->has_error = -1;
|
cmd->has_error = -1;
|
||||||
VIR_DEBUG0("cannot specify input twice");
|
VIR_DEBUG("cannot specify input twice");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (infd < 0) {
|
if (infd < 0) {
|
||||||
cmd->has_error = -1;
|
cmd->has_error = -1;
|
||||||
VIR_DEBUG0("cannot specify invalid input fd");
|
VIR_DEBUG("cannot specify invalid input fd");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -685,7 +685,7 @@ virCommandSetOutputFD(virCommandPtr cmd, int *outfd)
|
|||||||
|
|
||||||
if (cmd->outfdptr) {
|
if (cmd->outfdptr) {
|
||||||
cmd->has_error = -1;
|
cmd->has_error = -1;
|
||||||
VIR_DEBUG0("cannot specify output twice");
|
VIR_DEBUG("cannot specify output twice");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,7 +704,7 @@ virCommandSetErrorFD(virCommandPtr cmd, int *errfd)
|
|||||||
|
|
||||||
if (cmd->errfdptr) {
|
if (cmd->errfdptr) {
|
||||||
cmd->has_error = -1;
|
cmd->has_error = -1;
|
||||||
VIR_DEBUG0("cannot specify stderr twice");
|
VIR_DEBUG("cannot specify stderr twice");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -725,7 +725,7 @@ virCommandSetPreExecHook(virCommandPtr cmd, virExecHook hook, void *opaque)
|
|||||||
|
|
||||||
if (cmd->hook) {
|
if (cmd->hook) {
|
||||||
cmd->has_error = -1;
|
cmd->has_error = -1;
|
||||||
VIR_DEBUG0("cannot specify hook twice");
|
VIR_DEBUG("cannot specify hook twice");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cmd->hook = hook;
|
cmd->hook = hook;
|
||||||
|
@ -145,7 +145,7 @@ void virEventRegisterImpl(virEventAddHandleFunc addHandle,
|
|||||||
*/
|
*/
|
||||||
int virEventRegisterDefaultImpl(void)
|
int virEventRegisterDefaultImpl(void)
|
||||||
{
|
{
|
||||||
VIR_DEBUG0("");
|
VIR_DEBUG("registering default event implementation");
|
||||||
|
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ int virEventRegisterDefaultImpl(void)
|
|||||||
*/
|
*/
|
||||||
int virEventRunDefaultImpl(void)
|
int virEventRunDefaultImpl(void)
|
||||||
{
|
{
|
||||||
VIR_DEBUG0("");
|
VIR_DEBUG("running default event implementation");
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
|
|
||||||
if (virEventPollRunOnce() < 0) {
|
if (virEventPollRunOnce() < 0) {
|
||||||
|
@ -687,7 +687,7 @@ static int virEventPollInterruptLocked(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Interrupting");
|
VIR_DEBUG("Interrupting");
|
||||||
if (safewrite(eventLoop.wakeupfd[1], &c, sizeof(c)) != sizeof(c))
|
if (safewrite(eventLoop.wakeupfd[1], &c, sizeof(c)) != sizeof(c))
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#define virHashIterationError(ret) \
|
#define virHashIterationError(ret) \
|
||||||
do { \
|
do { \
|
||||||
VIR_ERROR0(_("Hash operation not allowed during iteration")); \
|
VIR_ERROR(_("Hash operation not allowed during iteration")); \
|
||||||
return ret; \
|
return ret; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ static int virJSONParserInsertValue(virJSONParserPtr parser,
|
|||||||
} else {
|
} else {
|
||||||
virJSONParserStatePtr state;
|
virJSONParserStatePtr state;
|
||||||
if (!parser->nstate) {
|
if (!parser->nstate) {
|
||||||
VIR_DEBUG0("got a value to insert without a container");
|
VIR_DEBUG("got a value to insert without a container");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -647,7 +647,7 @@ static int virJSONParserInsertValue(virJSONParserPtr parser,
|
|||||||
switch (state->value->type) {
|
switch (state->value->type) {
|
||||||
case VIR_JSON_TYPE_OBJECT: {
|
case VIR_JSON_TYPE_OBJECT: {
|
||||||
if (!state->key) {
|
if (!state->key) {
|
||||||
VIR_DEBUG0("missing key when inserting object value");
|
VIR_DEBUG("missing key when inserting object value");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,7 +661,7 @@ static int virJSONParserInsertValue(virJSONParserPtr parser,
|
|||||||
|
|
||||||
case VIR_JSON_TYPE_ARRAY: {
|
case VIR_JSON_TYPE_ARRAY: {
|
||||||
if (state->key) {
|
if (state->key) {
|
||||||
VIR_DEBUG0("unexpected key when inserting array value");
|
VIR_DEBUG("unexpected key when inserting array value");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -671,7 +671,7 @@ static int virJSONParserInsertValue(virJSONParserPtr parser,
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
VIR_DEBUG0("unexpected value type, not a container");
|
VIR_DEBUG("unexpected value type, not a container");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ int virLogStartup(void) {
|
|||||||
virLogDefaultPriority = VIR_LOG_DEFAULT;
|
virLogDefaultPriority = VIR_LOG_DEFAULT;
|
||||||
virLogUnlock();
|
virLogUnlock();
|
||||||
if (pbm)
|
if (pbm)
|
||||||
VIR_WARN0(pbm);
|
VIR_WARN("%s", pbm);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -478,7 +478,7 @@ virLogEmergencyDumpAll(int signum) {
|
|||||||
*/
|
*/
|
||||||
int virLogSetDefaultPriority(int priority) {
|
int virLogSetDefaultPriority(int priority) {
|
||||||
if ((priority < VIR_LOG_DEBUG) || (priority > VIR_LOG_ERROR)) {
|
if ((priority < VIR_LOG_DEBUG) || (priority > VIR_LOG_ERROR)) {
|
||||||
VIR_WARN0("Ignoring invalid log level setting.");
|
VIR_WARN("Ignoring invalid log level setting.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!virLogInitialized)
|
if (!virLogInitialized)
|
||||||
@ -1007,7 +1007,7 @@ int virLogParseOutputs(const char *outputs) {
|
|||||||
ret = count;
|
ret = count;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
VIR_WARN0("Ignoring invalid log output setting.");
|
VIR_WARN("Ignoring invalid log output setting.");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1063,7 +1063,7 @@ int virLogParseFilters(const char *filters) {
|
|||||||
ret = count;
|
ret = count;
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
VIR_WARN0("Ignoring invalid log filter setting.");
|
VIR_WARN("Ignoring invalid log filter setting.");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1185,7 +1185,7 @@ int virLogParseDefaultPriority(const char *priority) {
|
|||||||
else if (STREQ(priority, "4") || STREQ(priority, "error"))
|
else if (STREQ(priority, "4") || STREQ(priority, "error"))
|
||||||
ret = virLogSetDefaultPriority(VIR_LOG_ERROR);
|
ret = virLogSetDefaultPriority(VIR_LOG_ERROR);
|
||||||
else
|
else
|
||||||
VIR_WARN0("Ignoring invalid log level setting");
|
VIR_WARN("Ignoring invalid log level setting");
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -32,35 +32,27 @@
|
|||||||
*/
|
*/
|
||||||
# ifdef ENABLE_DEBUG
|
# ifdef ENABLE_DEBUG
|
||||||
# define VIR_DEBUG_INT(category, f, l, fmt,...) \
|
# define VIR_DEBUG_INT(category, f, l, fmt,...) \
|
||||||
virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, fmt, __VA_ARGS__)
|
virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, fmt, ##__VA_ARGS__)
|
||||||
# else
|
# else
|
||||||
# define VIR_DEBUG_INT(category, f, l, fmt,...) \
|
# define VIR_DEBUG_INT(category, f, l, fmt,...) \
|
||||||
do { } while (0)
|
do { } while (0)
|
||||||
# endif /* !ENABLE_DEBUG */
|
# endif /* !ENABLE_DEBUG */
|
||||||
|
|
||||||
# define VIR_INFO_INT(category, f, l, fmt,...) \
|
# define VIR_INFO_INT(category, f, l, fmt,...) \
|
||||||
virLogMessage(category, VIR_LOG_INFO, f, l, 0, fmt, __VA_ARGS__)
|
virLogMessage(category, VIR_LOG_INFO, f, l, 0, fmt, ##__VA_ARGS__)
|
||||||
# define VIR_WARN_INT(category, f, l, fmt,...) \
|
# define VIR_WARN_INT(category, f, l, fmt,...) \
|
||||||
virLogMessage(category, VIR_LOG_WARN, f, l, 0, fmt, __VA_ARGS__)
|
virLogMessage(category, VIR_LOG_WARN, f, l, 0, fmt, ##__VA_ARGS__)
|
||||||
# define VIR_ERROR_INT(category, f, l, fmt,...) \
|
# define VIR_ERROR_INT(category, f, l, fmt,...) \
|
||||||
virLogMessage(category, VIR_LOG_ERROR, f, l, 0, fmt, __VA_ARGS__)
|
virLogMessage(category, VIR_LOG_ERROR, f, l, 0, fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
# define VIR_DEBUG(fmt,...) \
|
# define VIR_DEBUG(fmt,...) \
|
||||||
VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
|
VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
|
||||||
# define VIR_DEBUG0(msg) \
|
|
||||||
VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
|
|
||||||
# define VIR_INFO(fmt,...) \
|
# define VIR_INFO(fmt,...) \
|
||||||
VIR_INFO_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
|
VIR_INFO_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
|
||||||
# define VIR_INFO0(msg) \
|
|
||||||
VIR_INFO_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
|
|
||||||
# define VIR_WARN(fmt,...) \
|
# define VIR_WARN(fmt,...) \
|
||||||
VIR_WARN_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
|
VIR_WARN_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
|
||||||
# define VIR_WARN0(msg) \
|
|
||||||
VIR_WARN_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
|
|
||||||
# define VIR_ERROR(fmt,...) \
|
# define VIR_ERROR(fmt,...) \
|
||||||
VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
|
VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
|
||||||
# define VIR_ERROR0(msg) \
|
|
||||||
VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To be made public
|
* To be made public
|
||||||
|
@ -293,7 +293,7 @@ pciIterDevices(pciIterPredicate predicate,
|
|||||||
|
|
||||||
dir = opendir(PCI_SYSFS "devices");
|
dir = opendir(PCI_SYSFS "devices");
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
VIR_WARN0("Failed to open " PCI_SYSFS "devices");
|
VIR_WARN("Failed to open " PCI_SYSFS "devices");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1195,7 +1195,7 @@ pciWaitForDeviceCleanup(pciDevice *dev, const char *matcher)
|
|||||||
* unbind might succeed anyway, and besides, it's very likely we have
|
* unbind might succeed anyway, and besides, it's very likely we have
|
||||||
* no way to report the error
|
* no way to report the error
|
||||||
*/
|
*/
|
||||||
VIR_DEBUG0("Failed to open /proc/iomem, trying to continue anyway");
|
VIR_DEBUG("Failed to open /proc/iomem, trying to continue anyway");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ static int virClearCapabilities(void)
|
|||||||
# else
|
# else
|
||||||
static int virClearCapabilities(void)
|
static int virClearCapabilities(void)
|
||||||
{
|
{
|
||||||
// VIR_WARN0("libcap-ng support not compiled in, unable to clear capabilities");
|
// VIR_WARN("libcap-ng support not compiled in, unable to clear capabilities");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
@ -682,7 +682,7 @@ __virExec(const char *const*argv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((hook)(data) != 0) {
|
if ((hook)(data) != 0) {
|
||||||
VIR_DEBUG0("Hook function failed.");
|
VIR_DEBUG("Hook function failed.");
|
||||||
goto fork_error;
|
goto fork_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -761,7 +761,7 @@ virExecWithHook(const char *const*argv,
|
|||||||
VIR_DEBUG("%s %s", envp_str, argv_str);
|
VIR_DEBUG("%s %s", envp_str, argv_str);
|
||||||
VIR_FREE(envp_str);
|
VIR_FREE(envp_str);
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0(argv_str);
|
VIR_DEBUG("%s", argv_str);
|
||||||
}
|
}
|
||||||
VIR_FREE(argv_str);
|
VIR_FREE(argv_str);
|
||||||
|
|
||||||
@ -871,7 +871,7 @@ virRunWithHook(const char *const*argv,
|
|||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
VIR_DEBUG0(argv_str);
|
VIR_DEBUG("%s", argv_str);
|
||||||
|
|
||||||
if ((execret = __virExec(argv, NULL, NULL,
|
if ((execret = __virExec(argv, NULL, NULL,
|
||||||
&childpid, -1, &outfd, &errfd,
|
&childpid, -1, &outfd, &errfd,
|
||||||
|
@ -96,7 +96,7 @@ void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func,
|
|||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
if (virVasprintf(&str, fmt, args) < 0) {
|
if (virVasprintf(&str, fmt, args) < 0) {
|
||||||
VIR_WARN0("Out of memory while formatting audit message");
|
VIR_WARN("Out of memory while formatting audit message");
|
||||||
str = NULL;
|
str = NULL;
|
||||||
}
|
}
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
@ -98,36 +98,36 @@ int vboxRegister(void) {
|
|||||||
* number 51, thus the version ranges in the if statements below.
|
* number 51, thus the version ranges in the if statements below.
|
||||||
*/
|
*/
|
||||||
if (uVersion >= 2001052 && uVersion < 2002051) {
|
if (uVersion >= 2001052 && uVersion < 2002051) {
|
||||||
VIR_DEBUG0("VirtualBox API version: 2.2");
|
VIR_DEBUG("VirtualBox API version: 2.2");
|
||||||
driver = &vbox22Driver;
|
driver = &vbox22Driver;
|
||||||
networkDriver = &vbox22NetworkDriver;
|
networkDriver = &vbox22NetworkDriver;
|
||||||
storageDriver = &vbox22StorageDriver;
|
storageDriver = &vbox22StorageDriver;
|
||||||
} else if (uVersion >= 2002051 && uVersion < 3000051) {
|
} else if (uVersion >= 2002051 && uVersion < 3000051) {
|
||||||
VIR_DEBUG0("VirtualBox API version: 3.0");
|
VIR_DEBUG("VirtualBox API version: 3.0");
|
||||||
driver = &vbox30Driver;
|
driver = &vbox30Driver;
|
||||||
networkDriver = &vbox30NetworkDriver;
|
networkDriver = &vbox30NetworkDriver;
|
||||||
storageDriver = &vbox30StorageDriver;
|
storageDriver = &vbox30StorageDriver;
|
||||||
} else if (uVersion >= 3000051 && uVersion < 3001051) {
|
} else if (uVersion >= 3000051 && uVersion < 3001051) {
|
||||||
VIR_DEBUG0("VirtualBox API version: 3.1");
|
VIR_DEBUG("VirtualBox API version: 3.1");
|
||||||
driver = &vbox31Driver;
|
driver = &vbox31Driver;
|
||||||
networkDriver = &vbox31NetworkDriver;
|
networkDriver = &vbox31NetworkDriver;
|
||||||
storageDriver = &vbox31StorageDriver;
|
storageDriver = &vbox31StorageDriver;
|
||||||
} else if (uVersion >= 3001051 && uVersion < 3002051) {
|
} else if (uVersion >= 3001051 && uVersion < 3002051) {
|
||||||
VIR_DEBUG0("VirtualBox API version: 3.2");
|
VIR_DEBUG("VirtualBox API version: 3.2");
|
||||||
driver = &vbox32Driver;
|
driver = &vbox32Driver;
|
||||||
networkDriver = &vbox32NetworkDriver;
|
networkDriver = &vbox32NetworkDriver;
|
||||||
storageDriver = &vbox32StorageDriver;
|
storageDriver = &vbox32StorageDriver;
|
||||||
} else if (uVersion >= 3002051 && uVersion < 4000051) {
|
} else if (uVersion >= 3002051 && uVersion < 4000051) {
|
||||||
VIR_DEBUG0("VirtualBox API version: 4.0");
|
VIR_DEBUG("VirtualBox API version: 4.0");
|
||||||
driver = &vbox40Driver;
|
driver = &vbox40Driver;
|
||||||
networkDriver = &vbox40NetworkDriver;
|
networkDriver = &vbox40NetworkDriver;
|
||||||
storageDriver = &vbox40StorageDriver;
|
storageDriver = &vbox40StorageDriver;
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("Unsupport VirtualBox API version");
|
VIR_DEBUG("Unsupport VirtualBox API version");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("VBoxCGlueInit failed, using dummy driver");
|
VIR_DEBUG("VBoxCGlueInit failed, using dummy driver");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virRegisterDriver(driver) < 0)
|
if (virRegisterDriver(driver) < 0)
|
||||||
|
@ -1026,7 +1026,7 @@ static virDrvOpenStatus vboxOpen(virConnectPtr conn,
|
|||||||
#endif /* !(VBOX_API_VERSION == 2002) */
|
#endif /* !(VBOX_API_VERSION == 2002) */
|
||||||
|
|
||||||
conn->privateData = data;
|
conn->privateData = data;
|
||||||
VIR_DEBUG0("in vboxOpen");
|
VIR_DEBUG("in vboxOpen");
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
return VIR_DRV_OPEN_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -3733,15 +3733,15 @@ vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
|
|||||||
if (def->disks[i]->readonly) {
|
if (def->disks[i]->readonly) {
|
||||||
hardDisk->vtbl->SetType(hardDisk,
|
hardDisk->vtbl->SetType(hardDisk,
|
||||||
HardDiskType_Immutable);
|
HardDiskType_Immutable);
|
||||||
VIR_DEBUG0("setting harddisk to readonly");
|
VIR_DEBUG("setting harddisk to readonly");
|
||||||
} else if (!def->disks[i]->readonly) {
|
} else if (!def->disks[i]->readonly) {
|
||||||
hardDisk->vtbl->SetType(hardDisk,
|
hardDisk->vtbl->SetType(hardDisk,
|
||||||
HardDiskType_Normal);
|
HardDiskType_Normal);
|
||||||
VIR_DEBUG0("setting harddisk type to normal");
|
VIR_DEBUG("setting harddisk type to normal");
|
||||||
}
|
}
|
||||||
if (def->disks[i]->bus == VIR_DOMAIN_DISK_BUS_IDE) {
|
if (def->disks[i]->bus == VIR_DOMAIN_DISK_BUS_IDE) {
|
||||||
if (STREQ(def->disks[i]->dst, "hdc")) {
|
if (STREQ(def->disks[i]->dst, "hdc")) {
|
||||||
VIR_DEBUG0("Not connecting harddisk to hdc as hdc"
|
VIR_DEBUG("Not connecting harddisk to hdc as hdc"
|
||||||
" is taken by CD/DVD Drive");
|
" is taken by CD/DVD Drive");
|
||||||
} else {
|
} else {
|
||||||
PRInt32 channel = 0;
|
PRInt32 channel = 0;
|
||||||
@ -4021,10 +4021,10 @@ vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
|
|||||||
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
|
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
|
||||||
if (def->disks[i]->readonly) {
|
if (def->disks[i]->readonly) {
|
||||||
medium->vtbl->SetType(medium, MediumType_Immutable);
|
medium->vtbl->SetType(medium, MediumType_Immutable);
|
||||||
VIR_DEBUG0("setting harddisk to immutable");
|
VIR_DEBUG("setting harddisk to immutable");
|
||||||
} else if (!def->disks[i]->readonly) {
|
} else if (!def->disks[i]->readonly) {
|
||||||
medium->vtbl->SetType(medium, MediumType_Normal);
|
medium->vtbl->SetType(medium, MediumType_Normal);
|
||||||
VIR_DEBUG0("setting harddisk type to normal");
|
VIR_DEBUG("setting harddisk type to normal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4450,7 +4450,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
|
|||||||
#endif /* VBOX_API_VERSION >= 4000 */
|
#endif /* VBOX_API_VERSION >= 4000 */
|
||||||
if (VRDxServer) {
|
if (VRDxServer) {
|
||||||
VRDxServer->vtbl->SetEnabled(VRDxServer, PR_TRUE);
|
VRDxServer->vtbl->SetEnabled(VRDxServer, PR_TRUE);
|
||||||
VIR_DEBUG0("VRDP Support turned ON.");
|
VIR_DEBUG("VRDP Support turned ON.");
|
||||||
|
|
||||||
#if VBOX_API_VERSION < 3001
|
#if VBOX_API_VERSION < 3001
|
||||||
if (def->graphics[i]->data.rdp.port) {
|
if (def->graphics[i]->data.rdp.port) {
|
||||||
@ -4463,7 +4463,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
|
|||||||
* the default one which is 3389 currently
|
* the default one which is 3389 currently
|
||||||
*/
|
*/
|
||||||
VRDxServer->vtbl->SetPort(VRDxServer, 0);
|
VRDxServer->vtbl->SetPort(VRDxServer, 0);
|
||||||
VIR_DEBUG0("VRDP Port changed to default, which is 3389 currently");
|
VIR_DEBUG("VRDP Port changed to default, which is 3389 currently");
|
||||||
}
|
}
|
||||||
#elif VBOX_API_VERSION < 4000 /* 3001 <= VBOX_API_VERSION < 4000 */
|
#elif VBOX_API_VERSION < 4000 /* 3001 <= VBOX_API_VERSION < 4000 */
|
||||||
PRUnichar *portUtf16 = NULL;
|
PRUnichar *portUtf16 = NULL;
|
||||||
@ -4484,13 +4484,13 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
|
|||||||
if (def->graphics[i]->data.rdp.replaceUser) {
|
if (def->graphics[i]->data.rdp.replaceUser) {
|
||||||
VRDxServer->vtbl->SetReuseSingleConnection(VRDxServer,
|
VRDxServer->vtbl->SetReuseSingleConnection(VRDxServer,
|
||||||
PR_TRUE);
|
PR_TRUE);
|
||||||
VIR_DEBUG0("VRDP set to reuse single connection");
|
VIR_DEBUG("VRDP set to reuse single connection");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->graphics[i]->data.rdp.multiUser) {
|
if (def->graphics[i]->data.rdp.multiUser) {
|
||||||
VRDxServer->vtbl->SetAllowMultiConnection(VRDxServer,
|
VRDxServer->vtbl->SetAllowMultiConnection(VRDxServer,
|
||||||
PR_TRUE);
|
PR_TRUE);
|
||||||
VIR_DEBUG0("VRDP set to allow multiple connection");
|
VIR_DEBUG("VRDP set to allow multiple connection");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->graphics[i]->data.rdp.listenAddr) {
|
if (def->graphics[i]->data.rdp.listenAddr) {
|
||||||
@ -6885,7 +6885,7 @@ static virDrvOpenStatus vboxNetworkOpen(virConnectPtr conn,
|
|||||||
(data->vboxSession == NULL))
|
(data->vboxSession == NULL))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG0("network initialized");
|
VIR_DEBUG("network initialized");
|
||||||
/* conn->networkPrivateData = some network specific data */
|
/* conn->networkPrivateData = some network specific data */
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
return VIR_DRV_OPEN_SUCCESS;
|
||||||
|
|
||||||
@ -6894,7 +6894,7 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int vboxNetworkClose(virConnectPtr conn) {
|
static int vboxNetworkClose(virConnectPtr conn) {
|
||||||
VIR_DEBUG0("network uninitialized");
|
VIR_DEBUG("network uninitialized");
|
||||||
conn->networkPrivateData = NULL;
|
conn->networkPrivateData = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -7239,7 +7239,7 @@ static virNetworkPtr vboxNetworkDefineCreateXML(virConnectPtr conn, const char *
|
|||||||
data->vboxObj->vtbl->CreateDHCPServer(data->vboxObj,
|
data->vboxObj->vtbl->CreateDHCPServer(data->vboxObj,
|
||||||
networkNameUtf16,
|
networkNameUtf16,
|
||||||
&dhcpServer);
|
&dhcpServer);
|
||||||
VIR_DEBUG0("couldn't find dhcp server so creating one");
|
VIR_DEBUG("couldn't find dhcp server so creating one");
|
||||||
}
|
}
|
||||||
if (dhcpServer) {
|
if (dhcpServer) {
|
||||||
PRUnichar *ipAddressUtf16 = NULL;
|
PRUnichar *ipAddressUtf16 = NULL;
|
||||||
@ -7696,7 +7696,7 @@ static virDrvOpenStatus vboxStorageOpen (virConnectPtr conn,
|
|||||||
(data->vboxSession == NULL))
|
(data->vboxSession == NULL))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG0("vbox storage initialized");
|
VIR_DEBUG("vbox storage initialized");
|
||||||
/* conn->storagePrivateData = some storage specific data */
|
/* conn->storagePrivateData = some storage specific data */
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
return VIR_DRV_OPEN_SUCCESS;
|
||||||
|
|
||||||
@ -7705,7 +7705,7 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int vboxStorageClose (virConnectPtr conn) {
|
static int vboxStorageClose (virConnectPtr conn) {
|
||||||
VIR_DEBUG0("vbox storage uninitialized");
|
VIR_DEBUG("vbox storage uninitialized");
|
||||||
conn->storagePrivateData = NULL;
|
conn->storagePrivateData = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -8245,7 +8245,7 @@ static int vboxStorageVolDelete(virStorageVolPtr vol,
|
|||||||
#endif /* VBOX_API_VERSION >= 3001 */
|
#endif /* VBOX_API_VERSION >= 3001 */
|
||||||
if (NS_SUCCEEDED(rc)) {
|
if (NS_SUCCEEDED(rc)) {
|
||||||
rc = machine->vtbl->SaveSettings(machine);
|
rc = machine->vtbl->SaveSettings(machine);
|
||||||
VIR_DEBUG0("saving machine settings");
|
VIR_DEBUG("saving machine settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rc)) {
|
if (NS_SUCCEEDED(rc)) {
|
||||||
|
@ -1789,7 +1789,7 @@ virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (port < 0) {
|
if (port < 0) {
|
||||||
VIR_WARN0("VNC is enabled but VMX entry 'RemoteDisplay.vnc.port' "
|
VIR_WARN("VNC is enabled but VMX entry 'RemoteDisplay.vnc.port' "
|
||||||
"is missing, the VNC port is unknown");
|
"is missing, the VNC port is unknown");
|
||||||
|
|
||||||
(*def)->data.vnc.port = 0;
|
(*def)->data.vnc.port = 0;
|
||||||
@ -3204,7 +3204,7 @@ virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer)
|
|||||||
virBufferAsprintf(buffer, "RemoteDisplay.vnc.enabled = \"true\"\n");
|
virBufferAsprintf(buffer, "RemoteDisplay.vnc.enabled = \"true\"\n");
|
||||||
|
|
||||||
if (def->data.vnc.autoport) {
|
if (def->data.vnc.autoport) {
|
||||||
VIR_WARN0("VNC autoport is enabled, but the automatically assigned "
|
VIR_WARN("VNC autoport is enabled, but the automatically assigned "
|
||||||
"VNC port cannot be read back");
|
"VNC port cannot be read back");
|
||||||
} else {
|
} else {
|
||||||
if (def->data.vnc.port < 5900 || def->data.vnc.port > 5964) {
|
if (def->data.vnc.port < 5900 || def->data.vnc.port > 5964) {
|
||||||
|
@ -350,35 +350,35 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
|
|||||||
|
|
||||||
/* Hypervisor is only run with privilege & required to succeed */
|
/* Hypervisor is only run with privilege & required to succeed */
|
||||||
if (xenHavePrivilege()) {
|
if (xenHavePrivilege()) {
|
||||||
VIR_DEBUG0("Trying hypervisor sub-driver");
|
VIR_DEBUG("Trying hypervisor sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->open(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG0("Activated hypervisor sub-driver");
|
VIR_DEBUG("Activated hypervisor sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XenD is required to succeed if privileged */
|
/* XenD is required to succeed if privileged */
|
||||||
VIR_DEBUG0("Trying XenD sub-driver");
|
VIR_DEBUG("Trying XenD sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_XEND_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_XEND_OFFSET]->open(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG0("Activated XenD sub-driver");
|
VIR_DEBUG("Activated XenD sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_XEND_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_XEND_OFFSET] = 1;
|
||||||
|
|
||||||
/* XenD is active, so try the xm & xs drivers too, both requird to
|
/* XenD is active, so try the xm & xs drivers too, both requird to
|
||||||
* succeed if root, optional otherwise */
|
* succeed if root, optional otherwise */
|
||||||
if (priv->xendConfigVersion <= 2) {
|
if (priv->xendConfigVersion <= 2) {
|
||||||
VIR_DEBUG0("Trying XM sub-driver");
|
VIR_DEBUG("Trying XM sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_XM_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_XM_OFFSET]->open(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG0("Activated XM sub-driver");
|
VIR_DEBUG("Activated XM sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_XM_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_XM_OFFSET] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VIR_DEBUG0("Trying XS sub-driver");
|
VIR_DEBUG("Trying XS sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_XS_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_XS_OFFSET]->open(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG0("Activated XS sub-driver");
|
VIR_DEBUG("Activated XS sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_XS_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_XS_OFFSET] = 1;
|
||||||
} else {
|
} else {
|
||||||
if (xenHavePrivilege())
|
if (xenHavePrivilege())
|
||||||
@ -388,7 +388,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
|
|||||||
if (xenHavePrivilege()) {
|
if (xenHavePrivilege()) {
|
||||||
goto fail; /* XenD is mandatory when privileged */
|
goto fail; /* XenD is mandatory when privileged */
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG0("Handing off for remote driver");
|
VIR_DEBUG("Handing off for remote driver");
|
||||||
ret = VIR_DRV_OPEN_DECLINED; /* Let remote_driver try instead */
|
ret = VIR_DRV_OPEN_DECLINED; /* Let remote_driver try instead */
|
||||||
goto clean;
|
goto clean;
|
||||||
}
|
}
|
||||||
@ -397,16 +397,16 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
|
|||||||
xenNumaInit(conn);
|
xenNumaInit(conn);
|
||||||
|
|
||||||
if (!(priv->caps = xenHypervisorMakeCapabilities(conn))) {
|
if (!(priv->caps = xenHypervisorMakeCapabilities(conn))) {
|
||||||
VIR_DEBUG0("Failed to make capabilities");
|
VIR_DEBUG("Failed to make capabilities");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WITH_XEN_INOTIFY
|
#if WITH_XEN_INOTIFY
|
||||||
if (xenHavePrivilege()) {
|
if (xenHavePrivilege()) {
|
||||||
VIR_DEBUG0("Trying Xen inotify sub-driver");
|
VIR_DEBUG("Trying Xen inotify sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_INOTIFY_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_INOTIFY_OFFSET]->open(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG0("Activated Xen inotify sub-driver");
|
VIR_DEBUG("Activated Xen inotify sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_INOTIFY_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_INOTIFY_OFFSET] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -417,7 +417,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
|
|||||||
fail:
|
fail:
|
||||||
ret = VIR_DRV_OPEN_ERROR;
|
ret = VIR_DRV_OPEN_ERROR;
|
||||||
clean:
|
clean:
|
||||||
VIR_DEBUG0("Failed to activate a mandatory sub-driver");
|
VIR_DEBUG("Failed to activate a mandatory sub-driver");
|
||||||
for (i = 0 ; i < XEN_UNIFIED_NR_DRIVERS ; i++)
|
for (i = 0 ; i < XEN_UNIFIED_NR_DRIVERS ; i++)
|
||||||
if (priv->opened[i]) drivers[i]->close(conn);
|
if (priv->opened[i]) drivers[i]->close(conn);
|
||||||
virMutexDestroy(&priv->lock);
|
virMutexDestroy(&priv->lock);
|
||||||
@ -2271,7 +2271,7 @@ xenUnifiedAddDomainInfo(xenUnifiedDomainInfoListPtr list,
|
|||||||
for (n=0; n < list->count; n++) {
|
for (n=0; n < list->count; n++) {
|
||||||
if (STREQ(list->doms[n]->name, name) &&
|
if (STREQ(list->doms[n]->name, name) &&
|
||||||
!memcmp(list->doms[n]->uuid, uuid, VIR_UUID_BUFLEN)) {
|
!memcmp(list->doms[n]->uuid, uuid, VIR_UUID_BUFLEN)) {
|
||||||
VIR_DEBUG0("WARNING: dom already tracked");
|
VIR_DEBUG("WARNING: dom already tracked");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2092,13 +2092,13 @@ xenHypervisorInit(void)
|
|||||||
/* RHEL 5.0 */
|
/* RHEL 5.0 */
|
||||||
dom_interface_version = 3; /* XEN_DOMCTL_INTERFACE_VERSION */
|
dom_interface_version = 3; /* XEN_DOMCTL_INTERFACE_VERSION */
|
||||||
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
||||||
VIR_DEBUG0("Using hypervisor call v2, sys ver2 dom ver3");
|
VIR_DEBUG("Using hypervisor call v2, sys ver2 dom ver3");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
/* Fedora 7 */
|
/* Fedora 7 */
|
||||||
dom_interface_version = 4; /* XEN_DOMCTL_INTERFACE_VERSION */
|
dom_interface_version = 4; /* XEN_DOMCTL_INTERFACE_VERSION */
|
||||||
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
||||||
VIR_DEBUG0("Using hypervisor call v2, sys ver2 dom ver4");
|
VIR_DEBUG("Using hypervisor call v2, sys ver2 dom ver4");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2108,7 +2108,7 @@ xenHypervisorInit(void)
|
|||||||
/* xen-3.1 */
|
/* xen-3.1 */
|
||||||
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
|
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
|
||||||
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
||||||
VIR_DEBUG0("Using hypervisor call v2, sys ver3 dom ver5");
|
VIR_DEBUG("Using hypervisor call v2, sys ver3 dom ver5");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2118,7 +2118,7 @@ xenHypervisorInit(void)
|
|||||||
/* Fedora 8 */
|
/* Fedora 8 */
|
||||||
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
|
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
|
||||||
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
||||||
VIR_DEBUG0("Using hypervisor call v2, sys ver4 dom ver5");
|
VIR_DEBUG("Using hypervisor call v2, sys ver4 dom ver5");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2128,7 +2128,7 @@ xenHypervisorInit(void)
|
|||||||
/* Xen 3.2, Fedora 9 */
|
/* Xen 3.2, Fedora 9 */
|
||||||
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
|
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
|
||||||
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
|
||||||
VIR_DEBUG0("Using hypervisor call v2, sys ver6 dom ver5");
|
VIR_DEBUG("Using hypervisor call v2, sys ver6 dom ver5");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2137,7 +2137,7 @@ xenHypervisorInit(void)
|
|||||||
sys_interface_version = 7; /* XEN_SYSCTL_INTERFACE_VERSION */
|
sys_interface_version = 7; /* XEN_SYSCTL_INTERFACE_VERSION */
|
||||||
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
|
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
|
||||||
dom_interface_version = 6; /* XEN_DOMCTL_INTERFACE_VERSION */
|
dom_interface_version = 6; /* XEN_DOMCTL_INTERFACE_VERSION */
|
||||||
VIR_DEBUG0("Using hypervisor call v2, sys ver7 dom ver6");
|
VIR_DEBUG("Using hypervisor call v2, sys ver7 dom ver6");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2148,14 +2148,14 @@ xenHypervisorInit(void)
|
|||||||
sys_interface_version = 8; /* XEN_SYSCTL_INTERFACE_VERSION */
|
sys_interface_version = 8; /* XEN_SYSCTL_INTERFACE_VERSION */
|
||||||
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
|
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
|
||||||
dom_interface_version = 7; /* XEN_DOMCTL_INTERFACE_VERSION */
|
dom_interface_version = 7; /* XEN_DOMCTL_INTERFACE_VERSION */
|
||||||
VIR_DEBUG0("Using hypervisor call v2, sys ver8 dom ver7\n");
|
VIR_DEBUG("Using hypervisor call v2, sys ver8 dom ver7\n");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
hypervisor_version = 1;
|
hypervisor_version = 1;
|
||||||
sys_interface_version = -1;
|
sys_interface_version = -1;
|
||||||
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
|
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
|
||||||
VIR_DEBUG0("Using hypervisor call v1");
|
VIR_DEBUG("Using hypervisor call v1");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2163,7 +2163,7 @@ xenHypervisorInit(void)
|
|||||||
* we failed to make the getdomaininfolist hypercall
|
* we failed to make the getdomaininfolist hypercall
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VIR_DEBUG0("Failed to find any Xen hypervisor method");
|
VIR_DEBUG("Failed to find any Xen hypervisor method");
|
||||||
hypervisor_version = -1;
|
hypervisor_version = -1;
|
||||||
virXenError(VIR_ERR_XEN_CALL, " ioctl %lu",
|
virXenError(VIR_ERR_XEN_CALL, " ioctl %lu",
|
||||||
(unsigned long)IOCTL_PRIVCMD_HYPERCALL);
|
(unsigned long)IOCTL_PRIVCMD_HYPERCALL);
|
||||||
|
@ -105,7 +105,7 @@ xenInotifyXenCacheLookup(virConnectPtr conn,
|
|||||||
memcpy(uuid, entry->def->uuid, VIR_UUID_BUFLEN);
|
memcpy(uuid, entry->def->uuid, VIR_UUID_BUFLEN);
|
||||||
|
|
||||||
if (!*name) {
|
if (!*name) {
|
||||||
VIR_DEBUG0("Error getting dom from def");
|
VIR_DEBUG("Error getting dom from def");
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ xenInotifyXendDomainsDirLookup(virConnectPtr conn, const char *filename,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memcpy(uuid, priv->configInfoList->doms[i]->uuid, VIR_UUID_BUFLEN);
|
memcpy(uuid, priv->configInfoList->doms[i]->uuid, VIR_UUID_BUFLEN);
|
||||||
VIR_DEBUG0("Found dom on list");
|
VIR_DEBUG("Found dom on list");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,7 +288,7 @@ xenInotifyEvent(int watch ATTRIBUTE_UNUSED,
|
|||||||
virConnectPtr conn = data;
|
virConnectPtr conn = data;
|
||||||
xenUnifiedPrivatePtr priv = NULL;
|
xenUnifiedPrivatePtr priv = NULL;
|
||||||
|
|
||||||
VIR_DEBUG0("got inotify event");
|
VIR_DEBUG("got inotify event");
|
||||||
|
|
||||||
if( conn && conn->privateData ) {
|
if( conn && conn->privateData ) {
|
||||||
priv = conn->privateData;
|
priv = conn->privateData;
|
||||||
@ -450,18 +450,18 @@ xenInotifyOpen(virConnectPtr conn,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Building initial config cache");
|
VIR_DEBUG("Building initial config cache");
|
||||||
if (priv->useXenConfigCache &&
|
if (priv->useXenConfigCache &&
|
||||||
xenXMConfigCacheRefresh (conn) < 0) {
|
xenXMConfigCacheRefresh (conn) < 0) {
|
||||||
VIR_DEBUG("Failed to enable XM config cache %s", conn->err.message);
|
VIR_DEBUG("Failed to enable XM config cache %s", conn->err.message);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG0("Registering with event loop");
|
VIR_DEBUG("Registering with event loop");
|
||||||
/* Add the handle for monitoring */
|
/* Add the handle for monitoring */
|
||||||
if ((priv->inotifyWatch = virEventAddHandle(priv->inotifyFD, VIR_EVENT_HANDLE_READABLE,
|
if ((priv->inotifyWatch = virEventAddHandle(priv->inotifyFD, VIR_EVENT_HANDLE_READABLE,
|
||||||
xenInotifyEvent, conn, NULL)) < 0) {
|
xenInotifyEvent, conn, NULL)) < 0) {
|
||||||
VIR_DEBUG0("Failed to add inotify handle, disabling events");
|
VIR_DEBUG("Failed to add inotify handle, disabling events");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3279,7 +3279,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
|
|||||||
if (ret == 0 && undefined_source)
|
if (ret == 0 && undefined_source)
|
||||||
xenDaemonDomainUndefine (domain);
|
xenDaemonDomainUndefine (domain);
|
||||||
|
|
||||||
VIR_DEBUG0("migration done");
|
VIR_DEBUG("migration done");
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -327,7 +327,7 @@ xenStoreOpen(virConnectPtr conn,
|
|||||||
xenStoreWatchEvent,
|
xenStoreWatchEvent,
|
||||||
conn,
|
conn,
|
||||||
NULL)) < 0)
|
NULL)) < 0)
|
||||||
VIR_DEBUG0("Failed to add event handle, disabling events");
|
VIR_DEBUG("Failed to add event handle, disabling events");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -353,12 +353,12 @@ xenStoreClose(virConnectPtr conn)
|
|||||||
priv = (xenUnifiedPrivatePtr) conn->privateData;
|
priv = (xenUnifiedPrivatePtr) conn->privateData;
|
||||||
|
|
||||||
if (xenStoreRemoveWatch(conn, "@introduceDomain", "introduceDomain") < 0) {
|
if (xenStoreRemoveWatch(conn, "@introduceDomain", "introduceDomain") < 0) {
|
||||||
VIR_DEBUG0("Warning, could not remove @introduceDomain watch");
|
VIR_DEBUG("Warning, could not remove @introduceDomain watch");
|
||||||
/* not fatal */
|
/* not fatal */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xenStoreRemoveWatch(conn, "@releaseDomain", "releaseDomain") < 0) {
|
if (xenStoreRemoveWatch(conn, "@releaseDomain", "releaseDomain") < 0) {
|
||||||
VIR_DEBUG0("Warning, could not remove @releaseDomain watch");
|
VIR_DEBUG("Warning, could not remove @releaseDomain watch");
|
||||||
/* not fatal */
|
/* not fatal */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1196,7 +1196,7 @@ int xenStoreRemoveWatch(virConnectPtr conn,
|
|||||||
list->watches[i]->path,
|
list->watches[i]->path,
|
||||||
list->watches[i]->token))
|
list->watches[i]->token))
|
||||||
{
|
{
|
||||||
VIR_DEBUG0("WARNING: Could not remove watch");
|
VIR_DEBUG("WARNING: Could not remove watch");
|
||||||
/* Not fatal, continue */
|
/* Not fatal, continue */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1351,7 +1351,7 @@ retry:
|
|||||||
VIR_FREE(new_domids);
|
VIR_FREE(new_domids);
|
||||||
|
|
||||||
if (missing && retries--) {
|
if (missing && retries--) {
|
||||||
VIR_DEBUG0("Some domains were missing, trying again");
|
VIR_DEBUG("Some domains were missing, trying again");
|
||||||
usleep(100 * 1000);
|
usleep(100 * 1000);
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
@ -1426,7 +1426,7 @@ retry:
|
|||||||
VIR_FREE(new_domids);
|
VIR_FREE(new_domids);
|
||||||
|
|
||||||
if (!removed && retries--) {
|
if (!removed && retries--) {
|
||||||
VIR_DEBUG0("No domains removed, retrying");
|
VIR_DEBUG("No domains removed, retrying");
|
||||||
usleep(100 * 1000);
|
usleep(100 * 1000);
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
@ -1996,7 +1996,7 @@ xenFormatSxpr(virConnectPtr conn,
|
|||||||
char *bufout;
|
char *bufout;
|
||||||
int hvm = 0, i;
|
int hvm = 0, i;
|
||||||
|
|
||||||
VIR_DEBUG0("Formatting domain sexpr");
|
VIR_DEBUG("Formatting domain sexpr");
|
||||||
|
|
||||||
virBufferAddLit(&buf, "(vm ");
|
virBufferAddLit(&buf, "(vm ");
|
||||||
virBufferEscapeSexpr(&buf, "(name '%s')", def->name);
|
virBufferEscapeSexpr(&buf, "(name '%s')", def->name);
|
||||||
|
Loading…
Reference in New Issue
Block a user