mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
ESX: Fallback to the preliminary name if the datastore cannot be found.
This allows to use domain-xml-from-native with VMX files that reference unavailable datastores. * src/esx/esx_vmx.c: fallback to the preliminary name if the datastore cannot be found
This commit is contained in:
parent
fc8d199188
commit
b7abcf9d71
@ -606,10 +606,11 @@ esxVMX_AbsolutePathToDatastoreRelatedPath(virConnectPtr conn,
|
|||||||
if (ctx != NULL) {
|
if (ctx != NULL) {
|
||||||
if (esxVI_LookupDatastoreByName(conn, ctx, preliminaryDatastoreName,
|
if (esxVI_LookupDatastoreByName(conn, ctx, preliminaryDatastoreName,
|
||||||
NULL, &datastore,
|
NULL, &datastore,
|
||||||
esxVI_Occurence_RequiredItem) < 0) {
|
esxVI_Occurence_OptionalItem) < 0) {
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (datastore != NULL) {
|
||||||
for (dynamicProperty = datastore->propSet; dynamicProperty != NULL;
|
for (dynamicProperty = datastore->propSet; dynamicProperty != NULL;
|
||||||
dynamicProperty = dynamicProperty->_next) {
|
dynamicProperty = dynamicProperty->_next) {
|
||||||
if (STREQ(dynamicProperty->name, "summary.accessible")) {
|
if (STREQ(dynamicProperty->name, "summary.accessible")) {
|
||||||
@ -628,12 +629,14 @@ esxVMX_AbsolutePathToDatastoreRelatedPath(virConnectPtr conn,
|
|||||||
VIR_WARN("Unexpected '%s' property", dynamicProperty->name);
|
VIR_WARN("Unexpected '%s' property", dynamicProperty->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (datastoreName == NULL) {
|
if (datastoreName == NULL) {
|
||||||
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
|
VIR_WARN("Could not retrieve datastore name for absolute "
|
||||||
"Could not retrieve datastore name for absolute path '%s'",
|
"path '%s', falling back to preliminary name '%s'",
|
||||||
absolutePath);
|
absolutePath, preliminaryDatastoreName);
|
||||||
goto failure;
|
|
||||||
|
datastoreName = preliminaryDatastoreName;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
datastoreName = preliminaryDatastoreName;
|
datastoreName = preliminaryDatastoreName;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user