Hi, can someone explain the states shown by the ''xm list'' command? ''r'' (running) - The domain is currently running. - This flag is always shown for the Domain 0, but never for unprivileged domains, why? ''b'' (blocked) - The domain is blocked. - What does that mean? Why should a domain be blocked? ''p'' (paused) - The domain is paused. - Ok, that one is easy, the domain was paused with ''xm pause'' ''c'' (crashed) - The domain has crashed. - If i do ''echo 1 > /proc/balloon'' inside a unprivileged domain, i will get a kernel panic. But the state says nothing about that? The domain is definitively crashed, but the xm list command says nothing about that. Why? ''d'' (dying) - The domain is in the process of dying. - Well, poor little domain, but what does that mean? Maybe anybody here who can clearify the meanings of the state. The manual page is not very helpful. Many Thanks and greetings, -timo -- Timo Benk PGP Public Key: http://vs241071.vserver.de/timo_benk_gpg_key.asc _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Timo Benk > Sent: 24 April 2006 12:38 > To: xen-users@lists.xensource.com > Subject: [Xen-users] ''xm list'' states > > Hi, > > can someone explain the states shown by the ''xm list'' command? > > ''r'' (running) - The domain is currently running. > - This flag is always shown for the Domain 0, but never for > unprivileged domains, why?Presumably because you''re on a single processor machine, you never see anything other than Dom0 running (as Dom0 MUST be one running to show the ''xm list'' output). In a Multi-processor (multi-core/thread) system, you could have more than one domain running at any given time. Obviously, this assumes that the DomU(s) are actually DOING something, (like "for((;;)) { ; }" in a shell) - if it''s just sitting there waiting for someone to send a net-packet or type on a keyboard, it wouldn''t be running...> > ''b'' (blocked) - The domain is blocked. > - What does that mean? Why should a domain be blocked?It''s blocked waiting for something, usually an interrupt (for example, waiting for hard-disk data to be passed over to the domain). Also, things like "sleep 5" in the shell would cause "blocked", as the domain is waiting for a number of timer ticks (5 seconds worth of) to pass.> > ''p'' (paused) - The domain is paused. > - Ok, that one is easy, the domain was paused with ''xm pause''Yup.> > ''c'' (crashed) - The domain has crashed. > - If i do ''echo 1 > /proc/balloon'' inside a unprivileged domain, i > will get a kernel panic. But the state says nothing about that? The > domain is definitively crashed, but the xm list command says nothing > about that. Why?It may be that the crash isn''t detected properly by hypervisor - I think this may only work under some circumstances. I don''t know for sure, I''m just guessing here.> > ''d'' (dying) - The domain is in the process of dying. > - Well, poor little domain, but what does that mean?Something has told the domain to "kill itself" (such as "xm shutdown/destroy", but it''s not yet disappeared. It''s probably there for the purpose of avoiding race-conditions where something is killing the domain, and something else is talking to it (for example disk accesses), and we don''t want to retry operations that fail because the domain is disappearing - where it would make sense to retry it on a "living" Domain.> > Maybe anybody here who can clearify the meanings of the > state. The manual page is not very helpful.I hope this is of some help. -- Mats> > Many Thanks and greetings, > -timo > -- > Timo Benk > PGP Public Key: http://vs241071.vserver.de/timo_benk_gpg_key.asc > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thanks so far, that made many points clearer for me. One last quesetion: The ''s''-flag, in my understanding quite obvious, will be shown when the Domain will be shutdown. But if i do a ''xm shutdown'' and watch the ''xm list'' output, the ''s'' flag is never shown. In the manual page is a hint "FIXME Why should you ever see this state". Can i assume that this flag is quasi non-existing or does not work? Greetings, -timo On Mon, 24 Apr 2006 13:55:37 +0200 "Petersson, Mats" <Mats.Petersson@amd.com> wrote:> > -----Original Message----- > > From: xen-users-bounces@lists.xensource.com > > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Timo > > Benk Sent: 24 April 2006 12:38 > > To: xen-users@lists.xensource.com > > Subject: [Xen-users] ''xm list'' states > > > > Hi, > > > > can someone explain the states shown by the ''xm list'' command? > > > > ''r'' (running) - The domain is currently running. > > - This flag is always shown for the Domain 0, but never for > > unprivileged domains, why? > > Presumably because you''re on a single processor machine, you never > see anything other than Dom0 running (as Dom0 MUST be one running > to show the ''xm list'' output). In a Multi-processor > (multi-core/thread) system, you could have more than one domain > running at any given time. Obviously, this assumes that the DomU(s) > are actually DOING something, (like "for((;;)) { ; }" in a shell) - > if it''s just sitting there waiting for someone to send a net-packet > or type on a keyboard, it wouldn''t be running... > > > > > ''b'' (blocked) - The domain is blocked. > > - What does that mean? Why should a domain be blocked? > > It''s blocked waiting for something, usually an interrupt (for > example, waiting for hard-disk data to be passed over to the > domain). Also, things like "sleep 5" in the shell would cause > "blocked", as the domain is waiting for a number of timer ticks (5 > seconds worth of) to pass. > > > > > ''p'' (paused) - The domain is paused. > > - Ok, that one is easy, the domain was paused with ''xm pause'' > > Yup. > > > > ''c'' (crashed) - The domain has crashed. > > - If i do ''echo 1 > /proc/balloon'' inside a unprivileged domain, i > > will get a kernel panic. But the state says nothing about that? > > The domain is definitively crashed, but the xm list command says > > nothing about that. Why? > > It may be that the crash isn''t detected properly by hypervisor - I > think this may only work under some circumstances. I don''t know for > sure, I''m just guessing here. > > > > > ''d'' (dying) - The domain is in the process of dying. > > - Well, poor little domain, but what does that mean? > > Something has told the domain to "kill itself" (such as "xm > shutdown/destroy", but it''s not yet disappeared. It''s probably > there for the purpose of avoiding race-conditions where something > is killing the domain, and something else is talking to it (for > example disk accesses), and we don''t want to retry operations that > fail because the domain is disappearing - where it would make sense > to retry it on a "living" Domain. > > > > > Maybe anybody here who can clearify the meanings of the > > state. The manual page is not very helpful. > > I hope this is of some help. > > -- > Mats > > > > Many Thanks and greetings, > > -timo > > -- > > Timo Benk > > PGP Public Key: http://vs241071.vserver.de/timo_benk_gpg_key.asc > > > > > > _______________________________________________ > > Xen-users mailing list > > Xen-users@lists.xensource.com > > http://lists.xensource.com/xen-users > > > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >-- Timo Benk PGP Public Key: http://vs241071.vserver.de/timo_benk_gpg_key.asc _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Petersson, Mats wrote:>> ''c'' (crashed) - The domain has crashed. >> - If i do ''echo 1 > /proc/balloon'' inside a unprivileged domain, i >> will get a kernel panic. But the state says nothing about that? The >> domain is definitively crashed, but the xm list command says nothing >> about that. Why? >> > > It may be that the crash isn''t detected properly by hypervisor - I think > this may only work under some circumstances. I don''t know for sure, I''m > just guessing here. >A crash is when the domain does something that it shouldn''t supposed to do and the hypervisor has to kill it. I imagine that an OOM condition in the guest will invoke the normal shutdown routines which would explain why the state isn''t crashed.>> ''d'' (dying) - The domain is in the process of dying. >> - Well, poor little domain, but what does that mean? >> > > Something has told the domain to "kill itself" (such as "xm > shutdown/destroy", but it''s not yet disappeared. It''s probably there for > the purpose of avoiding race-conditions where something is killing the > domain, and something else is talking to it (for example disk accesses), > and we don''t want to retry operations that fail because the domain is > disappearing - where it would make sense to retry it on a "living" > Domain. >Actually, dying specifically means that xc_domain_destroy() has been invoked on a domain. In turn, this means that the domain''s resources have been deallocated. The reason this state is needed is because of the way memory sharing works. If another domain maps a portion of a guests memory, then that domain can not be completely removed from the system until the domain unmaps that memory (since you can not forcefully break that mapping). If you ever see a domain in a dying state for more than a moment, chances are, it''s a zombie and there''s a bug somewhere keeping a domain from unmapping a small portion of the guests memory. The ''s'' flag means the domain is in the shutdown state. The shutdown state is initiated when the guest signals to the hypervisor to put itself in the shutdown state. Once in the shutdown state, a domain cannot escape from it. When you do something like an xm shutdown, what happens is that you signal to the guest to do a shutdown, it puts itself in the ''s'' state, the control tools see that the domain has entered a shutdown state, and signal to the appropriate backend drivers to release the guests memory. Then, the control tools do a destroy() on the domain which will cause it to actually disappear. There a few substates associated with the shutdown state: halt, reboot, and suspend. Halt and reboot are rather obvious (a guest wishes to be halted or rebooted). The suspend state is used for save/restore and migration. Before the guest enteres the suspend substate, it first canonicalizes any of it''s internal PFN references and jumps to a special location in the kernel. What''s special about this is that the domain''s image can now be safely copied into a new domain shell and when execution begins again, the kernel will start a recovery routine that reinitializes devices and internal PFNs. You cannot unsuspend a domain in place though which is certainly a disadvantage in the current design (as it prevents light weight checkpointing). The same applies to rebooting which is a little unfortunate. Regards, Anthony Liguori>> Maybe anybody here who can clearify the meanings of the >> state. The manual page is not very helpful. >> > > I hope this is of some help. > > -- > Mats > >> Many Thanks and greetings, >> -timo >> -- >> Timo Benk >> PGP Public Key: http://vs241071.vserver.de/timo_benk_gpg_key.asc >> >> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users >> >> >> > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anthony added:> Petersson, Mats wrote: > >> ''c'' (crashed) - The domain has crashed. > >> - If i do ''echo 1 > /proc/balloon'' inside a unprivileged domain, i > >> will get a kernel panic. But the state says nothing > about that? The > >> domain is definitively crashed, but the xm list command > says nothing > >> about that. Why? > >> > > > > It may be that the crash isn''t detected properly by hypervisor - I > > think this may only work under some circumstances. I don''t know for > > sure, I''m just guessing here. > > > > A crash is when the domain does something that it shouldn''t > supposed to do and the hypervisor has to kill it. I imagine > that an OOM condition in the guest will invoke the normal > shutdown routines which would explain why the state isn''t crashed.Thanks for the further explanations. So the ''c'' state is entereed when we call domain_crash_synchrnous() in the hypervisor, right? -- Mats _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Petersson, Mats wrote:> Anthony added: > >> Petersson, Mats wrote: >> >>>> ''c'' (crashed) - The domain has crashed. >>>> - If i do ''echo 1 > /proc/balloon'' inside a unprivileged domain, i >>>> will get a kernel panic. But the state says nothing >>>> >> about that? The >> >>>> domain is definitively crashed, but the xm list command >>>> >> says nothing >> >>>> about that. Why? >>>> >>>> >>> It may be that the crash isn''t detected properly by hypervisor - I >>> think this may only work under some circumstances. I don''t know for >>> sure, I''m just guessing here. >>> >>> >> A crash is when the domain does something that it shouldn''t >> supposed to do and the hypervisor has to kill it. I imagine >> that an OOM condition in the guest will invoke the normal >> shutdown routines which would explain why the state isn''t crashed. >> > > Thanks for the further explanations. > > So the ''c'' state is entereed when we call domain_crash_synchrnous() in > the hypervisor, right? >Yes, I should also add that libxc confuses things a bit by making the crashed state not appear to be the substate of shutdown (which it is). The kernel is able to crash itself by specifying SHUTDOWN_crash. Regards, Anthony Liguori> -- > Mats > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users