Re: [PATCH] Fix race in starting transient VMs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/31/2013 12:41 PM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> When starting a transient VM the first thing done is to check
> for duplicates. The check looks if there are any running VMs
> with the matching name/uuid. It explicitly allows there to
> be inactive VMs, so that a persistent VM can be temporarily
> booted with a different config.
> 

> 
> The fix is to only allow an existing inactive VM if it is
> marked as persistent.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/conf/domain_conf.c | 6 ++++++
>  1 file changed, 6 insertions(+)

ACK.  What a nasty bug to track down.

> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 51c4e29..454fbfe 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -2171,6 +2171,12 @@ virDomainObjListAddLocked(virDomainObjListPtr doms,
>                                 vm->def->name);
>                  goto error;
>              }
> +            if (!vm->persistent) {
> +                virReportError(VIR_ERR_OPERATION_INVALID,
> +                               _("domain is being started as '%s'"),

The error is a bit awkward (I ask to create a domain named 'foo', and
the error message is 'domain is being started as 'foo''), but no worse
than the error message a couple lines earlier ('domain is already active
as 'foo'').  Maybe "domain '%s' is already being started" reads better.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]