Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libtcg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton
libtcg
Commits
f54603b6
Commit
f54603b6
authored
13 years ago
by
Michael Roth
Browse files
Options
Downloads
Patches
Plain Diff
qemu-ga: add win32 guest-suspend-ram command
S3 sleep implementation for windows.
parent
aa59637e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qga/commands-win32.c
+25
-9
25 additions, 9 deletions
qga/commands-win32.c
with
25 additions
and
9 deletions
qga/commands-win32.c
+
25
−
9
View file @
f54603b6
...
...
@@ -174,7 +174,8 @@ int64_t qmp_guest_fsfreeze_thaw(Error **err)
}
typedef
enum
{
GUEST_SUSPEND_MODE_DISK
GUEST_SUSPEND_MODE_DISK
,
GUEST_SUSPEND_MODE_RAM
}
GuestSuspendMode
;
static
void
check_suspend_mode
(
GuestSuspendMode
mode
,
Error
**
err
)
...
...
@@ -192,18 +193,24 @@ static void check_suspend_mode(GuestSuspendMode mode, Error **err)
goto
out
;
}
if
(
mode
==
GUEST_SUSPEND_MODE_DISK
)
{
if
(
sys_pwr_caps
.
SystemS4
)
{
return
;
switch
(
mode
)
{
case
GUEST_SUSPEND_MODE_DISK
:
if
(
!
sys_pwr_caps
.
SystemS4
)
{
error_set
(
&
local_err
,
QERR_QGA_COMMAND_FAILED
,
"suspend-to-disk not supported by OS"
);
}
}
else
{
break
;
case
GUEST_SUSPEND_MODE_RAM
:
if
(
!
sys_pwr_caps
.
SystemS3
)
{
error_set
(
&
local_err
,
QERR_QGA_COMMAND_FAILED
,
"suspend-to-ram not supported by OS"
);
}
break
;
default:
error_set
(
&
local_err
,
QERR_INVALID_PARAMETER_VALUE
,
"mode"
,
"GuestSuspendMode"
);
goto
out
;
}
error_set
(
&
local_err
,
QERR_QGA_COMMAND_FAILED
,
"suspend mode not supported by OS"
);
out:
if
(
local_err
)
{
error_propagate
(
err
,
local_err
);
...
...
@@ -239,7 +246,16 @@ void qmp_guest_suspend_disk(Error **err)
void
qmp_guest_suspend_ram
(
Error
**
err
)
{
error_set
(
err
,
QERR_UNSUPPORTED
);
GuestSuspendMode
*
mode
=
g_malloc
(
sizeof
(
GuestSuspendMode
));
*
mode
=
GUEST_SUSPEND_MODE_RAM
;
check_suspend_mode
(
*
mode
,
err
);
acquire_privilege
(
SE_SHUTDOWN_NAME
,
err
);
execute_async
(
do_suspend
,
mode
,
err
);
if
(
error_is_set
(
err
))
{
g_free
(
mode
);
}
}
void
qmp_guest_suspend_hybrid
(
Error
**
err
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment