mirror of https://gitee.com/openkylin/libvirt.git
Report the object name on lookup error
* src/network_driver.c src/node_device.c src/storage_driver.c: many places in the code reported 'No xxx with matching name" after a Lookup error without reporting the name used by the failed lookup
This commit is contained in:
parent
2562303a45
commit
c6cd55d38e
|
@ -971,7 +971,7 @@ static virNetworkPtr networkLookupByName(virConnectPtr conn,
|
||||||
networkDriverUnlock(driver);
|
networkDriverUnlock(driver);
|
||||||
if (!network) {
|
if (!network) {
|
||||||
networkReportError(conn, NULL, NULL, VIR_ERR_NO_NETWORK,
|
networkReportError(conn, NULL, NULL, VIR_ERR_NO_NETWORK,
|
||||||
"%s", _("no network with matching name"));
|
_("no network with matching name '%s'"), name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -279,8 +279,9 @@ static char *nodeDeviceDumpXML(virNodeDevicePtr dev,
|
||||||
nodeDeviceUnlock(driver);
|
nodeDeviceUnlock(driver);
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
virNodeDeviceReportError(dev->conn, VIR_ERR_INVALID_NODE_DEVICE,
|
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE,
|
||||||
"%s", _("no node device with matching name"));
|
_("no node device with matching name '%s'"),
|
||||||
|
dev->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,8 +308,9 @@ static char *nodeDeviceGetParent(virNodeDevicePtr dev)
|
||||||
nodeDeviceUnlock(driver);
|
nodeDeviceUnlock(driver);
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
virNodeDeviceReportError(dev->conn, VIR_ERR_INVALID_NODE_DEVICE,
|
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE,
|
||||||
"%s", _("no node device with matching name"));
|
_("no node device with matching name '%s'"),
|
||||||
|
dev->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,8 +343,9 @@ static int nodeDeviceNumOfCaps(virNodeDevicePtr dev)
|
||||||
nodeDeviceUnlock(driver);
|
nodeDeviceUnlock(driver);
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
virNodeDeviceReportError(dev->conn, VIR_ERR_INVALID_NODE_DEVICE,
|
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE,
|
||||||
"%s", _("no node device with matching name"));
|
_("no node device with matching name '%s'"),
|
||||||
|
dev->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -371,8 +374,9 @@ nodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames)
|
||||||
nodeDeviceUnlock(driver);
|
nodeDeviceUnlock(driver);
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
virNodeDeviceReportError(dev->conn, VIR_ERR_INVALID_NODE_DEVICE,
|
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE,
|
||||||
"%s", _("no node device with matching name"));
|
_("no node device with matching name '%s'"),
|
||||||
|
dev->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -295,7 +295,7 @@ storagePoolLookupByName(virConnectPtr conn,
|
||||||
|
|
||||||
if (!pool) {
|
if (!pool) {
|
||||||
virStorageReportError(conn, VIR_ERR_NO_STORAGE_POOL,
|
virStorageReportError(conn, VIR_ERR_NO_STORAGE_POOL,
|
||||||
"%s", _("no pool with matching name"));
|
_("no pool with matching name '%s'"), name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1099,8 +1099,9 @@ storageVolumeLookupByName(virStoragePoolPtr obj,
|
||||||
vol = virStorageVolDefFindByName(pool, name);
|
vol = virStorageVolDefFindByName(pool, name);
|
||||||
|
|
||||||
if (!vol) {
|
if (!vol) {
|
||||||
virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
|
virStorageReportError(obj->conn, VIR_ERR_NO_STORAGE_VOL,
|
||||||
"%s", _("no storage vol with matching name"));
|
_("no storage vol with matching name '%s'"),
|
||||||
|
name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1339,8 +1340,9 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (diffpool && !origpool) {
|
if (diffpool && !origpool) {
|
||||||
virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
|
virStorageReportError(obj->conn, VIR_ERR_NO_STORAGE_POOL,
|
||||||
"%s", _("no storage pool with matching name"));
|
_("no storage pool with matching name '%s'"),
|
||||||
|
vobj->pool);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1361,8 +1363,9 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
|
||||||
|
|
||||||
origvol = virStorageVolDefFindByName(origpool, vobj->name);
|
origvol = virStorageVolDefFindByName(origpool, vobj->name);
|
||||||
if (!origvol) {
|
if (!origvol) {
|
||||||
virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
|
virStorageReportError(obj->conn, VIR_ERR_NO_STORAGE_VOL,
|
||||||
"%s", _("no storage vol with matching name"));
|
_("no storage vol with matching name '%s'"),
|
||||||
|
vobj->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1501,8 +1504,9 @@ storageVolumeDelete(virStorageVolPtr obj,
|
||||||
vol = virStorageVolDefFindByName(pool, obj->name);
|
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||||
|
|
||||||
if (!vol) {
|
if (!vol) {
|
||||||
virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
|
virStorageReportError(obj->conn, VIR_ERR_NO_STORAGE_VOL,
|
||||||
"%s", _("no storage vol with matching name"));
|
_("no storage vol with matching name '%s'"),
|
||||||
|
obj->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1576,8 +1580,9 @@ storageVolumeGetInfo(virStorageVolPtr obj,
|
||||||
vol = virStorageVolDefFindByName(pool, obj->name);
|
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||||
|
|
||||||
if (!vol) {
|
if (!vol) {
|
||||||
virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
|
virStorageReportError(obj->conn, VIR_ERR_NO_STORAGE_VOL,
|
||||||
"%s", _("no storage vol with matching name"));
|
_("no storage vol with matching name '%s'"),
|
||||||
|
obj->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1628,8 +1633,9 @@ storageVolumeGetXMLDesc(virStorageVolPtr obj,
|
||||||
vol = virStorageVolDefFindByName(pool, obj->name);
|
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||||
|
|
||||||
if (!vol) {
|
if (!vol) {
|
||||||
virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
|
virStorageReportError(obj->conn, VIR_ERR_NO_STORAGE_VOL,
|
||||||
"%s", _("no storage vol with matching name"));
|
_("no storage vol with matching name '%s'"),
|
||||||
|
obj->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1674,8 +1680,9 @@ storageVolumeGetPath(virStorageVolPtr obj) {
|
||||||
vol = virStorageVolDefFindByName(pool, obj->name);
|
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||||
|
|
||||||
if (!vol) {
|
if (!vol) {
|
||||||
virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
|
virStorageReportError(obj->conn, VIR_ERR_NO_STORAGE_VOL,
|
||||||
"%s", _("no storage vol with matching name"));
|
_("no storage vol with matching name '%s'"),
|
||||||
|
obj->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue