mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
fix UML driver logging macros
* src/uml_driver.c: fix UML driver logging macros, patch by Amy Griffis * AUTHORS: adding Amy Griffis Daniel
This commit is contained in:
parent
cc7499dd03
commit
9e0809911c
1
AUTHORS
1
AUTHORS
@ -74,6 +74,7 @@ Patches have also been contributed by:
|
|||||||
Doug Goldstein <cardoe@gentoo.org>
|
Doug Goldstein <cardoe@gentoo.org>
|
||||||
Javier Fontan <jfontan@gmail.com>
|
Javier Fontan <jfontan@gmail.com>
|
||||||
Federico Simoncelli <federico.simoncelli@gmail.com>
|
Federico Simoncelli <federico.simoncelli@gmail.com>
|
||||||
|
Amy Griffis <amy.griffis@hp.com>
|
||||||
|
|
||||||
[....send patches to get your name here....]
|
[....send patches to get your name here....]
|
||||||
|
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Thu Jun 25 16:57:40 CEST 2009 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
|
* src/uml_driver.c: fix UML driver logging macros, patch by Amy
|
||||||
|
Griffis
|
||||||
|
* AUTHORS: adding Amy Griffis
|
||||||
|
|
||||||
Thu Jun 25 16:50:54 CEST 2009 Daniel Veillard <veillard@redhat.com>
|
Thu Jun 25 16:50:54 CEST 2009 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* src/node_device_conf.c: fix a leak, patch by Dave Allan
|
* src/node_device_conf.c: fix a leak, patch by Dave Allan
|
||||||
|
@ -66,9 +66,6 @@
|
|||||||
|
|
||||||
static int umlShutdown(void);
|
static int umlShutdown(void);
|
||||||
|
|
||||||
#define umlLog(level, msg, ...) \
|
|
||||||
virLogMessage(__FILE__, level, __func__, __LINE__, 0, msg, __VA_ARGS__)
|
|
||||||
|
|
||||||
static void umlDriverLock(struct uml_driver *driver)
|
static void umlDriverLock(struct uml_driver *driver)
|
||||||
{
|
{
|
||||||
virMutexLock(&driver->lock);
|
virMutexLock(&driver->lock);
|
||||||
@ -95,8 +92,7 @@ static int umlSetCloseExec(int fd) {
|
|||||||
goto error;
|
goto error;
|
||||||
return 0;
|
return 0;
|
||||||
error:
|
error:
|
||||||
umlLog(VIR_LOG_ERROR,
|
VIR_ERROR0(_("Failed to set close-on-exec file descriptor flag"));
|
||||||
"%s", _("Failed to set close-on-exec file descriptor flag\n"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +132,7 @@ umlAutostartConfigs(struct uml_driver *driver) {
|
|||||||
!virDomainIsActive(driver->domains.objs[i]) &&
|
!virDomainIsActive(driver->domains.objs[i]) &&
|
||||||
umlStartVMDaemon(conn, driver, driver->domains.objs[i]) < 0) {
|
umlStartVMDaemon(conn, driver, driver->domains.objs[i]) < 0) {
|
||||||
virErrorPtr err = virGetLastError();
|
virErrorPtr err = virGetLastError();
|
||||||
umlLog(VIR_LOG_ERROR, _("Failed to autostart VM '%s': %s\n"),
|
VIR_ERROR(_("Failed to autostart VM '%s': %s"),
|
||||||
driver->domains.objs[i]->def->name, err->message);
|
driver->domains.objs[i]->def->name, err->message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -368,13 +364,13 @@ umlStartup(int privileged) {
|
|||||||
|
|
||||||
|
|
||||||
if ((uml_driver->inotifyFD = inotify_init()) < 0) {
|
if ((uml_driver->inotifyFD = inotify_init()) < 0) {
|
||||||
umlLog(VIR_LOG_ERROR, "%s", _("cannot initialize inotify"));
|
VIR_ERROR0(_("cannot initialize inotify"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virFileMakePath(uml_driver->monitorDir) < 0) {
|
if (virFileMakePath(uml_driver->monitorDir) < 0) {
|
||||||
char ebuf[1024];
|
char ebuf[1024];
|
||||||
umlLog(VIR_LOG_ERROR, _("Failed to create monitor directory %s: %s"),
|
VIR_ERROR(_("Failed to create monitor directory %s: %s"),
|
||||||
uml_driver->monitorDir, virStrerror(errno, ebuf, sizeof ebuf));
|
uml_driver->monitorDir, virStrerror(errno, ebuf, sizeof ebuf));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -407,8 +403,7 @@ umlStartup(int privileged) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_of_memory:
|
out_of_memory:
|
||||||
umlLog (VIR_LOG_ERROR,
|
VIR_ERROR0(_("umlStartup: out of memory"));
|
||||||
"%s", _("umlStartup: out of memory\n"));
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(userdir);
|
VIR_FREE(userdir);
|
||||||
@ -825,25 +820,25 @@ static int umlStartVMDaemon(virConnectPtr conn,
|
|||||||
tmp = progenv;
|
tmp = progenv;
|
||||||
while (*tmp) {
|
while (*tmp) {
|
||||||
if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
|
if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
|
||||||
umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile: %s\n"),
|
VIR_WARN(_("Unable to write envv to logfile: %s"),
|
||||||
virStrerror(errno, ebuf, sizeof ebuf));
|
virStrerror(errno, ebuf, sizeof ebuf));
|
||||||
if (safewrite(logfd, " ", 1) < 0)
|
if (safewrite(logfd, " ", 1) < 0)
|
||||||
umlLog(VIR_LOG_WARN, _("Unable to write envv to logfile: %s\n"),
|
VIR_WARN(_("Unable to write envv to logfile: %s"),
|
||||||
virStrerror(errno, ebuf, sizeof ebuf));
|
virStrerror(errno, ebuf, sizeof ebuf));
|
||||||
tmp++;
|
tmp++;
|
||||||
}
|
}
|
||||||
tmp = argv;
|
tmp = argv;
|
||||||
while (*tmp) {
|
while (*tmp) {
|
||||||
if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
|
if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
|
||||||
umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile: %s\n"),
|
VIR_WARN(_("Unable to write argv to logfile: %s"),
|
||||||
virStrerror(errno, ebuf, sizeof ebuf));
|
virStrerror(errno, ebuf, sizeof ebuf));
|
||||||
if (safewrite(logfd, " ", 1) < 0)
|
if (safewrite(logfd, " ", 1) < 0)
|
||||||
umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile: %s\n"),
|
VIR_WARN(_("Unable to write argv to logfile: %s"),
|
||||||
virStrerror(errno, ebuf, sizeof ebuf));
|
virStrerror(errno, ebuf, sizeof ebuf));
|
||||||
tmp++;
|
tmp++;
|
||||||
}
|
}
|
||||||
if (safewrite(logfd, "\n", 1) < 0)
|
if (safewrite(logfd, "\n", 1) < 0)
|
||||||
umlLog(VIR_LOG_WARN, _("Unable to write argv to logfile: %s\n"),
|
VIR_WARN(_("Unable to write argv to logfile: %s"),
|
||||||
virStrerror(errno, ebuf, sizeof ebuf));
|
virStrerror(errno, ebuf, sizeof ebuf));
|
||||||
|
|
||||||
vm->monitor = -1;
|
vm->monitor = -1;
|
||||||
@ -888,8 +883,7 @@ static void umlShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
vm->monitor = -1;
|
vm->monitor = -1;
|
||||||
|
|
||||||
if ((ret = waitpid(vm->pid, NULL, 0)) != vm->pid) {
|
if ((ret = waitpid(vm->pid, NULL, 0)) != vm->pid) {
|
||||||
umlLog(VIR_LOG_WARN,
|
VIR_WARN(_("Got unexpected pid %d != %d"),
|
||||||
_("Got unexpected pid %d != %d\n"),
|
|
||||||
ret, vm->pid);
|
ret, vm->pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user