Bug 877430

Summary: Occasional launches of transient domain give error: Requested operation is not valid: domain is not running
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, rbalakri
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-23 23:18:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
test-parallel.c none

Description Richard W.M. Jones 2012-11-16 14:08:35 UTC
Created attachment 646333 [details]
test-parallel.c

Description of problem:

See the attached test script.  Occasionally threads fail with
this error:

libvir: QEMU Driver error : Requested operation is not valid: domain is not running

Although most of the time domain launch works fine.

Version-Release number of selected component (if applicable):

libvirt-0.10.2.1-2.fc18.x86_64

How reproducible:

Rare, but easy to reproduce using the attached script
if you run it for long enough.

Steps to Reproduce:
1. Run attached script.

Comment 1 Richard W.M. Jones 2012-11-16 15:13:23 UTC
I added a bit of extra debug to the script to find that
this happens in virDomainDestroyFlags, when the domain should
definitely be up and running.

Comment 2 Richard W.M. Jones 2012-11-16 16:22:10 UTC
I think this is probably not a bug, but is caused by us
calling close on the socket before calling virDomainDestroy*,
which caused a race where the daemon might exit (causing
qemu to exit) before virDomainDestroy was called.

Comment 3 Richard W.M. Jones 2012-11-16 16:33:36 UTC
Just seen it happen again, even though I moved the close to right
after virConnectClose.

Comment 4 Cole Robinson 2016-03-23 23:18:49 UTC
Similarly, the example script doesn't run anymore, the referenced appliance URL doesn't exist. Given the age I assume this is fixed, but Rich please reopen if I'm wrong