ia64/xen-unstable

changeset 13499:5859be201110

[HVM] Save/restore: Sometimes the hg changeset is not available.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Thu Jan 18 16:48:11 2007 +0000 (2007-01-18)
parents 53a1dbb70386
children f78cca1e57a2
files xen/arch/x86/hvm/intercept.c
line diff
     1.1 --- a/xen/arch/x86/hvm/intercept.c	Thu Jan 18 16:48:10 2007 +0000
     1.2 +++ b/xen/arch/x86/hvm/intercept.c	Thu Jan 18 16:48:11 2007 +0000
     1.3 @@ -210,7 +210,11 @@ int hvm_save(struct vcpu *v, hvm_domain_
     1.4      hvm_put_32u(h, HVM_FILE_VERSION);
     1.5  
     1.6      /* save xen changeset */
     1.7 -    chgset = strrchr(XEN_CHANGESET, ' ') + 1;
     1.8 +    chgset = strrchr(XEN_CHANGESET, ' ');
     1.9 +    if ( chgset )
    1.10 +        chgset++;
    1.11 +    else
    1.12 +        chgset = XEN_CHANGESET;
    1.13  
    1.14      len = strlen(chgset);
    1.15      hvm_put_8u(h, len);
    1.16 @@ -303,7 +307,11 @@ int hvm_load(struct vcpu *v, hvm_domain_
    1.17      }
    1.18  
    1.19      /* check xen change set */
    1.20 -    cur_chgset = strrchr(XEN_CHANGESET, ' ') + 1;
    1.21 +    cur_chgset = strrchr(XEN_CHANGESET, ' ');
    1.22 +    if ( cur_chgset )
    1.23 +        cur_chgset++;
    1.24 +    else
    1.25 +        cur_chgset = XEN_CHANGESET;
    1.26  
    1.27      len = hvm_get_8u(h);
    1.28      if (len > 20) { /*typical length is 18 -- "revision number:changeset id" */
    1.29 @@ -317,6 +325,11 @@ int hvm_load(struct vcpu *v, hvm_domain_
    1.30          printk("warnings: try to restore hvm guest(%s) on a different changeset %s.\n",
    1.31                  chgset, cur_chgset);
    1.32  
    1.33 +
    1.34 +    if ( !strcmp(cur_chgset, "unavailable") )
    1.35 +        printk("warnings: try to restore hvm guest when changeset is unavailable.\n");
    1.36 +
    1.37 +
    1.38      /* check cpuid */
    1.39      cpuid(1, &eax, &ebx, &ecx, &edx);
    1.40      ebx = hvm_get_32u(h);