mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 09:14:57 +00:00
New domain state pmsuspended
This introduces a new domain state pmsuspended to represent the domain which has been suspended by guest power management, e.g. (entered itno s3 state). Because a "running" state could be confused in this case, one will see the guest is paused actually while playing. And state "paused" is for the domain which was paused by virDomainSuspend.
This commit is contained in:
parent
487c063381
commit
54d9026a2c
@ -93,6 +93,8 @@ typedef enum {
|
|||||||
VIR_DOMAIN_SHUTDOWN= 4, /* the domain is being shut down */
|
VIR_DOMAIN_SHUTDOWN= 4, /* the domain is being shut down */
|
||||||
VIR_DOMAIN_SHUTOFF = 5, /* the domain is shut off */
|
VIR_DOMAIN_SHUTOFF = 5, /* the domain is shut off */
|
||||||
VIR_DOMAIN_CRASHED = 6, /* the domain is crashed */
|
VIR_DOMAIN_CRASHED = 6, /* the domain is crashed */
|
||||||
|
VIR_DOMAIN_PMSUSPENDED = 7, /* the domain is suspended by guest
|
||||||
|
power management */
|
||||||
|
|
||||||
#ifdef VIR_ENUM_SENTINELS
|
#ifdef VIR_ENUM_SENTINELS
|
||||||
/*
|
/*
|
||||||
@ -183,6 +185,13 @@ typedef enum {
|
|||||||
#endif
|
#endif
|
||||||
} virDomainCrashedReason;
|
} virDomainCrashedReason;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
VIR_DOMAIN_PMSUSPENDED_UNKNOWN = 0,
|
||||||
|
|
||||||
|
#ifdef VIR_ENUM_SENTINELS
|
||||||
|
VIR_DOMAIN_PMSUSPENDED_LAST
|
||||||
|
#endif
|
||||||
|
} virDomainPMSuspendedReason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virDomainControlState:
|
* virDomainControlState:
|
||||||
|
@ -512,7 +512,8 @@ VIR_ENUM_IMPL(virDomainState, VIR_DOMAIN_LAST,
|
|||||||
"paused",
|
"paused",
|
||||||
"shutdown",
|
"shutdown",
|
||||||
"shutoff",
|
"shutoff",
|
||||||
"crashed")
|
"crashed",
|
||||||
|
"pmsuspended")
|
||||||
|
|
||||||
/* virDomainSnapshotState is really virDomainState plus one extra state */
|
/* virDomainSnapshotState is really virDomainState plus one extra state */
|
||||||
VIR_ENUM_IMPL(virDomainSnapshotState, VIR_DOMAIN_SNAPSHOT_STATE_LAST,
|
VIR_ENUM_IMPL(virDomainSnapshotState, VIR_DOMAIN_SNAPSHOT_STATE_LAST,
|
||||||
@ -523,6 +524,7 @@ VIR_ENUM_IMPL(virDomainSnapshotState, VIR_DOMAIN_SNAPSHOT_STATE_LAST,
|
|||||||
"shutdown",
|
"shutdown",
|
||||||
"shutoff",
|
"shutoff",
|
||||||
"crashed",
|
"crashed",
|
||||||
|
"pmsuspended",
|
||||||
"disk-snapshot")
|
"disk-snapshot")
|
||||||
|
|
||||||
#define VIR_DOMAIN_NOSTATE_LAST (VIR_DOMAIN_NOSTATE_UNKNOWN + 1)
|
#define VIR_DOMAIN_NOSTATE_LAST (VIR_DOMAIN_NOSTATE_UNKNOWN + 1)
|
||||||
@ -14369,14 +14371,32 @@ virDomainObjSetState(virDomainObjPtr dom, virDomainState state, int reason)
|
|||||||
int last = -1;
|
int last = -1;
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case VIR_DOMAIN_NOSTATE: last = VIR_DOMAIN_NOSTATE_LAST; break;
|
case VIR_DOMAIN_NOSTATE:
|
||||||
case VIR_DOMAIN_RUNNING: last = VIR_DOMAIN_RUNNING_LAST; break;
|
last = VIR_DOMAIN_NOSTATE_LAST;
|
||||||
case VIR_DOMAIN_BLOCKED: last = VIR_DOMAIN_BLOCKED_LAST; break;
|
break;
|
||||||
case VIR_DOMAIN_PAUSED: last = VIR_DOMAIN_PAUSED_LAST; break;
|
case VIR_DOMAIN_RUNNING:
|
||||||
case VIR_DOMAIN_SHUTDOWN: last = VIR_DOMAIN_SHUTDOWN_LAST; break;
|
last = VIR_DOMAIN_RUNNING_LAST;
|
||||||
case VIR_DOMAIN_SHUTOFF: last = VIR_DOMAIN_SHUTOFF_LAST; break;
|
break;
|
||||||
case VIR_DOMAIN_CRASHED: last = VIR_DOMAIN_CRASHED_LAST; break;
|
case VIR_DOMAIN_BLOCKED:
|
||||||
default: last = -1;
|
last = VIR_DOMAIN_BLOCKED_LAST;
|
||||||
|
break;
|
||||||
|
case VIR_DOMAIN_PAUSED:
|
||||||
|
last = VIR_DOMAIN_PAUSED_LAST;
|
||||||
|
break;
|
||||||
|
case VIR_DOMAIN_SHUTDOWN:
|
||||||
|
last = VIR_DOMAIN_SHUTDOWN_LAST;
|
||||||
|
break;
|
||||||
|
case VIR_DOMAIN_SHUTOFF:
|
||||||
|
last = VIR_DOMAIN_SHUTOFF_LAST;
|
||||||
|
break;
|
||||||
|
case VIR_DOMAIN_CRASHED:
|
||||||
|
last = VIR_DOMAIN_CRASHED_LAST;
|
||||||
|
break;
|
||||||
|
case VIR_DOMAIN_PMSUSPENDED:
|
||||||
|
last = VIR_DOMAIN_PMSUSPENDED_LAST;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
last = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last < 0) {
|
if (last < 0) {
|
||||||
|
@ -18822,6 +18822,8 @@ vshDomainStateToString(int state)
|
|||||||
return N_("shut off");
|
return N_("shut off");
|
||||||
case VIR_DOMAIN_CRASHED:
|
case VIR_DOMAIN_CRASHED:
|
||||||
return N_("crashed");
|
return N_("crashed");
|
||||||
|
case VIR_DOMAIN_PMSUSPENDED:
|
||||||
|
return N_("pmsuspended");
|
||||||
case VIR_DOMAIN_NOSTATE:
|
case VIR_DOMAIN_NOSTATE:
|
||||||
default:
|
default:
|
||||||
;/*FALLTHROUGH*/
|
;/*FALLTHROUGH*/
|
||||||
@ -18935,6 +18937,14 @@ vshDomainStateReasonToString(int state, int reason)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case VIR_DOMAIN_PMSUSPENDED:
|
||||||
|
switch ((virDomainPMSuspendedReason) reason) {
|
||||||
|
case VIR_DOMAIN_PMSUSPENDED_UNKNOWN:
|
||||||
|
case VIR_DOMAIN_PMSUSPENDED_LAST:
|
||||||
|
;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_LAST:
|
case VIR_DOMAIN_LAST:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ State is the run state (see below).
|
|||||||
|
|
||||||
B<STATES>
|
B<STATES>
|
||||||
|
|
||||||
The State field lists 7 states for a domain, and which ones the
|
The State field lists 8 states for a domain, and which ones the
|
||||||
current domain is in.
|
current domain is in.
|
||||||
|
|
||||||
=over 4
|
=over 4
|
||||||
@ -372,6 +372,11 @@ restart on crash.
|
|||||||
The domain is in process of dying, but hasn't completely shutdown or
|
The domain is in process of dying, but hasn't completely shutdown or
|
||||||
crashed.
|
crashed.
|
||||||
|
|
||||||
|
=item B<pmsuspended>
|
||||||
|
|
||||||
|
The domain has been suspended by guest power management, e.g. entered
|
||||||
|
into s3 state.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
If I<--managed-save> is specified, then domains that have managed save
|
If I<--managed-save> is specified, then domains that have managed save
|
||||||
|
Loading…
Reference in New Issue
Block a user