code: public static StorageVol findVolume(Connect connection, String path) throws LibvirtException {
          log.debug("Looking up StorageVolume for path '{}'", path);
          for (String s : connection.listStoragePools()) {
              StoragePool sp = connection.storagePoolLookupByName(s);
              for (String v : sp.listVolumes()) {
                  StorageVol vol = sp.storageVolLookupByName(v);
                  if (vol.getPath().equals(path)) {
                      log.debug("Found volume '{}' for path '{}'", vol.getName(), path);
                      return vol;
                  }
              }
          }
          throw new LibvirtRuntimeException("no volume found for path " + path);
      }
docs: Look up a disk image's {@link StorageVol} in the {@link StoragePool}s attached to connection.