[Libvir] VIR_DOMAIN_NOSTATE

Russ Blaine russell.blaine at sun.com
Tue Jan 29 18:21:40 UTC 2008


Daniel P. Berrange wrote:
> What hypervisor version are you running. I'm struggling to see the codepath
> in the hypervisor 'getdomaininfo' call which could lead to domain_flags
> being zero.  AFAICT, as well as the HVM flags, there must always be at
> least one other bit set.

This is opensolaris 81 with xen 3.1.2. Not having studied this code 
extensively, I do see a path that could cause this:

flags starts out life as XEN_DOMINF_blocked

That flag then gets cleared in this marked line:

>     int flags = XEN_DOMINF_blocked;
> 
>     for_each_vcpu ( d, v )
>     {
>         ....
>         if ( !test_bit(_VPF_down, &v->pause_flags) )
>         {
>             if ( !(v->pause_flags & VPF_blocked) )
>                 flags &= ~XEN_DOMINF_blocked;		<-----here
>             if ( v->is_running )
>                 flags |= XEN_DOMINF_running;
>             info->nr_online_vcpus++;
>         }
>     }

and then no bits are set in the next block.


> Guarenteed either  XEN_DOMINF_blocked or XEN_DOMINF_running is
> set now. 
> 
> And this next block, simply sets a few more bits
> 
>     info->flags = flags |
>         ((d->is_dying == DOMDYING_dead) ? XEN_DOMINF_dying    : 0) |
>         (d->is_shut_down                ? XEN_DOMINF_shutdown : 0) |
>         (d->is_paused_by_controller     ? XEN_DOMINF_paused   : 0) |
>         (d->debugger_attached           ? XEN_DOMINF_debugged : 0) |
>         d->shutdown_code << XEN_DOMINF_shutdownshift;
> 
>     if ( is_hvm_domain(d) )
>         info->flags |= XEN_DOMINF_hvm_guest;
> 
> This is all in getdomaininfo, from xen/common/domctl.c


-----------------------------------------------------
Russ Blaine | Solaris Kernel | russell.blaine at sun.com




More information about the libvir-list mailing list