ia64/xen-unstable

changeset 15274:f45c84dd5f41

qemu: Use domid in qemu log name. Can be related back to domain name
or uuid via xend logs, less unique than pids to prevent excessive
number of log files hanging around, yet not immediately reused (unlike
e.g., after domain crash or reboot) where previous log file is
immediately overwritten. Not using domain names in logs avoids and
chance of unprintable charcatres becoming embedded in filenames.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Jun 05 09:59:34 2007 +0100 (2007-06-05)
parents 23460646912e
children 91301122db51
files tools/ioemu/vl.c
line diff
     1.1 --- a/tools/ioemu/vl.c	Tue Jun 05 08:57:53 2007 +0100
     1.2 +++ b/tools/ioemu/vl.c	Tue Jun 05 09:59:34 2007 +0100
     1.3 @@ -183,7 +183,7 @@ extern int vcpus;
     1.4  
     1.5  int xc_handle;
     1.6  
     1.7 -char domain_name[64] = "Xen HVM Guest";
     1.8 +char domain_name[64] = "Xen-HVM-no-name";
     1.9  extern int domid;
    1.10  
    1.11  char vncpasswd[64];
    1.12 @@ -7525,8 +7525,8 @@ int main(int argc, char **argv)
    1.13                  semihosting_enabled = 1;
    1.14                  break;
    1.15              case QEMU_OPTION_domainname:
    1.16 -                strncpy(domain_name, optarg, sizeof(domain_name));
    1.17 -                domain_name[sizeof(domain_name)-1] = '\0';
    1.18 +                snprintf(domain_name, sizeof(domain_name),
    1.19 +                         "Xen-HVM-%s", optarg);
    1.20                  break;
    1.21              case QEMU_OPTION_d:
    1.22                  domid = atoi(optarg);
    1.23 @@ -7550,7 +7550,7 @@ int main(int argc, char **argv)
    1.24      }
    1.25  
    1.26      /* Now send logs to our named config */
    1.27 -    sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm-%s.log", domain_name);
    1.28 +    sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm-%d.log", domid);
    1.29      cpu_set_log_filename(qemu_dm_logfilename);
    1.30  
    1.31  #ifndef _WIN32