Bug 589465 - [RFE] start a domain in paused mode
Summary: [RFE] start a domain in paused mode
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: 6.0
Assignee: Eric Blake
QA Contact: Virtualization Bugs
Whiteboard: vdsm & libvirt integration
Depends On:
Blocks: 589458
TreeView+ depends on / blocked
Reported: 2010-05-06 08:50 UTC by Dan Kenigsberg
Modified: 2010-11-11 14:48 UTC (History)
14 users (show)

Fixed In Version: libvirt-0_8_1-11_el6
Doc Type: Enhancement
Doc Text:
Clone Of: 589458
Last Closed: 2010-11-11 14:48:07 UTC
Target Upstream Version:

Attachments (Terms of Use)
1/3 - add new flag (11.19 KB, patch)
2010-06-08 22:15 UTC, Eric Blake
no flags Details | Diff
2/3 - use flag for qemu (5.39 KB, patch)
2010-06-08 22:17 UTC, Eric Blake
no flags Details | Diff
3/3 - expose new flag in virsh (2.24 KB, patch)
2010-06-08 22:17 UTC, Eric Blake
no flags Details | Diff

Description Dan Kenigsberg 2010-05-06 08:50:47 UTC
+++ This bug was initially created as a clone of Bug #589458 +++

Description of problem:

Some guests (eg with badly configured grub, or Windows' installation cd) require quick response from the console user. That's why we have a "launchPaused" option in vdsm.

To implement it via libvirt, we need to ask libvirt not to call qemuMonitorStartCPUs() after starting qemu.

If this RFE is not implemented, vdsm will have to resort to calling virDomainStop immediately after the domain is up, but this is inherently raceful.

Comment 1 RHEL Program Management 2010-05-06 09:36:00 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for

Comment 2 RHEL Program Management 2010-05-06 10:51:11 UTC
This feature request did not get resolved in time for Feature Freeze
for the current Red Hat Enterprise Linux release and has now been
denied. You may re-open your request by requesting your support
representative to propose it for the next release.

Comment 3 Daniel Veillard 2010-05-11 09:19:00 UTC
This should be doable for virDomainCreateXML API which has a flags argument
but the virDomainCreate() counterpart has no such flags, so adding this to
defined domains would require too much work for RHEL-6.0.


Comment 4 Hugh Brock 2010-05-18 16:57:46 UTC
We should go ahead and fix the transient domain case (virDomainCreateXML) for VDSM.

Comment 5 Eric Blake 2010-06-08 20:01:23 UTC
Upstream patch series posted:

Comment 6 Eric Blake 2010-06-08 22:15:34 UTC
Created attachment 422372 [details]
1/3 - add new flag

Comment 7 Eric Blake 2010-06-08 22:17:24 UTC
Created attachment 422373 [details]
2/3 - use flag for qemu

Note - backport had merge conflict, unless upstream patch 2b57478ef0a0a983 is applied first (Jamie Strandboge, * Add stdin_path to qemudStartVMDaemon() args.)  The attached file has the merge conflict resolved.

Comment 8 Eric Blake 2010-06-08 22:17:56 UTC
Created attachment 422374 [details]
3/3 - expose new flag in virsh

Comment 9 Eric Blake 2010-06-09 14:32:41 UTC
Per upstream review, I am working on adding the virDomainCreateFlags() API; the question is whether this new API needs to be backported to RHEL 6.0, or whether it can wait for 6.1 (leaving just the first 3 patches to virDomainCreateXML for inclusion in 6.0).


Comment 10 Eric Blake 2010-06-10 13:18:53 UTC
We've painted ourselves into a bit of a corner.  We already have the public typedef enum virDomainCreateFlags, so the new API has to be named something different (perhaps virDomainCreateWithFlags or virDomainCreate2).

Comment 12 Dave Allan 2010-06-16 20:48:58 UTC
libvirt-0_8_1-9_el6 has been built in RHEL-6-candidate with the fix.


Comment 13 Dan Kenigsberg 2010-06-24 19:09:42 UTC
libvirt-python-0.8.1-10.el6.x86_64: python binding is missing VIR_DOMAIN_START_PAUSED.

Comment 14 Eric Blake 2010-06-25 12:37:30 UTC
On IRC, Matthias pointed out that there was a partial dependency problem introduced in upstream commit a79fb1c491197a91094c that may impact the rebuild rules for python bindings.  I'm looking further into the issue, and hope to figure out if that same issue applies to the RHEL6 build.

Comment 16 Dave Allan 2010-06-29 03:00:52 UTC
libvirt-0_8_1-11_el6 has been built in RHEL-6-candidate with the fix.


Comment 18 weizhang 2010-07-22 11:57:57 UTC
On testing, I follow the steps:
1. start a domain with
# virsh start demo
Domain demo started

2. After demo started, pause the demo
# virsh suspend demo
Domain demo suspended

# virsh list --all
Id Name                 State
 23 demo               paused

3 Start the demo
# virsh start demo
error: Domain is already active

# virsh list --all
Id Name                 State
 23 demo               paused

Is that the expected result?

# rpm -qa libvirt
kernel 2.6.32-44.2.el6.x86_64

Comment 19 Eric Blake 2010-07-22 12:17:33 UTC
Using 'virsh start' cannot exercise the new functionality, since RHEL6 does not support starting a persistent guest in the paused state.  To test this, you need to use a transient domain, via:

virsh create dom.xml [--create]
virsh list --all

and verify that omitting --create shows the transient domain as running, while including --create shows the transient domain as paused.

Comment 20 weizhang 2010-07-23 02:42:41 UTC
Thanks Eric. I change the step according to your advice:

#virsh create dom.xml --paused
Domain dom created from dom.xml

#virsh list --all
 Id Name                 State
  6 dom                  paused

Is that means the bug has been fixed?

Comment 21 Eric Blake 2010-07-23 11:59:06 UTC
Yes, it's fixed.  Without the patch, virsh would have choked on --paused.

Comment 22 weizhang 2010-07-26 01:11:36 UTC
According to comment 20 and 21, this bug can be verified.

Comment 23 Nan Zhang 2010-09-07 07:38:14 UTC
Verified with libvirt-0.8.1-27.el6.x86_64.

# virsh create rhel6.xml --paused
Domain rhel6 created from rhel6.xml

# virsh list --all
 Id Name                 State
  6 rhel6                paused
  - rhel6-rc             shut off
  - winxp                shut off

Comment 24 releng-rhel@redhat.com 2010-11-11 14:48:07 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.