---
name: "Sys::Virt::NetworkPort"
section: "3pm"
platform: "linux"
package: "perl-sys-virt"
version: "12.7.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Sys::Virt::NetworkPort"
---

# Sys::Virt::NetworkPort(3pm)

Represent & manage a libvirt virtual network port

## NAME

Sys::Virt::NetworkPort - Represent & manage a libvirt virtual network port

## DESCRIPTION

The `"Sys::Virt::NetworkPort"` module represents a port in a virtual network.

## METHODS

- my $uuid = $port-\>**get\_uuid()**

  Returns a 16 byte long string containing the raw globally unique identifier (UUID) for the network port.

- my $uuid = $port-\>**get\_uuid\_string()**

  Returns a printable string representation of the raw UUID, in the format 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'.

- my $xml = $port-\>**get\_xml\_description()**

  Returns an XML document containing a complete description of the network port's configuration

- $port-\>**delete()**

  Delete the network port from the managed network.

- my $params = $port-\>get\_parameters($flags=0);

  Get tunable parameters associated with the network port. The `$flags` parameter is currently unused and defaults to zero. The returned `$params` is a hash reference whose keys are one or more of the following constants:

  - Sys::Virt::NetworkPort::BANDWIDTH\_IN\_AVERAGE

    The average inbound bandwidth

  - Sys::Virt::NetworkPort::BANDWIDTH\_IN\_BURST

    The burstable inbound bandwidth

  - Sys::Virt::NetworkPort::BANDWIDTH\_IN\_FLOOR

    The minimum inbound bandwidth

  - Sys::Virt::NetworkPort::BANDWIDTH\_IN\_PEAK

    The peak inbound bandwidth

  - Sys::Virt::NetworkPort::BANDWIDTH\_OUT\_AVERAGE

    The average outbound bandwidth

  - Sys::Virt::NetworkPort::BANDWIDTH\_OUT\_BURST

    The burstable outbound bandwidth

  - Sys::Virt::NetworkPort::BANDWIDTH\_OUT\_PEAK

    The peak outbound bandwidth

- $port-\>set\_parameters($params, $flags=0);

  Set tunable parameters associated with the network port. The `$flags` parameter is currently unused and defaults to zero. The `$params` parameter is a hash reference whose keys are one or more of the constants listed for `"get_parameters"`.

### NETWORK PORT CREATION CONSTANTS

When creating network ports zero or more of the following constants may be used

- Sys::Virt::NetworkPort::CREATE\_RECLAIM

  Providing configuration reclaiming a pre-existing network port.

- Sys::Virt::NetworkPort::CREATE\_VALIDATE

  Validate the XML document against the XML schema

## AUTHORS

Daniel P. Berrange \<berrange@redhat.com\>

## COPYRIGHT

Copyright (C) 2019 Red Hat

## LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of either the GNU General Public License as published by the Free Software Foundation (either version 2 of the License, or at your option any later version), or, the Artistic License, as specified in the Perl README file.

## SEE ALSO

Sys::Virt, Sys::Virt::Network, Sys::Virt::Error, `"http://libvirt.org"`
