code: public static Connect getConnection(String libvirtURL, boolean readOnly) {
          connectLock.lock();
          try {
              return new Connect(libvirtURL, readOnly);
          } catch (LibvirtException e) {
              throw new LibvirtRuntimeException("Unable to connect to " + libvirtURL, e);
          } finally {
              connectLock.unlock();
          }
      }
docs: Create a connection to libvirt in a thread safe manner.