/**
   * Experimental driver to configure direct networking in libvirt. This should only be used on an
   * LXC cluster that does not run any system VMs.
   *
   * @param nic
   * @param guestOsType
   * @return
   * @throws InternalErrorException
   * @throws LibvirtException
   */
  public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType)
      throws InternalErrorException, LibvirtException {
    LibvirtVMDef.InterfaceDef intf = new LibvirtVMDef.InterfaceDef();

    if (nic.getType() == Networks.TrafficType.Guest) {
      intf.defDirectNet(
          _libvirtComputingResource.getNetworkDirectDevice(),
          null,
          nic.getMac(),
          getGuestNicModel(guestOsType),
          _libvirtComputingResource.getNetworkDirectSourceMode());

    } else if (nic.getType() == Networks.TrafficType.Public) {
      intf.defDirectNet(
          _libvirtComputingResource.getNetworkDirectDevice(),
          null,
          nic.getMac(),
          getGuestNicModel(guestOsType),
          _libvirtComputingResource.getNetworkDirectSourceMode());
    }

    return intf;
  }