mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
libxl: Fix Xen 4.4 libxlVmStart logic
ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS hides a multi-line body for a brace-less else. Add braces to ensure proper logic is applied. Without this fix, new domains cannot be started. Both libxl_domain_create_new and libxl_domain_create_restore are called when starting a new domain leading to this error: libxl: error: libxl.c:324:libxl__domain_rename: domain with name "guest" already exists. libxl: error: libxl_create.c:800:initiate_domain_create: cannot make domain: -6
This commit is contained in:
parent
84f6960214
commit
7d58c7fc8e
@ -618,10 +618,10 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
|
|||||||
|
|
||||||
/* use as synchronous operations => ao_how = NULL and no intermediate reports => ao_progress = NULL */
|
/* use as synchronous operations => ao_how = NULL and no intermediate reports => ao_progress = NULL */
|
||||||
|
|
||||||
if (restore_fd < 0)
|
if (restore_fd < 0) {
|
||||||
ret = libxl_domain_create_new(priv->ctx, &d_config,
|
ret = libxl_domain_create_new(priv->ctx, &d_config,
|
||||||
&domid, NULL, NULL);
|
&domid, NULL, NULL);
|
||||||
else
|
} else {
|
||||||
#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
|
#ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS
|
||||||
params.checkpointed_stream = 0;
|
params.checkpointed_stream = 0;
|
||||||
ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
|
ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
|
||||||
@ -630,6 +630,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
|
|||||||
ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
|
ret = libxl_domain_create_restore(priv->ctx, &d_config, &domid,
|
||||||
restore_fd, NULL, NULL);
|
restore_fd, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (restore_fd < 0)
|
if (restore_fd < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user