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>
msg_gen_function += ESX_VI_ERROR
msg_gen_function += PHYP_ERROR
msg_gen_function += VIR_ERROR
-msg_gen_function += VIR_ERROR0
msg_gen_function += VMX_ERROR
msg_gen_function += XENXS_ERROR
msg_gen_function += eventReportError
# Some functions/macros produce messages intended solely for developers
# and maintainers. Do not mark them for translation.
sc_prohibit_gettext_markup:
- @prohibit='\<VIR_(WARN|DEBUG)0? *\(_\(' \
+ @prohibit='\<VIR_(WARN|DEBUG) *\(_\(' \
halt='do not mark these strings for translation' \
$(_sc_search_regexp)
switch (siginfo.si_signo) {
case SIGHUP:
- VIR_INFO0(_("Reloading configuration on SIGHUP"));
+ VIR_INFO(_("Reloading configuration on SIGHUP"));
virHookCall(VIR_HOOK_DRIVER_DAEMON, "-",
VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL);
if (virStateReload() < 0)
- VIR_WARN0("Error while reloading drivers");
+ VIR_WARN("Error while reloading drivers");
break;
char ebuf[1024];
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;
}
struct qemud_server *server;
if (VIR_ALLOC(server) < 0) {
- VIR_ERROR0(_("Failed to allocate struct qemud_server"));
+ VIR_ERROR(_("Failed to allocate struct qemud_server"));
return NULL;
}
server->sigread = server->sigwrite = -1;
if (virMutexInit(&server->lock) < 0) {
- VIR_ERROR0(_("cannot initialize mutex"));
+ VIR_ERROR(_("cannot initialize mutex"));
VIR_FREE(server);
return NULL;
}
if (virCondInit(&server->job) < 0) {
- VIR_ERROR0(_("cannot initialize condition variable"));
+ VIR_ERROR(_("cannot initialize condition variable"));
virMutexDestroy(&server->lock);
VIR_FREE(server);
return NULL;
VIR_EVENT_HANDLE_HANGUP,
qemudDispatchServerEvent,
server, NULL)) < 0) {
- VIR_ERROR0(_("Failed to add server event callback"));
+ VIR_ERROR(_("Failed to add server event callback"));
return -1;
}
if (status != 0) {
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)
- VIR_ERROR0(_("The client certificate has unknown issuer."));
+ VIR_ERROR(_("The client certificate has unknown issuer."));
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
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
goto authdeny;
}
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;
}
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;
}
gnutls_x509_crt_t cert;
if (gnutls_x509_crt_init (&cert) < 0) {
- VIR_ERROR0(_("Unable to initialize certificate"));
+ VIR_ERROR(_("Unable to initialize certificate"));
goto authfail;
}
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);
goto authfail;
}
if (!remoteCheckDN (name)) {
/* 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 "
"'certtool -i --infile clientcert.pem' to view the"
"Distinguished Name field in the client certificate,"
}
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);
goto authdeny;
}
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);
goto authdeny;
}
/* Verify client certificate. */
if (remoteCheckCertificate (client) == -1) {
- VIR_ERROR0(_("remoteCheckCertificate: "
+ VIR_ERROR(_("remoteCheckCertificate: "
"failed to verify client's certificate"));
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"));
}
return -1;
}
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;
}
if (VIR_RESIZE_N(server->clients, server->nclients_max,
server->nclients, 1) < 0) {
- VIR_ERROR0(_("Out of memory allocating clients"));
+ VIR_ERROR(_("Out of memory allocating clients"));
goto error;
}
if (VIR_ALLOC(client) < 0)
goto error;
if (virMutexInit(&client->lock) < 0) {
- VIR_ERROR0(_("cannot initialize mutex"));
+ VIR_ERROR(_("cannot initialize mutex"));
goto error;
}
if (!xdr_u_int(&x, &len)) {
xdr_destroy (&x);
- VIR_DEBUG0("Failed to decode packet length");
+ VIR_DEBUG("Failed to decode packet length");
qemudDispatchClientFailure(client);
return;
}
if (virStateActive() ||
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);
} else {
- VIR_DEBUG0("Timer expired and inactive, shutting down");
+ VIR_DEBUG("Timer expired and inactive, shutting down");
server->quitEventThread = 1;
}
}
(timerid = virEventAddTimeout(-1,
qemudInactiveTimer,
server, NULL)) < 0) {
- VIR_ERROR0(_("Failed to register shutdown timeout"));
+ VIR_ERROR(_("Failed to register shutdown timeout"));
return NULL;
}
server->nworkers = max_workers;
if (VIR_ALLOC_N(server->workers, server->nworkers) < 0) {
- VIR_ERROR0(_("Failed to allocate workers"));
+ VIR_ERROR(_("Failed to allocate workers"));
return NULL;
}
virMutexUnlock(&server->lock);
if (qemudOneLoop() < 0) {
virMutexLock(&server->lock);
- VIR_DEBUG0("Loop iteration error, exiting");
+ VIR_DEBUG("Loop iteration error, exiting");
break;
}
virMutexLock(&server->lock);
GET_CONF_STR (conf, filename, unix_sock_group);
if (unix_sock_group) {
if (!server->privileged) {
- VIR_WARN0("Cannot set group when not running as root");
+ VIR_WARN("Cannot set group when not running as root");
} else {
int ret;
struct group grpdata, *grp;
maxbuf = 1024;
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;
}
&grp)) == ERANGE) {
maxbuf *= 2;
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;
}
}
if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET,
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
- VIR_ERROR0(_("additional privileges are required"));
+ VIR_ERROR(_("additional privileges are required"));
return -1;
}
if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
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;
}
VIR_EVENT_HANDLE_READABLE,
qemudDispatchSignalEvent,
server, NULL) < 0) {
- VIR_ERROR0(_("Failed to register callback for signal pipe"));
+ VIR_ERROR(_("Failed to register callback for signal pipe"));
goto error;
}
/* Start the event loop in a background thread, since
* state initialization needs events to be being processed */
if (qemudStartEventLoop(server) < 0) {
- VIR_ERROR0(_("Event thread startup failed"));
+ VIR_ERROR(_("Event thread startup failed"));
goto error;
}
* we're ready, since it can take a long time and this will
* seriously delay OS bootup process */
if (virStateInitialize(server->privileged) < 0) {
- VIR_ERROR0(_("Driver state initialization failed"));
+ VIR_ERROR(_("Driver state initialization failed"));
goto shutdown;
}
/* Start accepting new clients from network */
virMutexLock(&server->lock);
if (qemudNetworkEnable(server) < 0) {
- VIR_ERROR0(_("Network event loop enablement failed"));
+ VIR_ERROR(_("Network event loop enablement failed"));
goto shutdown;
}
virMutexUnlock(&server->lock);
data.subject.subject_len = subject->nidentity;
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;
}
for (i = 0 ; i < data.subject.subject_len ; i++) {
VIR_DEBUG("Initialize SASL auth %d", client->fd);
if (client->auth != REMOTE_AUTH_SASL ||
client->saslconn != NULL) {
- VIR_ERROR0(_("client tried invalid SASL init request"));
+ VIR_ERROR(_("client tried invalid SASL init request"));
goto authfail;
}
cipher = gnutls_cipher_get(client->tlssession);
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);
client->saslconn = NULL;
goto authfail;
VIR_DEBUG("Available mechanisms for client: '%s'", mechlist);
ret->mechlist = strdup(mechlist);
if (!ret->mechlist) {
- VIR_ERROR0(_("cannot allocate mechlist"));
+ VIR_ERROR(_("cannot allocate mechlist"));
sasl_dispose(&client->saslconn);
client->saslconn = NULL;
goto authfail;
return -1;
}
if (val == NULL) {
- VIR_ERROR0(_("no client username was found"));
+ VIR_ERROR(_("no client username was found"));
remoteDispatchAuthError(rerr);
sasl_dispose(&client->saslconn);
client->saslconn = NULL;
client->saslUsername = strdup((const char*)val);
if (client->saslUsername == NULL) {
- VIR_ERROR0(_("out of memory copying username"));
+ VIR_ERROR(_("out of memory copying username"));
remoteDispatchAuthError(rerr);
sasl_dispose(&client->saslconn);
client->saslconn = NULL;
VIR_DEBUG("Start SASL auth %d", client->fd);
if (client->auth != REMOTE_AUTH_SASL ||
client->saslconn == NULL) {
- VIR_ERROR0(_("client tried invalid SASL start request"));
+ VIR_ERROR(_("client tried invalid SASL start request"));
goto authfail;
}
VIR_DEBUG("Step SASL auth %d", client->fd);
if (client->auth != REMOTE_AUTH_SASL ||
client->saslconn == NULL) {
- VIR_ERROR0(_("client tried invalid SASL start request"));
+ VIR_ERROR(_("client tried invalid SASL start request"));
goto authfail;
}
void *args 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);
remoteDispatchAuthError(rerr);
return -1;
remote_auth_sasl_start_args *args 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);
remoteDispatchAuthError(rerr);
return -1;
remote_auth_sasl_step_args *args 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);
remoteDispatchAuthError(rerr);
return -1;
VIR_DEBUG("Start PolicyKit auth %d", client->fd);
if (client->auth != REMOTE_AUTH_POLKIT) {
- VIR_ERROR0(_("client tried invalid PolicyKit init request"));
+ VIR_ERROR(_("client tried invalid PolicyKit init request"));
goto authfail;
}
if (qemudGetSocketIdentity(client->fd, &callerUid, &callerPid) < 0) {
- VIR_ERROR0(_("cannot get peer socket identity"));
+ VIR_ERROR(_("cannot get peer socket identity"));
goto authfail;
}
VIR_DEBUG("Start PolicyKit auth %d", client->fd);
if (client->auth != REMOTE_AUTH_POLKIT) {
- VIR_ERROR0(_("client tried invalid PolicyKit init request"));
+ VIR_ERROR(_("client tried invalid PolicyKit init request"));
goto authfail;
}
if (qemudGetSocketIdentity(client->fd, &callerUid, &callerPid) < 0) {
- VIR_ERROR0(_("cannot get peer socket identity"));
+ VIR_ERROR(_("cannot get peer socket identity"));
goto authfail;
}
void *args 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);
return -1;
}
/* Blocking, so indicate we have more todo later */
return 1;
} else {
- VIR_INFO0("Stream send failed");
+ VIR_INFO("Stream send failed");
stream->closed = 1;
remoteDispatchError(&rerr);
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
#include <libvirt/libvirt.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", \
- __func__, __LINE__, __VA_ARGS__)
+ __func__, __LINE__, ##__VA_ARGS__)
#define STREQ(a,b) (strcmp(a,b) == 0)
#ifndef ATTRIBUTE_UNUSED
sigaction(SIGTERM, &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 */
callback1ret = virConnectDomainEventRegister(dconn, myDomainEventCallback1,
}
}
- VIR_DEBUG0("Deregistering event handlers");
+ VIR_DEBUG("Deregistering event handlers");
virConnectDomainEventDeregister(dconn, myDomainEventCallback1);
virConnectDomainEventDeregisterAny(dconn, callback2ret);
virConnectDomainEventDeregisterAny(dconn, callback3ret);
virConnectDomainEventDeregisterAny(dconn, callback7ret);
}
- VIR_DEBUG0("Closing connection");
+ VIR_DEBUG("Closing connection");
if (dconn && virConnectClose(dconn) < 0) {
printf("error closing\n");
}
x86DataSubtract(cpu_require->data, cpu_disable->data);
result = x86ModelCompare(host_model, cpu_require);
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;
goto out;
}
if (ret == VIR_CPU_COMPARE_SUPERSET
&& cpu->type == VIR_CPU_TYPE_GUEST
&& 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;
goto out;
}
/* Warn if host is in maintenance mode */
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 (priv->usedCpuTimeCounterId < 0) {
- VIR_WARN0("Could not find 'used CPU time' performance counter");
+ VIR_WARN("Could not find 'used CPU time' performance counter");
}
}
for (perfEntityMetricBase = perfEntityMetricBaseList;
perfEntityMetricBase != NULL;
perfEntityMetricBase = perfEntityMetricBase->_next) {
- VIR_DEBUG0("perfEntityMetric ...");
+ VIR_DEBUG("perfEntityMetric ...");
perfEntityMetric =
esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase);
for (; perfMetricIntSeries != NULL;
perfMetricIntSeries = perfMetricIntSeries->_next) {
- VIR_DEBUG0("perfMetricIntSeries ...");
+ VIR_DEBUG("perfMetricIntSeries ...");
for (value = perfMetricIntSeries->value;
value != NULL;
break;
default:
- VIR_DEBUG0("unknown");
+ VIR_DEBUG("unknown");
break;
}
if (item->count > 0) {
/* 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;
}
} else {
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");
}
}
if (taskInfo->cancelable == esxVI_Boolean_True) {
if (esxVI_CancelTask(ctx, task) < 0 &&
blocked == esxVI_Boolean_True) {
- VIR_ERROR0(_("Cancelable task is blocked by an "
+ VIR_ERROR(_("Cancelable task is blocked by an "
"unanswered question but cancelation "
"failed"));
}
} 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"));
}
}
if (esxVI_DestroyPropertyFilter(ctx, propertyFilter) < 0) {
- VIR_DEBUG0("DestroyPropertyFilter failed");
+ VIR_DEBUG("DestroyPropertyFilter failed");
}
if (esxVI_TaskInfoState_CastFromAnyType(propertyValue, finalState) < 0) {
virLogSetFromEnv();
- VIR_DEBUG0("register drivers");
+ VIR_DEBUG("register drivers");
#if HAVE_WINSOCK2_H
if (winsock_init () == -1) return -1;
NULLSTR(ret->uri->user), ret->uri->port,
NULLSTR(ret->uri->path));
} else {
- VIR_DEBUG0("no name, allowing driver auto-select");
+ VIR_DEBUG("no name, allowing driver auto-select");
}
/* Cleansing flags */
/* Disable libxl driver if non-root */
if (!privileged) {
- VIR_INFO0("Not running privileged, disabling libxenlight driver");
+ VIR_INFO("Not running privileged, disabling libxenlight driver");
return 0;
}
/* Disable driver if legacy xen toolstack (xend) is in use */
cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL);
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.");
virCommandFree(cmd);
return 0;
return -1;
if (virMutexInit(&libxl_driver->lock) < 0) {
- VIR_ERROR0(_("cannot initialize mutex"));
+ VIR_ERROR(_("cannot initialize mutex"));
VIR_FREE(libxl_driver);
return -1;
}
libxl_driver->logger =
(xentoollog_logger *)xtl_createlogger_stdiostream(libxl_driver->logger_file, XTL_DEBUG, 0);
if (!libxl_driver->logger) {
- VIR_ERROR0(_("cannot create logger for libxenlight"));
+ VIR_ERROR(_("cannot create logger for libxenlight"));
goto fail;
}
if (libxl_ctx_init(&libxl_driver->ctx,
LIBXL_VERSION,
libxl_driver->logger)) {
- VIR_ERROR0(_("cannot initialize libxenlight context"));
+ VIR_ERROR(_("cannot initialize libxenlight context"));
goto fail;
}
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;
}
libxl_driver->version = (ver_info->xen_version_major * 1000000) +
if ((libxl_driver->caps =
libxlMakeCapabilities(&libxl_driver->ctx)) == NULL) {
- VIR_ERROR0(_("cannot create capabilities for libxenlight"));
+ VIR_ERROR(_("cannot create capabilities for libxenlight"));
goto error;
}
}
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;
}
}
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;
}
*/
if (nodeCapsInitNUMA(caps) < 0) {
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)) {
p = virConfGetValue(conf, "log_with_libvirtd");
if (p) {
if (p->type != VIR_CONF_LONG)
- VIR_WARN0("lxcLoadDriverConfig: invalid setting: log_with_libvirtd");
+ VIR_WARN("lxcLoadDriverConfig: invalid setting: log_with_libvirtd");
else
driver->log_libvirtd = p->l;
}
}
VIR_FORCE_CLOSE(control);
- VIR_DEBUG0("Received container continue message");
+ VIR_DEBUG("Received container continue message");
return 0;
}
* be unmasked - they can never escape the bounding set. */
#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
return 0;
}
flags = CLONE_NEWPID|CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|SIGCHLD;
if (userns_supported()) {
- VIR_DEBUG0("Enable user namespaces");
+ VIR_DEBUG("Enable user namespaces");
flags |= CLONE_NEWUSER;
}
if (def->nets != NULL) {
- VIR_DEBUG0("Enable network namespaces");
+ VIR_DEBUG("Enable network namespaces");
flags |= CLONE_NEWNET;
}
flags |= CLONE_NEWNET;
if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
- VIR_DEBUG0("Unable to allocate stack");
+ VIR_DEBUG("Unable to allocate stack");
return -1;
}
return -1;
}
#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
return 0;
}
* marked as shared
*/
if (root) {
- VIR_DEBUG0("Setting up private /dev/pts");
+ VIR_DEBUG("Setting up private /dev/pts");
if (unshare(CLONE_NEWNS) < 0) {
virReportSystemError(errno, "%s",
_("Cannot unshare mount namespace"));
}
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);
}
}
goto cleanup;
}
} else {
- VIR_DEBUG0("Opening tty on shared /dev/ptmx");
+ VIR_DEBUG("Opening tty on shared /dev/ptmx");
if (virFileOpenTty(&containerPty,
&containerPtyPath,
0) < 0) {
goto error_exit;
}
- VIR_DEBUG0("calling vethCreate()");
+ VIR_DEBUG("calling vethCreate()");
parentVeth = def->nets[i]->ifname;
if (vethCreate(&parentVeth, &containerVeth) < 0)
goto error_exit;
*/
ld = getenv("LD_PRELOAD");
if (ld && strstr(ld, "vgpreload")) {
- VIR_INFO0("Running under valgrind, disabling driver");
+ VIR_INFO("Running under valgrind, disabling driver");
return 0;
}
/* Check that the user is root, silently disable if not */
if (!privileged) {
- VIR_INFO0("Not running privileged, disabling driver");
+ VIR_INFO("Not running privileged, disabling driver");
return 0;
}
/* Check that this is a container enabled kernel */
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;
}
goto error;
}
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
check_interval *= exp;
VIR_FREE(state);
}
- VIR_DEBUG0("lxcFreezeContainer timeout");
+ VIR_DEBUG("lxcFreezeContainer timeout");
error:
/*
* If timeout or an error on reading the state occurs,
network->def->bridge, 68) < 0)) {
VIR_WARN("Could not add rule to fixup DHCP response checksums "
"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 */
{
unsigned int i;
- VIR_INFO0(_("Reloading iptables rules"));
+ VIR_INFO(_("Reloading iptables rules"));
for (i = 0 ; i < driver->networks.count ; i++) {
virNetworkObjLock(driver->networks.objs[i]);
static void device_added(LibHalContext *ctx ATTRIBUTE_UNUSED,
const char *udi)
{
- VIR_DEBUG0(hal_name(udi));
+ VIR_DEBUG("%s", hal_name(udi));
dev_create(udi);
}
nodeDeviceLock(driverState);
dev = virNodeDeviceFindByName(&driverState->devs,name);
- VIR_DEBUG0(name);
+ VIR_DEBUG("%s", name);
if (dev)
virNodeDeviceObjRemove(&driverState->devs, dev);
else
dbus_error_init(&err);
hal_ctx = libhal_ctx_new();
if (hal_ctx == NULL) {
- VIR_ERROR0(_("libhal_ctx_new returned NULL"));
+ VIR_ERROR(_("libhal_ctx_new returned NULL"));
goto failure;
}
dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
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,
otherwise entire libvirtd shuts down when
D-Bus isn't running */
dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE);
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;
}
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,
otherwise entire libvirtd shuts down when
hald isn't running */
remove_dbus_watch,
toggle_dbus_watch,
NULL, NULL)) {
- VIR_ERROR0(_("dbus_connection_set_watch_functions failed"));
+ VIR_ERROR(_("dbus_connection_set_watch_functions failed"));
goto failure;
}
!libhal_ctx_set_device_lost_capability(hal_ctx, device_cap_lost) ||
!libhal_ctx_set_device_property_modified(hal_ctx, device_prop_modified) ||
!libhal_device_property_watch_all(hal_ctx, &err)) {
- VIR_ERROR0(_("setting up HAL callbacks failed"));
+ VIR_ERROR(_("setting up HAL callbacks failed"));
goto failure;
}
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
if (udi == NULL) {
- VIR_ERROR0(_("libhal_get_all_devices failed"));
+ VIR_ERROR(_("libhal_get_all_devices failed"));
goto failure;
}
for (i = 0; i < num_devs; i++) {
int num_devs, i;
LibHalContext *hal_ctx;
- VIR_INFO0("Reloading HAL device state");
+ VIR_INFO("Reloading HAL device state");
nodeDeviceLock(driverState);
- VIR_INFO0("Removing existing objects");
+ VIR_INFO("Removing existing objects");
virNodeDeviceObjListFree(&driverState->devs);
nodeDeviceUnlock(driverState);
hal_ctx = DRV_STATE_HAL_CTX(driverState);
- VIR_INFO0("Creating new objects");
+ VIR_INFO("Creating new objects");
dbus_error_init(&err);
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
if (udi == NULL) {
- VIR_ERROR0(_("libhal_get_all_devices failed"));
+ VIR_ERROR(_("libhal_get_all_devices failed"));
return -1;
}
for (i = 0; i < num_devs; i++) {
VIR_FREE(udi[i]);
}
VIR_FREE(udi);
- VIR_INFO0("HAL device reload complete");
+ VIR_INFO("HAL device reload complete");
return 0;
}
VIR_DEBUG("SR IOV device path is '%s'", device_path);
config_address = basename(device_path);
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;
}
device = udev_monitor_receive_device(udev_monitor);
if (device == NULL) {
- VIR_ERROR0(_("udev_monitor_receive_device returned NULL"));
+ VIR_ERROR(_("udev_monitor_receive_device returned NULL"));
goto out;
}
}
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(driverState);
ret = -1;
priv->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
if (priv->udev_monitor == NULL) {
VIR_FREE(priv);
- VIR_ERROR0(_("udev_monitor_new_from_netlink returned NULL"));
+ VIR_ERROR(_("udev_monitor_new_from_netlink returned NULL"));
ret = -1;
goto out_unlock;
}
int udevNodeRegister(void)
{
- VIR_DEBUG0("Registering udev node device backend");
+ VIR_DEBUG("Registering udev node device backend");
registerCommonNodeFuncs(&udevDeviceMonitor);
if (virRegisterDeviceMonitor(&udevDeviceMonitor) < 0) {
"'echo 1 > %s'"),
isIPv6 ? "6" : "",
pathname);
- VIR_WARN0(msg);
+ VIR_WARN("%s", msg);
if (isIPv6)
lastReportIPv6 = now;
else
else
{
if (openvzDomainDefineCmd(prog, OPENVZ_MAX_ARG, vmdef) < 0) {
- VIR_ERROR0(_("Error creating command for container"));
+ VIR_ERROR(_("Error creating command for container"));
goto cleanup;
}
vm->persistent = 1;
if (openvzSetInitialConfig(vm->def) < 0) {
- VIR_ERROR0(_("Error creating initial configuration"));
+ VIR_ERROR(_("Error creating initial configuration"));
goto cleanup;
}
vm->persistent = 1;
if (openvzSetInitialConfig(vm->def) < 0) {
- VIR_ERROR0(_("Error creating initial configuration"));
+ VIR_ERROR(_("Error creating initial configuration"));
goto cleanup;
}
*/
if (nodeCapsInitNUMA(caps) < 0) {
virCapabilitiesFreeNUMAInfo(caps);
- VIR_WARN0
+ VIR_WARN
("Failed to query host NUMA topology, disabling NUMA capabilities");
}
if (safewrite(fd, &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;
}
if (safewrite(fd, uuid_table->lpars[i]->uuid, 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;
}
}
}
if (stat(local_file, &local_fileinfo) == -1) {
- VIR_WARN0("Unable to stat local file.");
+ VIR_WARN("Unable to stat local file.");
goto err;
}
if (!(fd = fopen(local_file, "rb"))) {
- VIR_WARN0("Unable to open local file.");
+ VIR_WARN("Unable to open local file.");
goto err;
}
int id;
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;
}
}
uuid_table->lpars[i]->id = id;
} else {
- VIR_WARN0
+ VIR_WARN
("Unable to read from information to local file.");
goto err;
}
rc = read(fd, uuid_table->lpars[i]->uuid, 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;
}
}
rc = libssh2_channel_read(channel, buffer, amount);
if (rc > 0) {
if (safewrite(fd, buffer, rc) != rc)
- VIR_WARN0
+ VIR_WARN
("Unable to write information to local file.");
got += rc;
goto cleanup;
}
if (nids_numdomains != nids_listdomains) {
- VIR_ERROR0(_("Unable to determine number of domains."));
+ VIR_ERROR(_("Unable to determine number of domains."));
goto cleanup;
}
virBuffer buf = VIR_BUFFER_INITIALIZER;
if (!(profile = phypGetLparProfile(conn, vios_id))) {
- VIR_ERROR0(_("Unable to get VIOS profile name."));
+ VIR_ERROR(_("Unable to get VIOS profile name."));
return -1;
}
if (!
(vios_name =
phypGetLparNAME(session, managed_system, vios_id, conn))) {
- VIR_ERROR0(_("Unable to get VIOS name"));
+ VIR_ERROR(_("Unable to get VIOS name"));
goto cleanup;
}
if (!(profile = phypGetLparProfile(conn, vios_id))) {
- VIR_ERROR0(_("Unable to get VIOS profile name."));
+ VIR_ERROR(_("Unable to get VIOS profile name."));
goto cleanup;
}
if ((slot = phypGetVIOSNextSlotNumber(conn)) == -1) {
- VIR_ERROR0(_("Unable to get free slot number"));
+ VIR_ERROR(_("Unable to get free slot number"));
goto cleanup;
}
if (!
(vios_name =
phypGetLparNAME(session, managed_system, vios_id, conn))) {
- VIR_ERROR0(_("Unable to get VIOS name"));
+ VIR_ERROR(_("Unable to get VIOS name"));
goto cleanup;
}
/* If not found, let's create one.
* */
if (phypCreateServerSCSIAdapter(conn) == -1) {
- VIR_ERROR0(_("Unable to create new virtual adapter"));
+ VIR_ERROR(_("Unable to create new virtual adapter"));
goto cleanup;
} else {
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;
if (!(profile = phypGetLparProfile(conn, domain->id))) {
- VIR_ERROR0(_("Unable to get VIOS profile name."));
+ VIR_ERROR(_("Unable to get VIOS profile name."));
goto cleanup;
}
ret = phypExecBuffer(session, &buf, &exit_status, conn, false);
if (exit_status < 0 || ret == NULL) {
- VIR_ERROR0(_
+ VIR_ERROR(_
("Possibly you don't have IBM Tools installed in your LPAR."
"Contact your support to enable this feature."));
goto cleanup;
if (pool->name != NULL) {
spdef->name = pool->name;
} else {
- VIR_ERROR0(_("Unable to determine storage pool's name."));
+ VIR_ERROR(_("Unable to determine storage pool's name."));
goto err;
}
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;
}
if ((spdef->capacity =
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;
}
/*XXX source adapter not working properly, should show hdiskX */
if ((spdef->source.adapter =
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;
}
if ((voldef = virStorageVolDefParseString(spdef, xml)) == NULL) {
- VIR_ERROR0(_("Error parsing volume XML."));
+ VIR_ERROR(_("Error parsing volume XML."));
goto err;
}
/* checking if this name already exists on this system */
if (phypVolumeLookupByName(pool, voldef->name) != NULL) {
- VIR_ERROR0(_("StoragePool name already exists."));
+ VIR_ERROR(_("StoragePool name already exists."));
goto err;
}
* in the moment you create the volume.
* */
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;
}
if (voldef->capacity) {
- VIR_ERROR0(_("Capacity cannot be empty."));
+ VIR_ERROR(_("Capacity cannot be empty."));
goto err;
}
if (sp->name != NULL) {
pool.name = sp->name;
} else {
- VIR_ERROR0(_("Unable to determine storage sp's name."));
+ VIR_ERROR(_("Unable to determine storage sp's name."));
goto err;
}
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;
}
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;
}
if ((pool.source.adapter =
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;
}
if (vol->name != NULL)
voldef.name = vol->name;
else {
- VIR_ERROR0(_("Unable to determine storage pool's name."));
+ VIR_ERROR(_("Unable to determine storage pool's name."));
goto err;
}
/* checking if this name already exists on this system */
if (phypStoragePoolLookupByName(conn, def->name) != NULL) {
- VIR_WARN0("StoragePool name already exists.");
+ VIR_WARN("StoragePool name already exists.");
goto err;
}
/* checking if ID or UUID already exists on this system */
if (phypGetStoragePoolLookUpByUUID(conn, def->uuid) != NULL) {
- VIR_WARN0("StoragePool uuid already exists.");
+ VIR_WARN("StoragePool uuid already exists.");
goto err;
}
if (pool->name != NULL)
def.name = pool->name;
else {
- VIR_ERROR0(_("Unable to determine storage pool's name."));
+ VIR_ERROR(_("Unable to determine storage pool's name."));
goto err;
}
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;
}
if ((def.capacity =
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;
}
/*XXX source adapter not working properly, should show hdiskX */
if ((def.source.adapter =
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;
}
dom->conn);
if (lpar_name == NULL) {
- VIR_ERROR0(_("Unable to determine domain's name."));
+ VIR_ERROR(_("Unable to determine domain's name."));
goto err;
}
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;
}
if ((def.mem.max_balloon =
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;
}
if ((def.mem.cur_balloon =
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;
}
if ((def.maxvcpus = def.vcpus =
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;
}
if ((info->maxMem =
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 =
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 =
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;
}
}
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;
}
/* checking if this name already exists on this system */
if (phypGetLparID(session, managed_system, def->name, conn) != -1) {
- VIR_WARN0("LPAR name already exists.");
+ VIR_WARN("LPAR name already exists.");
goto err;
}
/* checking if ID or UUID already exists on this system */
for (i = 0; i < uuid_table->nlpars; i++) {
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;
}
}
return 0;
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."));
return 0;
}
ret = phypExecBuffer(session, &buf, &exit_status, dom->conn, false);
if (exit_status < 0) {
- VIR_ERROR0(_
+ VIR_ERROR(_
("Possibly you don't have IBM Tools installed in your LPAR."
" Contact your support to enable this feature."));
}
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
return;
}
if (!(oldsrc = virAuditEncode("old-disk",
oldDef && oldDef->src ?
oldDef->src : "?"))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
goto cleanup;
}
if (!(newsrc = virAuditEncode("new-disk",
newDef && newDef->src ?
newDef->src : "?"))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
goto cleanup;
}
if (newDef)
virFormatMacAddr(newDef->mac, newMacstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
return;
}
if (!(vmname = virAuditEncode("vm", vmDef->name)) ||
!(devname = virAuditEncode("path", device))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
goto cleanup;
}
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
return;
}
hostdev->source.subsys.u.pci.bus,
hostdev->source.subsys.u.pci.slot,
hostdev->source.subsys.u.pci.function) < 0) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
goto cleanup;
}
break;
if (virAsprintf(&address, "%.3d.%.3d",
hostdev->source.subsys.u.usb.bus,
hostdev->source.subsys.u.usb.device) < 0) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
goto cleanup;
}
break;
}
if (!(device = virAuditEncode("device", VIR_AUDIT_STR(address)))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
goto cleanup;
}
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
return;
}
if (virAsprintf(&extra, "major category=%s maj=%02X acl=%s",
name, maj, perms) < 0) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
return;
}
if (!(detail = virAuditEncode("path", path)) ||
virAsprintf(&extra, "path path=%s rdev=%s acl=%s",
path, VIR_AUDIT_STR(rdev), perms) < 0) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
goto cleanup;
}
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
return;
}
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
return;
}
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
- VIR_WARN0("OOM while encoding audit message");
+ VIR_WARN("OOM while encoding audit message");
return;
}
*/
if (nodeCapsInitNUMA(caps) < 0) {
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 (qemuCapsInitCPU(caps, utsname.machine) < 0)
- VIR_WARN0("Failed to get host CPU");
+ VIR_WARN("Failed to get host CPU");
}
else {
caps->host.cpu = old_caps->host.cpu;
qemuAuditCgroup(vm, cgroup, "deny", "all", rc == 0);
if (rc != 0) {
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;
}
for (i = 0, pp = p->list; pp; ++i, pp = pp->next) {
int ctl;
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);
return -1;
}
}
for (i = 0, pp = p->list; pp; ++i, pp = pp->next) {
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);
return -1;
}
/* This should never be non-NULL if we get here, but just in case... */
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);
}
VIR_FREE(priv);
return 0;
error:
- VIR_ERROR0(_("Failed to initialize security drivers"));
+ VIR_ERROR(_("Failed to initialize security drivers"));
virSecurityManagerFree(mgr);
return -1;
}
VIR_INFO("Loading snapshot file '%s'", entry->d_name);
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;
}
return -1;
if (virMutexInit(&qemu_driver->lock) < 0) {
- VIR_ERROR0(_("cannot initialize mutex"));
+ VIR_ERROR(_("cannot initialize mutex"));
VIR_FREE(qemu_driver);
return -1;
}
"%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*d %d",
&usertime, &systime, &cpu) != 3) {
VIR_FORCE_FCLOSE(pidinfo);
- VIR_WARN0("cannot parse process status data");
+ VIR_WARN("cannot parse process status data");
errno = -EINVAL;
return -1;
}
if (header.was_running && virDomainObjIsActive(vm)) {
rc = qemuProcessStartCPUs(driver, vm, dom->conn);
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)
(controller->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
releaseaddr &&
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);
return ret;
cont->idx = controller;
cont->model = -1;
- VIR_INFO0("No SCSI controller present, hotplugging one");
+ VIR_INFO("No SCSI controller present, hotplugging one");
if (qemuDomainAttachPciControllerDevice(driver,
vm, cont) < 0) {
VIR_FREE(cont);
(net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
releaseaddr &&
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)
virDomainConfNWFilterTeardown(net);
qemuDomainObjExitMonitorWithDriver(driver, vm);
VIR_FREE(netdev_name);
} else {
- VIR_WARN0("Unable to remove network backend");
+ VIR_WARN("Unable to remove network backend");
}
} else {
char *hostnet_name;
(hostdev->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
releaseaddr &&
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);
error:
if (virSecurityManagerRestoreHostdevLabel(driver->securityManager,
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;
}
olddev->data.spice.auth.validTo = dev->data.spice.auth.validTo;
olddev->data.spice.auth.expires = dev->data.spice.auth.expires;
} else {
- VIR_DEBUG0("Not updating since password didn't change");
+ VIR_DEBUG("Not updating since password didn't change");
ret = 0;
}
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
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);
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
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);
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
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) {
memmove(vm->def->hostdevs + i,
if (virSecurityManagerRestoreHostdevLabel(driver->securityManager,
vm, dev->data.hostdev) < 0)
- VIR_WARN0("Failed to restore host device labelling");
+ VIR_WARN("Failed to restore host device labelling");
return ret;
}
if (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);
rc = qemuMonitorMigrateCancel(priv->mon);
qemuDomainObjExitMonitorWithDriver(driver, vm);
if (rc < 0) {
- VIR_WARN0("Unable to cancel job");
+ VIR_WARN("Unable to cancel job");
}
} else if (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)
- VIR_WARN0("Unable to pause domain");
+ VIR_WARN("Unable to pause domain");
} else if (priv->jobSignals & QEMU_JOB_SIGNAL_MIGRATE_DOWNTIME) {
unsigned long long ms = priv->jobSignalsData.migrateDowntime;
rc = qemuMonitorSetMigrationDowntime(priv->mon, ms);
qemuDomainObjExitMonitorWithDriver(driver, vm);
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) {
unsigned long bandwidth = priv->jobSignalsData.migrateBandwidth;
rc = qemuMonitorSetMigrationSpeed(priv->mon, bandwidth);
qemuDomainObjExitMonitorWithDriver(driver, vm);
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
pipeFD[1]);
if (VIR_CLOSE(pipeFD[0]) < 0 ||
VIR_CLOSE(pipeFD[1]) < 0)
- VIR_WARN0("failed to close intermediate pipe");
+ VIR_WARN("failed to close intermediate pipe");
} else {
rc = qemuMonitorMigrateToFile(priv->mon,
QEMU_MONITOR_MIGRATE_BACKGROUND,
if (ret < 0) {
if (qemuMonitorCloseFileHandle(mon, "migrate") < 0)
- VIR_WARN0("failed to close migration handle");
+ VIR_WARN("failed to close migration handle");
}
return ret;
type = virJSONValueObjectGetString(obj, "event");
if (!type) {
- VIR_WARN0("missing event type in message");
+ VIR_WARN("missing event type in message");
errno = EINVAL;
return -1;
}
VIR_DEBUG("Line [%s]", line);
if (!(obj = virJSONValueFromString(line))) {
- VIR_DEBUG0("Parsing JSON string failed");
+ VIR_DEBUG("Parsing JSON string failed");
errno = EINVAL;
goto cleanup;
}
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;
}
if (virJSONValueObjectHasKey(obj, "QMP") == 1) {
- VIR_DEBUG0("Got QMP capabilities data");
+ VIR_DEBUG("Got QMP capabilities data");
ret = 0;
goto cleanup;
}
{
long long 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;
}
qemuMonitorEmitRTCChange(mon, offset);
const char *action;
int actionID;
if (!(action = virJSONValueObjectGetString(data, "action"))) {
- VIR_WARN0("missing action in watchdog event");
+ VIR_WARN("missing action in watchdog event");
}
if (action) {
if ((actionID = qemuMonitorWatchdogActionTypeFromString(action)) < 0) {
to the application */
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";
}
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 ((reason = virJSONValueObjectGetString(data, "reason")) == NULL) {
- VIR_WARN0("missing reason in disk io error event");
+ VIR_WARN("missing reason in disk io error event");
reason = "";
}
#else
virJSONValuePtr server;
if (!(client = virJSONValueObjectGet(data, "client"))) {
- VIR_WARN0("missing client info in VNC event");
+ VIR_WARN("missing client info in VNC event");
return;
}
if (!(server = virJSONValueObjectGet(data, "server"))) {
- VIR_WARN0("missing server info in VNC event");
+ VIR_WARN("missing server info in VNC event");
return;
}
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
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);
goto cleanup;
}
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
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);
goto cleanup;
}
if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
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);
} else {
- VIR_ERROR0(_("deleting disk is not supported. "
+ VIR_ERROR(_("deleting disk is not supported. "
"This may leak data if disk is reassigned"));
ret = 1;
}
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
qemuMonitorCheckHMP(mon, "savevm")) {
- VIR_DEBUG0("savevm command not found, trying HMP");
+ VIR_DEBUG("savevm command not found, trying HMP");
ret = qemuMonitorTextCreateSnapshot(mon, name);
goto cleanup;
}
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
qemuMonitorCheckHMP(mon, "loadvm")) {
- VIR_DEBUG0("loadvm command not found, trying HMP");
+ VIR_DEBUG("loadvm command not found, trying HMP");
ret = qemuMonitorTextLoadSnapshot(mon, name);
goto cleanup;
}
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
qemuMonitorCheckHMP(mon, "delvm")) {
- VIR_DEBUG0("delvm command not found, trying HMP");
+ VIR_DEBUG("delvm command not found, trying HMP");
ret = qemuMonitorTextDeleteSnapshot(mon, name);
goto cleanup;
}
if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
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);
} else {
ret = qemuMonitorJSONCheckError(cmd, reply);
not consumed anything. We'll restart when more data arrives. */
if (!offset) {
#if DEBUG_IO
- VIR_DEBUG0("Partial greeting seen, getting out & waiting for more");
+ VIR_DEBUG("Partial greeting seen, getting out & waiting for more");
#endif
return 0;
}
used = offset - data + strlen(GREETING_POSTFIX);
#if DEBUG_IO
- VIR_DEBUG0("Discarded monitor greeting");
+ VIR_DEBUG("Discarded monitor greeting");
#endif
}
#if DEBUG_IO
VIR_DEBUG("Finished %d byte reply [%s]", want, msg->rxBuffer);
} else {
- VIR_DEBUG0("Finished 0 byte reply");
+ VIR_DEBUG("Finished 0 byte reply");
#endif
}
msg->finished = 1;
}
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"));
ret = 1;
goto cleanup;
vm->def->clock.data.adjustment = offset;
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);
unsigned char *cpumap;
int cpumaplen;
- VIR_DEBUG0("Setting CPU affinity");
+ VIR_DEBUG("Setting CPU affinity");
if (nodeGetInfo(NULL, &nodeinfo) < 0)
return -1;
hookData.vm = vm;
hookData.driver = driver;
- VIR_DEBUG0("Beginning VM startup process");
+ VIR_DEBUG("Beginning VM startup process");
if (virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
* 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
*/
- VIR_DEBUG0("Setting current domain def as transient");
+ VIR_DEBUG("Setting current domain def as transient");
if (virDomainObjSetDefTransient(driver->caps, vm, true) < 0)
goto cleanup;
}
/* Must be run before security labelling */
- VIR_DEBUG0("Preparing host devices");
+ VIR_DEBUG("Preparing host devices");
if (qemuPrepareHostDevices(driver, vm->def) < 0)
goto cleanup;
- VIR_DEBUG0("Preparing chr devices");
+ VIR_DEBUG("Preparing chr devices");
if (virDomainChrDefForeach(vm->def,
true,
qemuProcessPrepareChardevDevice,
/* If you are using a SecurityDriver with dynamic labelling,
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) {
qemuAuditSecurityLabel(vm, false);
goto cleanup;
}
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,
vm, stdin_path) < 0)
goto cleanup;
*/
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) {
virReportSystemError(errno,
/* Ensure no historical cgroup for this VM is lying around bogus
* settings */
- VIR_DEBUG0("Ensuring no historical cgroup is lying around");
+ VIR_DEBUG("Ensuring no historical cgroup is lying around");
qemuRemoveCgroup(driver, vm, 1);
if (vm->def->ngraphics == 1) {
goto cleanup;
}
- VIR_DEBUG0("Creating domain log file");
+ VIR_DEBUG("Creating domain log file");
if ((logfile = qemuDomainCreateLog(driver, vm, false)) < 0)
goto cleanup;
- VIR_DEBUG0("Determining emulator version");
+ VIR_DEBUG("Determining emulator version");
qemuCapsFree(priv->qemuCaps);
priv->qemuCaps = NULL;
if (qemuCapsExtractVersionInfo(vm->def->emulator, vm->def->os.arch,
&priv->qemuCaps) < 0)
goto cleanup;
- VIR_DEBUG0("Setting up domain cgroup (if required)");
+ VIR_DEBUG("Setting up domain cgroup (if required)");
if (qemuSetupCgroup(driver, vm) < 0)
goto cleanup;
goto cleanup;
}
- VIR_DEBUG0("Preparing monitor state");
+ VIR_DEBUG("Preparing monitor state");
if (qemuProcessPrepareMonitorChr(driver, priv->monConfig, vm->def->name) < 0)
goto cleanup;
* use in hotplug
*/
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
- VIR_DEBUG0("Assigning domain PCI addresses");
+ VIR_DEBUG("Assigning domain PCI addresses");
/* Populate cache with current addresses */
if (priv->pciaddrs) {
qemuDomainPCIAddressSetFree(priv->pciaddrs);
priv->persistentAddrs = 0;
}
- VIR_DEBUG0("Building emulator command line");
+ VIR_DEBUG("Building emulator command line");
if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
priv->monJSON != 0, priv->qemuCaps,
migrateFrom, stdin_fd,
if (ret == -1) /* The VM failed to start */
goto cleanup;
- VIR_DEBUG0("Waiting for monitor to show up");
+ VIR_DEBUG("Waiting for monitor to show up");
if (qemuProcessWaitForMonitor(driver, vm, pos) < 0)
goto cleanup;
- VIR_DEBUG0("Detecting VCPU PIDs");
+ VIR_DEBUG("Detecting VCPU PIDs");
if (qemuProcessDetectVcpuPIDs(driver, vm) < 0)
goto cleanup;
- VIR_DEBUG0("Setting VCPU affinities");
+ VIR_DEBUG("Setting VCPU affinities");
if (qemuProcessSetVcpuAffinites(conn, vm) < 0)
goto cleanup;
- VIR_DEBUG0("Setting any required VM passwords");
+ VIR_DEBUG("Setting any required VM passwords");
if (qemuProcessInitPasswords(conn, driver, vm) < 0)
goto cleanup;
/* If we have -device, then addresses are assigned explicitly.
* If not, then we have to detect dynamic ones here */
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)
goto cleanup;
}
- VIR_DEBUG0("Setting initial memory amount");
+ VIR_DEBUG("Setting initial memory amount");
cur_balloon = vm->def->mem.cur_balloon;
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuMonitorSetBalloon(priv->mon, cur_balloon) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
if (!start_paused) {
- VIR_DEBUG0("Starting domain CPUs");
+ VIR_DEBUG("Starting domain CPUs");
/* Allow the CPUS to start executing */
if (qemuProcessStartCPUs(driver, vm, conn) < 0) {
if (virGetLastError() == NULL)
}
- VIR_DEBUG0("Writing domain status to disk");
+ VIR_DEBUG("Writing domain status to disk");
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
goto cleanup;
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 */
if ((priv->watch = virEventAddHandle(priv->sock,
VIR_EVENT_HANDLE_READABLE,
remoteDomainEventFired,
conn, NULL)) < 0) {
- VIR_DEBUG0("virEventAddHandle failed: No addHandleImpl defined."
+ VIR_DEBUG("virEventAddHandle failed: No addHandleImpl defined."
" continuing without events.");
} else {
- VIR_DEBUG0("Adding Timeout for remote event queue flushing");
+ VIR_DEBUG("Adding Timeout for remote event queue flushing");
if ( (priv->eventFlushTimer = virEventAddTimeout(-1,
remoteDomainEventQueueFlush,
conn, NULL)) < 0) {
- VIR_DEBUG0("virEventAddTimeout failed: No addTimeoutImpl defined. "
+ VIR_DEBUG("virEventAddTimeout failed: No addTimeoutImpl defined. "
"continuing without events.");
virEventRemoveHandle(priv->watch);
priv->watch = -1;
(STREQ(conn->uri->path, "/session") ||
STRPREFIX(conn->uri->scheme, "test+")) &&
getuid() > 0) {
- VIR_DEBUG0("Auto-spawn user daemon instance");
+ VIR_DEBUG("Auto-spawn user daemon instance");
rflags |= VIR_DRV_OPEN_REMOTE_USER;
if (!autostart ||
STRNEQ(autostart, "0"))
* to the UNIX socket anyway.
*/
if (!conn->uri) {
- VIR_DEBUG0("Auto-probe remote URI");
+ VIR_DEBUG("Auto-probe remote URI");
#ifndef __sun
if (getuid() > 0) {
- VIR_DEBUG0("Auto-spawn user daemon instance");
+ VIR_DEBUG("Auto-spawn user daemon instance");
rflags |= VIR_DRV_OPEN_REMOTE_USER;
if (!autostart ||
STRNEQ(autostart, "0"))
/* Verify certificate. */
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)
goto cleanup;
}
int ret = -1;
const char *mechlist;
- VIR_DEBUG0("Client initialize SASL authentication");
+ VIR_DEBUG("Client initialize SASL authentication");
/* Sets up the SASL library as a whole */
err = sasl_client_init(NULL);
if (err != SASL_OK) {
priv->is_secure = 1;
}
- VIR_DEBUG0("SASL authentication complete");
+ VIR_DEBUG("SASL authentication complete");
priv->saslconn = saslconn;
ret = 0;
virConnectAuthPtr auth ATTRIBUTE_UNUSED)
{
remote_auth_polkit_ret ret;
- VIR_DEBUG0("Client initialize PolicyKit-1 authentication");
+ VIR_DEBUG("Client initialize PolicyKit-1 authentication");
memset (&ret, 0, sizeof ret);
if (call (conn, priv, in_open, REMOTE_PROC_AUTH_POLKIT,
return -1; /* virError already set by call */
}
- VIR_DEBUG0("PolicyKit-1 authentication complete");
+ VIR_DEBUG("PolicyKit-1 authentication complete");
return 0;
}
# elif HAVE_POLKIT0
NULL,
0,
};
- VIR_DEBUG0("Client initialize PolicyKit-0 authentication");
+ VIR_DEBUG("Client initialize PolicyKit-0 authentication");
if (auth && auth->cb) {
/* Check if the necessary credential type for PolicyKit is supported */
}
if (allowcb) {
- VIR_DEBUG0("Client run callback for PolicyKit authentication");
+ VIR_DEBUG("Client run callback for PolicyKit authentication");
/* Run the authentication callback */
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
remoteError(VIR_ERR_AUTH_FAILED, "%s",
return -1;
}
} else {
- VIR_DEBUG0("Client auth callback does not support PolicyKit");
+ VIR_DEBUG("Client auth callback does not support PolicyKit");
}
} else {
- VIR_DEBUG0("No auth callback provided");
+ VIR_DEBUG("No auth callback provided");
}
memset (&ret, 0, sizeof ret);
return -1; /* virError already set by call */
}
- VIR_DEBUG0("PolicyKit-0 authentication complete");
+ VIR_DEBUG("PolicyKit-0 authentication complete");
return 0;
}
# endif /* HAVE_POLKIT0 */
if ((privst->incomingOffset &&
(privst->cbEvents & VIR_STREAM_EVENT_READABLE)) ||
(privst->cbEvents & VIR_STREAM_EVENT_WRITABLE)) {
- VIR_DEBUG0("Enabling event timer");
+ VIR_DEBUG("Enabling event timer");
virEventUpdateTimeout(privst->cbTimer, 0);
} else {
- VIR_DEBUG0("Disabling event timer");
+ VIR_DEBUG("Disabling event timer");
virEventUpdateTimeout(privst->cbTimer, -1);
}
}
return 0;
}
- VIR_DEBUG0("Raising async error");
+ VIR_DEBUG("Raising async error");
virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__,
privst->err.domain,
privst->err.code,
int ret;
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;
goto cleanup;
}
if (virDomainEventQueuePush(priv->domainEvents,
event) < 0) {
- VIR_DEBUG0("Error adding event to queue");
+ VIR_DEBUG("Error adding event to queue");
virDomainEventFree(event);
}
virEventUpdateTimeout(priv->eventFlushTimer, 0);
case REMOTE_CONTINUE: {
int avail = privst->incomingLength - privst->incomingOffset;
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 */
int extra = need - avail;
if (VIR_REALLOC_N(privst->incoming,
privst->incomingLength + extra) < 0) {
- VIR_DEBUG0("Out of memory handling stream data");
+ VIR_DEBUG("Out of memory handling stream data");
return -1;
}
privst->incomingLength += extra;
}
case REMOTE_OK:
- VIR_DEBUG0("Got a synchronous confirm");
+ VIR_DEBUG("Got a synchronous confirm");
if (!thecall) {
- VIR_DEBUG0("Got unexpected stream finish confirmation");
+ VIR_DEBUG("Got unexpected stream finish confirmation");
return -1;
}
thecall->mode = REMOTE_MODE_COMPLETE;
case REMOTE_ERROR:
if (thecall && thecall->want_reply) {
- VIR_DEBUG0("Got a synchronous error");
+ VIR_DEBUG("Got a synchronous error");
/* Give the error straight to this call */
memset (&thecall->err, 0, sizeof thecall->err);
if (!xdr_remote_error (xdr, &thecall->err)) {
}
thecall->mode = REMOTE_MODE_ERROR;
} else {
- VIR_DEBUG0("Got a asynchronous error");
+ VIR_DEBUG("Got a asynchronous error");
/* No call, so queue the error against the stream */
if (privst->has_error) {
- VIR_DEBUG0("Got unexpected duplicate stream error");
+ VIR_DEBUG("Got unexpected duplicate stream error");
return -1;
}
privst->has_error = 1;
memset (&privst->err, 0, sizeof privst->err);
if (!xdr_remote_error (xdr, &privst->err)) {
- VIR_DEBUG0("Failed to unmarshall error");
+ VIR_DEBUG("Failed to unmarshall error");
return -1;
}
}
if (fds[1].revents) {
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));
if (s < 0) {
virReportSystemError(errno, "%s",
}
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:
remoteDriverUnlock(priv);
return 0;
out_of_memory:
- VIR_ERROR0(_("Out of memory initializing secrets"));
+ VIR_ERROR(_("Out of memory initializing secrets"));
error:
VIR_FREE(base);
secretDriverUnlock(driverState);
* worst that happens is that scanning doesn't pick everything up
*/
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));
if ((privconn->domainEventTimer =
virEventAddTimeout(-1, testDomainEventFlush, privconn, NULL)) < 0)
- VIR_DEBUG0("virEventAddTimeout failed: No addTimeoutImpl defined. "
+ VIR_DEBUG("virEventAddTimeout failed: No addTimeoutImpl defined. "
"continuing without events.");
testDriverUnlock(privconn);
}
*/
if (nodeCapsInitNUMA(caps) < 0) {
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)) {
goto error;
return 0;
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;
}
dom->state = VIR_DOMAIN_RUNNING;
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);
} 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);
}
}
uml_driver->caps->privateDataFreeFunc = umlDomainObjPrivateFree;
if ((uml_driver->inotifyFD = inotify_init()) < 0) {
- VIR_ERROR0(_("cannot initialize inotify"));
+ VIR_ERROR(_("cannot initialize inotify"));
goto error;
}
return 0;
out_of_memory:
- VIR_ERROR0(_("umlStartup: out of memory"));
+ VIR_ERROR(_("umlStartup: out of memory"));
error:
VIR_FREE(userdir);
int err;
int ret = 0;
brControl *brctl = NULL;
- VIR_ERROR0(_("Cleanup tap"));
+ VIR_ERROR(_("Cleanup tap"));
if (brInit(&brctl) < 0)
return -1;
ret = -1;
}
}
- VIR_ERROR0(_("Cleanup tap done"));
+ VIR_ERROR(_("Cleanup tap done"));
brShutdown(brctl);
return ret;
}
struct ifreq dummy;
if (ioctl(tapfd, TUNGETFEATURES, &features) != 0) {
- VIR_INFO0(_("Not enabling IFF_VNET_HDR; "
+ VIR_INFO(_("Not enabling IFF_VNET_HDR; "
"TUNGETFEATURES ioctl() not implemented"));
return 0;
}
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"));
return 0;
}
* If TUNGETIFF is not implemented then 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"));
return 0;
}
- VIR_INFO0(_("Enabling IFF_VNET_HDR"));
+ VIR_INFO(_("Enabling IFF_VNET_HDR"));
return 1;
# else
(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;
# endif
}
mounts = fopen("/proc/mounts", "r");
if (mounts == NULL) {
- VIR_ERROR0(_("Unable to open /proc/mounts"));
+ VIR_ERROR(_("Unable to open /proc/mounts"));
return -ENOENT;
}
mapping = fopen("/proc/self/cgroup", "r");
if (mapping == NULL) {
- VIR_ERROR0(_("Unable to open /proc/self/cgroup"));
+ VIR_ERROR(_("Unable to open /proc/self/cgroup"));
return -ENOENT;
}
if (cmd->pwd) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot set directory twice");
+ VIR_DEBUG("cannot set directory twice");
} else {
cmd->pwd = strdup(pwd);
if (!cmd->pwd)
if (cmd->infd != -1 || cmd->inbuf) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify input twice");
+ VIR_DEBUG("cannot specify input twice");
return;
}
if (cmd->outfdptr) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify output twice");
+ VIR_DEBUG("cannot specify output twice");
return;
}
if (cmd->errfdptr) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify stderr twice");
+ VIR_DEBUG("cannot specify stderr twice");
return;
}
if (cmd->infd != -1 || cmd->inbuf) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify input twice");
+ VIR_DEBUG("cannot specify input twice");
return;
}
if (infd < 0) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify invalid input fd");
+ VIR_DEBUG("cannot specify invalid input fd");
return;
}
if (cmd->outfdptr) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify output twice");
+ VIR_DEBUG("cannot specify output twice");
return;
}
if (cmd->errfdptr) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify stderr twice");
+ VIR_DEBUG("cannot specify stderr twice");
return;
}
if (cmd->hook) {
cmd->has_error = -1;
- VIR_DEBUG0("cannot specify hook twice");
+ VIR_DEBUG("cannot specify hook twice");
return;
}
cmd->hook = hook;
*/
int virEventRegisterDefaultImpl(void)
{
- VIR_DEBUG0("");
+ VIR_DEBUG("registering default event implementation");
virResetLastError();
*/
int virEventRunDefaultImpl(void)
{
- VIR_DEBUG0("");
+ VIR_DEBUG("running default event implementation");
virResetLastError();
if (virEventPollRunOnce() < 0) {
return 0;
}
- VIR_DEBUG0("Interrupting");
+ VIR_DEBUG("Interrupting");
if (safewrite(eventLoop.wakeupfd[1], &c, sizeof(c)) != sizeof(c))
return -1;
return 0;
#define virHashIterationError(ret) \
do { \
- VIR_ERROR0(_("Hash operation not allowed during iteration")); \
+ VIR_ERROR(_("Hash operation not allowed during iteration")); \
return ret; \
} while (0)
} else {
virJSONParserStatePtr state;
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;
}
switch (state->value->type) {
case VIR_JSON_TYPE_OBJECT: {
if (!state->key) {
- VIR_DEBUG0("missing key when inserting object value");
+ VIR_DEBUG("missing key when inserting object value");
return -1;
}
case VIR_JSON_TYPE_ARRAY: {
if (state->key) {
- VIR_DEBUG0("unexpected key when inserting array value");
+ VIR_DEBUG("unexpected key when inserting array value");
return -1;
}
} break;
default:
- VIR_DEBUG0("unexpected value type, not a container");
+ VIR_DEBUG("unexpected value type, not a container");
return -1;
}
}
virLogDefaultPriority = VIR_LOG_DEFAULT;
virLogUnlock();
if (pbm)
- VIR_WARN0(pbm);
+ VIR_WARN("%s", pbm);
return 0;
}
*/
int virLogSetDefaultPriority(int priority) {
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;
}
if (!virLogInitialized)
ret = count;
cleanup:
if (ret == -1)
- VIR_WARN0("Ignoring invalid log output setting.");
+ VIR_WARN("Ignoring invalid log output setting.");
return ret;
}
ret = count;
cleanup:
if (ret == -1)
- VIR_WARN0("Ignoring invalid log filter setting.");
+ VIR_WARN("Ignoring invalid log filter setting.");
return ret;
}
else if (STREQ(priority, "4") || STREQ(priority, "error"))
ret = virLogSetDefaultPriority(VIR_LOG_ERROR);
else
- VIR_WARN0("Ignoring invalid log level setting");
+ VIR_WARN("Ignoring invalid log level setting");
return ret;
}
*/
# ifdef ENABLE_DEBUG
# 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
# define VIR_DEBUG_INT(category, f, l, fmt,...) \
do { } while (0)
# endif /* !ENABLE_DEBUG */
# 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,...) \
- 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,...) \
- 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,...) \
- VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
-# define VIR_DEBUG0(msg) \
- VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
+ VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
# define VIR_INFO(fmt,...) \
- VIR_INFO_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
-# define VIR_INFO0(msg) \
- VIR_INFO_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
+ VIR_INFO_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
# define VIR_WARN(fmt,...) \
- VIR_WARN_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
-# define VIR_WARN0(msg) \
- VIR_WARN_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
+ VIR_WARN_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
# define VIR_ERROR(fmt,...) \
- VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
-# define VIR_ERROR0(msg) \
- VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, "%s", msg)
+ VIR_ERROR_INT("file." __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__)
/*
* To be made public
dir = opendir(PCI_SYSFS "devices");
if (!dir) {
- VIR_WARN0("Failed to open " PCI_SYSFS "devices");
+ VIR_WARN("Failed to open " PCI_SYSFS "devices");
return -1;
}
* unbind might succeed anyway, and besides, it's very likely we have
* 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;
}
# else
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;
}
# endif
}
if ((hook)(data) != 0) {
- VIR_DEBUG0("Hook function failed.");
+ VIR_DEBUG("Hook function failed.");
goto fork_error;
}
VIR_DEBUG("%s %s", envp_str, argv_str);
VIR_FREE(envp_str);
} else {
- VIR_DEBUG0(argv_str);
+ VIR_DEBUG("%s", argv_str);
}
VIR_FREE(argv_str);
virReportOOMError();
goto error;
}
- VIR_DEBUG0(argv_str);
+ VIR_DEBUG("%s", argv_str);
if ((execret = __virExec(argv, NULL, NULL,
&childpid, -1, &outfd, &errfd,
va_start(args, fmt);
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;
}
va_end(args);
* number 51, thus the version ranges in the if statements below.
*/
if (uVersion >= 2001052 && uVersion < 2002051) {
- VIR_DEBUG0("VirtualBox API version: 2.2");
+ VIR_DEBUG("VirtualBox API version: 2.2");
driver = &vbox22Driver;
networkDriver = &vbox22NetworkDriver;
storageDriver = &vbox22StorageDriver;
} else if (uVersion >= 2002051 && uVersion < 3000051) {
- VIR_DEBUG0("VirtualBox API version: 3.0");
+ VIR_DEBUG("VirtualBox API version: 3.0");
driver = &vbox30Driver;
networkDriver = &vbox30NetworkDriver;
storageDriver = &vbox30StorageDriver;
} else if (uVersion >= 3000051 && uVersion < 3001051) {
- VIR_DEBUG0("VirtualBox API version: 3.1");
+ VIR_DEBUG("VirtualBox API version: 3.1");
driver = &vbox31Driver;
networkDriver = &vbox31NetworkDriver;
storageDriver = &vbox31StorageDriver;
} else if (uVersion >= 3001051 && uVersion < 3002051) {
- VIR_DEBUG0("VirtualBox API version: 3.2");
+ VIR_DEBUG("VirtualBox API version: 3.2");
driver = &vbox32Driver;
networkDriver = &vbox32NetworkDriver;
storageDriver = &vbox32StorageDriver;
} else if (uVersion >= 3002051 && uVersion < 4000051) {
- VIR_DEBUG0("VirtualBox API version: 4.0");
+ VIR_DEBUG("VirtualBox API version: 4.0");
driver = &vbox40Driver;
networkDriver = &vbox40NetworkDriver;
storageDriver = &vbox40StorageDriver;
} else {
- VIR_DEBUG0("Unsupport VirtualBox API version");
+ VIR_DEBUG("Unsupport VirtualBox API version");
}
} else {
- VIR_DEBUG0("VBoxCGlueInit failed, using dummy driver");
+ VIR_DEBUG("VBoxCGlueInit failed, using dummy driver");
}
if (virRegisterDriver(driver) < 0)
#endif /* !(VBOX_API_VERSION == 2002) */
conn->privateData = data;
- VIR_DEBUG0("in vboxOpen");
+ VIR_DEBUG("in vboxOpen");
return VIR_DRV_OPEN_SUCCESS;
}
if (def->disks[i]->readonly) {
hardDisk->vtbl->SetType(hardDisk,
HardDiskType_Immutable);
- VIR_DEBUG0("setting harddisk to readonly");
+ VIR_DEBUG("setting harddisk to readonly");
} else if (!def->disks[i]->readonly) {
hardDisk->vtbl->SetType(hardDisk,
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 (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");
} else {
PRInt32 channel = 0;
if (def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
if (def->disks[i]->readonly) {
medium->vtbl->SetType(medium, MediumType_Immutable);
- VIR_DEBUG0("setting harddisk to immutable");
+ VIR_DEBUG("setting harddisk to immutable");
} else if (!def->disks[i]->readonly) {
medium->vtbl->SetType(medium, MediumType_Normal);
- VIR_DEBUG0("setting harddisk type to normal");
+ VIR_DEBUG("setting harddisk type to normal");
}
}
#endif /* VBOX_API_VERSION >= 4000 */
if (VRDxServer) {
VRDxServer->vtbl->SetEnabled(VRDxServer, PR_TRUE);
- VIR_DEBUG0("VRDP Support turned ON.");
+ VIR_DEBUG("VRDP Support turned ON.");
#if VBOX_API_VERSION < 3001
if (def->graphics[i]->data.rdp.port) {
* the default one which is 3389 currently
*/
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 */
PRUnichar *portUtf16 = NULL;
if (def->graphics[i]->data.rdp.replaceUser) {
VRDxServer->vtbl->SetReuseSingleConnection(VRDxServer,
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) {
VRDxServer->vtbl->SetAllowMultiConnection(VRDxServer,
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) {
(data->vboxSession == NULL))
goto cleanup;
- VIR_DEBUG0("network initialized");
+ VIR_DEBUG("network initialized");
/* conn->networkPrivateData = some network specific data */
return VIR_DRV_OPEN_SUCCESS;
}
static int vboxNetworkClose(virConnectPtr conn) {
- VIR_DEBUG0("network uninitialized");
+ VIR_DEBUG("network uninitialized");
conn->networkPrivateData = NULL;
return 0;
}
data->vboxObj->vtbl->CreateDHCPServer(data->vboxObj,
networkNameUtf16,
&dhcpServer);
- VIR_DEBUG0("couldn't find dhcp server so creating one");
+ VIR_DEBUG("couldn't find dhcp server so creating one");
}
if (dhcpServer) {
PRUnichar *ipAddressUtf16 = NULL;
(data->vboxSession == NULL))
goto cleanup;
- VIR_DEBUG0("vbox storage initialized");
+ VIR_DEBUG("vbox storage initialized");
/* conn->storagePrivateData = some storage specific data */
return VIR_DRV_OPEN_SUCCESS;
}
static int vboxStorageClose (virConnectPtr conn) {
- VIR_DEBUG0("vbox storage uninitialized");
+ VIR_DEBUG("vbox storage uninitialized");
conn->storagePrivateData = NULL;
return 0;
}
#endif /* VBOX_API_VERSION >= 3001 */
if (NS_SUCCEEDED(rc)) {
rc = machine->vtbl->SaveSettings(machine);
- VIR_DEBUG0("saving machine settings");
+ VIR_DEBUG("saving machine settings");
}
if (NS_SUCCEEDED(rc)) {
}
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");
(*def)->data.vnc.port = 0;
virBufferAsprintf(buffer, "RemoteDisplay.vnc.enabled = \"true\"\n");
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");
} else {
if (def->data.vnc.port < 5900 || def->data.vnc.port > 5964) {
/* Hypervisor is only run with privilege & required to succeed */
if (xenHavePrivilege()) {
- VIR_DEBUG0("Trying hypervisor sub-driver");
+ VIR_DEBUG("Trying hypervisor sub-driver");
if (drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
- VIR_DEBUG0("Activated hypervisor sub-driver");
+ VIR_DEBUG("Activated hypervisor sub-driver");
priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] = 1;
}
}
/* 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) ==
VIR_DRV_OPEN_SUCCESS) {
- VIR_DEBUG0("Activated XenD sub-driver");
+ VIR_DEBUG("Activated XenD sub-driver");
priv->opened[XEN_UNIFIED_XEND_OFFSET] = 1;
/* XenD is active, so try the xm & xs drivers too, both requird to
* succeed if root, optional otherwise */
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) ==
VIR_DRV_OPEN_SUCCESS) {
- VIR_DEBUG0("Activated XM sub-driver");
+ VIR_DEBUG("Activated XM sub-driver");
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) ==
VIR_DRV_OPEN_SUCCESS) {
- VIR_DEBUG0("Activated XS sub-driver");
+ VIR_DEBUG("Activated XS sub-driver");
priv->opened[XEN_UNIFIED_XS_OFFSET] = 1;
} else {
if (xenHavePrivilege())
if (xenHavePrivilege()) {
goto fail; /* XenD is mandatory when privileged */
} 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 */
goto clean;
}
xenNumaInit(conn);
if (!(priv->caps = xenHypervisorMakeCapabilities(conn))) {
- VIR_DEBUG0("Failed to make capabilities");
+ VIR_DEBUG("Failed to make capabilities");
goto fail;
}
#if WITH_XEN_INOTIFY
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) ==
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;
}
}
fail:
ret = VIR_DRV_OPEN_ERROR;
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++)
if (priv->opened[i]) drivers[i]->close(conn);
virMutexDestroy(&priv->lock);
for (n=0; n < list->count; n++) {
if (STREQ(list->doms[n]->name, name) &&
!memcmp(list->doms[n]->uuid, uuid, VIR_UUID_BUFLEN)) {
- VIR_DEBUG0("WARNING: dom already tracked");
+ VIR_DEBUG("WARNING: dom already tracked");
return -1;
}
}
/* RHEL 5.0 */
dom_interface_version = 3; /* XEN_DOMCTL_INTERFACE_VERSION */
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;
}
/* Fedora 7 */
dom_interface_version = 4; /* XEN_DOMCTL_INTERFACE_VERSION */
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;
}
}
/* xen-3.1 */
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
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;
}
}
/* Fedora 8 */
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
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;
}
}
/* Xen 3.2, Fedora 9 */
dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */
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;
}
}
sys_interface_version = 7; /* XEN_SYSCTL_INTERFACE_VERSION */
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
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;
}
sys_interface_version = 8; /* XEN_SYSCTL_INTERFACE_VERSION */
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
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;
}
hypervisor_version = 1;
sys_interface_version = -1;
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
- VIR_DEBUG0("Using hypervisor call v1");
+ VIR_DEBUG("Using hypervisor call v1");
goto done;
}
* 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;
virXenError(VIR_ERR_XEN_CALL, " ioctl %lu",
(unsigned long)IOCTL_PRIVCMD_HYPERCALL);
memcpy(uuid, entry->def->uuid, VIR_UUID_BUFLEN);
if (!*name) {
- VIR_DEBUG0("Error getting dom from def");
+ VIR_DEBUG("Error getting dom from def");
virReportOOMError();
return -1;
}
return -1;
}
memcpy(uuid, priv->configInfoList->doms[i]->uuid, VIR_UUID_BUFLEN);
- VIR_DEBUG0("Found dom on list");
+ VIR_DEBUG("Found dom on list");
return 0;
}
}
virConnectPtr conn = data;
xenUnifiedPrivatePtr priv = NULL;
- VIR_DEBUG0("got inotify event");
+ VIR_DEBUG("got inotify event");
if( conn && conn->privateData ) {
priv = conn->privateData;
return -1;
}
- VIR_DEBUG0("Building initial config cache");
+ VIR_DEBUG("Building initial config cache");
if (priv->useXenConfigCache &&
xenXMConfigCacheRefresh (conn) < 0) {
VIR_DEBUG("Failed to enable XM config cache %s", conn->err.message);
return -1;
}
- VIR_DEBUG0("Registering with event loop");
+ VIR_DEBUG("Registering with event loop");
/* Add the handle for monitoring */
if ((priv->inotifyWatch = virEventAddHandle(priv->inotifyFD, VIR_EVENT_HANDLE_READABLE,
xenInotifyEvent, conn, NULL)) < 0) {
- VIR_DEBUG0("Failed to add inotify handle, disabling events");
+ VIR_DEBUG("Failed to add inotify handle, disabling events");
}
return 0;
if (ret == 0 && undefined_source)
xenDaemonDomainUndefine (domain);
- VIR_DEBUG0("migration done");
+ VIR_DEBUG("migration done");
return ret;
}
xenStoreWatchEvent,
conn,
NULL)) < 0)
- VIR_DEBUG0("Failed to add event handle, disabling events");
+ VIR_DEBUG("Failed to add event handle, disabling events");
return 0;
}
priv = (xenUnifiedPrivatePtr) conn->privateData;
if (xenStoreRemoveWatch(conn, "@introduceDomain", "introduceDomain") < 0) {
- VIR_DEBUG0("Warning, could not remove @introduceDomain watch");
+ VIR_DEBUG("Warning, could not remove @introduceDomain watch");
/* not fatal */
}
if (xenStoreRemoveWatch(conn, "@releaseDomain", "releaseDomain") < 0) {
- VIR_DEBUG0("Warning, could not remove @releaseDomain watch");
+ VIR_DEBUG("Warning, could not remove @releaseDomain watch");
/* not fatal */
}
list->watches[i]->path,
list->watches[i]->token))
{
- VIR_DEBUG0("WARNING: Could not remove watch");
+ VIR_DEBUG("WARNING: Could not remove watch");
/* Not fatal, continue */
}
VIR_FREE(new_domids);
if (missing && retries--) {
- VIR_DEBUG0("Some domains were missing, trying again");
+ VIR_DEBUG("Some domains were missing, trying again");
usleep(100 * 1000);
goto retry;
}
VIR_FREE(new_domids);
if (!removed && retries--) {
- VIR_DEBUG0("No domains removed, retrying");
+ VIR_DEBUG("No domains removed, retrying");
usleep(100 * 1000);
goto retry;
}
char *bufout;
int hvm = 0, i;
- VIR_DEBUG0("Formatting domain sexpr");
+ VIR_DEBUG("Formatting domain sexpr");
virBufferAddLit(&buf, "(vm ");
virBufferEscapeSexpr(&buf, "(name '%s')", def->name);