Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 155812 Details for
Bug 241793
xm create many domains in a tight loop, later domains crash after starting
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
xenconsoled logging (patch 1/2)
xen-console-log.patch (text/x-patch), 5.00 KB, created by
Richard W.M. Jones
on 2007-05-31 13:17:30 UTC
(
hide
)
Description:
xenconsoled logging (patch 1/2)
Filename:
MIME Type:
Creator:
Richard W.M. Jones
Created:
2007-05-31 13:17:30 UTC
Size:
5.00 KB
patch
obsolete
>diff -rup xen-3.1.0-testing.hg-rc7.orig/tools/console/daemon/io.c xen-3.1.0-testing.hg-rc7.new/tools/console/daemon/io.c >--- xen-3.1.0-testing.hg-rc7.orig/tools/console/daemon/io.c 2007-05-03 12:49:28.000000000 -0400 >+++ xen-3.1.0-testing.hg-rc7.new/tools/console/daemon/io.c 2007-05-30 17:39:12.000000000 -0400 >@@ -44,6 +44,10 @@ > /* Each 10 bits takes ~ 3 digits, plus one, plus one for nul terminator. */ > #define MAX_STRLEN(x) ((sizeof(x) * CHAR_BIT + CHAR_BIT-1) / 10 * 3 + 2) > >+extern int log_reload; >+extern int log_guest; >+extern char *log_dir; >+ > struct buffer > { > char *data; >@@ -57,6 +61,7 @@ struct domain > { > int domid; > int tty_fd; >+ int log_fd; > bool is_dead; > struct buffer buffer; > struct domain *next; >@@ -352,6 +357,21 @@ static bool watch_domain(struct domain * > return success; > } > >+static int create_domain_log(int domid) >+{ >+ char logfile[PATH_MAX]; >+ int fd; >+ snprintf(logfile, PATH_MAX-1, "%s/guest-%d.log", log_dir, domid); >+ logfile[PATH_MAX-1] = '\0'; >+ >+ fd = open(logfile, O_WRONLY|O_CREAT|O_TRUNC, 0644); >+ if (fd == -1) >+ dolog(LOG_ERR, "Failed to open log %s: %d (%s)", >+ logfile, errno, strerror(errno)); >+ return fd; >+} >+ >+ > static struct domain *create_domain(int domid) > { > struct domain *dom; >@@ -383,6 +403,12 @@ static struct domain *create_domain(int > strcat(dom->conspath, "/console"); > > dom->tty_fd = -1; >+ >+ if (log_guest) >+ dom->log_fd = create_domain_log(domid); >+ else >+ dom->log_fd = -1; >+ > dom->is_dead = false; > dom->buffer.data = 0; > dom->buffer.consumed = 0; >@@ -444,6 +470,10 @@ static void cleanup_domain(struct domain > close(d->tty_fd); > d->tty_fd = -1; > } >+ if (d->log_fd != -1) { >+ close(d->log_fd); >+ d->log_fd = -1; >+ } > > free(d->buffer.data); > d->buffer.data = NULL; >@@ -550,6 +580,14 @@ static void handle_tty_write(struct doma > { > ssize_t len; > >+ if (dom->log_fd != -1) { >+ len = write(dom->log_fd, dom->buffer.data + dom->buffer.consumed, >+ dom->buffer.size - dom->buffer.consumed); >+ if (len < 1) >+ dolog(LOG_DEBUG, "Write to log failed on domain %d: %zd, %d\n", >+ dom->domid, len, errno); >+ } >+ > len = write(dom->tty_fd, dom->buffer.data + dom->buffer.consumed, > dom->buffer.size - dom->buffer.consumed); > if (len < 1) { >@@ -605,6 +643,18 @@ static void handle_xs(void) > free(vec); > } > >+void handle_log_reload(void) >+{ >+ struct domain *d; >+ for (d = dom_head; d; d = d->next) { >+ if (d->log_fd == -1) >+ continue; >+ >+ close(d->log_fd); >+ d->log_fd = create_domain_log(d->domid); >+ } >+} >+ > void handle_io(void) > { > fd_set readfds, writefds; >@@ -639,6 +689,11 @@ void handle_io(void) > > ret = select(max_fd + 1, &readfds, &writefds, 0, NULL); > >+ if (log_reload) { >+ handle_log_reload(); >+ log_reload = 0; >+ } >+ > if (FD_ISSET(xs_fileno(xs), &readfds)) > handle_xs(); > >Only in xen-3.1.0-testing.hg-rc7.new/tools/console/daemon: io.c~ >diff -rup xen-3.1.0-testing.hg-rc7.orig/tools/console/daemon/main.c xen-3.1.0-testing.hg-rc7.new/tools/console/daemon/main.c >--- xen-3.1.0-testing.hg-rc7.orig/tools/console/daemon/main.c 2007-05-03 12:49:28.000000000 -0400 >+++ xen-3.1.0-testing.hg-rc7.new/tools/console/daemon/main.c 2007-05-30 22:46:29.000000000 -0400 >@@ -23,6 +23,8 @@ > #include <stdio.h> > #include <errno.h> > #include <unistd.h> >+#include <string.h> >+#include <signal.h> > #include <sys/types.h> > > #include "xenctrl.h" >@@ -30,9 +32,19 @@ > #include "utils.h" > #include "io.h" > >+int log_reload = 0; >+int log_guest = 1; >+int log_hv = 1; >+char *log_dir = NULL; >+ >+static void handle_hup(int sig) >+{ >+ log_reload = 1; >+} >+ > static void usage(char *name) > { >- printf("Usage: %s [-h] [-V] [-v] [-i]\n", name); >+ printf("Usage: %s [-h] [-V] [-v] [-i] [--log=none|guest|hv|all] [--logdir=DIR]\n", name); > } > > static void version(char *name) >@@ -48,6 +60,8 @@ int main(int argc, char **argv) > { "version", 0, 0, 'V' }, > { "verbose", 0, 0, 'v' }, > { "interactive", 0, 0, 'i' }, >+ { "log", 1, 0, 'l' }, >+ { "logdir", 1, 0, 'r' }, > { 0 }, > }; > bool is_interactive = false; >@@ -71,6 +85,19 @@ int main(int argc, char **argv) > case 'i': > is_interactive = true; > break; >+ case 'l': >+ if (!strcmp(optarg, "none")) { >+ log_hv = 0; >+ log_guest = 0; >+ } else if (!strcmp(optarg, "hv")) { >+ log_guest = 0; >+ } else if (!strcmp(optarg, "guest")) { >+ log_hv = 0; >+ } >+ break; >+ case 'r': >+ log_dir = strdup(optarg); >+ break; > case '?': > fprintf(stderr, > "Try `%s --help' for more information\n", >@@ -79,11 +106,17 @@ int main(int argc, char **argv) > } > } > >+ if (!log_dir) { >+ log_dir = strdup("/var/log/xen/console"); >+ } >+ > if (geteuid() != 0) { > fprintf(stderr, "%s requires root to run.\n", argv[0]); > exit(EPERM); > } > >+ signal(SIGHUP, handle_hup); >+ > openlog("xenconsoled", syslog_option, LOG_DAEMON); > setlogmask(syslog_mask); > >@@ -99,6 +132,7 @@ int main(int argc, char **argv) > handle_io(); > > closelog(); >+ free(log_dir); > > return 0; > } >Only in xen-3.1.0-testing.hg-rc7.new/tools/console/daemon: main.c~ >Only in xen-3.1.0-testing.hg-rc7.new/tools/xenfb: xenfb.c.orig
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 241793
:
155716
|
155717
|
155718
|
155723
|
155724
|
155725
|
155811
| 155812 |
155813
|
155816
|
155883