]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: Fix net-desc --config output
authorK Shiva Kiran <shiva_kr@riseup.net>
Thu, 31 Aug 2023 18:16:57 +0000 (23:46 +0530)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 1 Sep 2023 10:09:04 +0000 (12:09 +0200)
commit30be60dd76d8eb74cec8a322a7846ff6577e368d
tree4cde5b18c98bf8c5f8f69c17f3851294279e62b0
parent0873d63b099c421bc9e03a59da9710a345bc434f
virsh: Fix net-desc --config output

Fixes the following bug:
Command:          `net-desc --config [--title] my_network`
Expected Output:  Title/Description of persistent config
Output:           Title/Description of live config

This was caused due to the usage of a single `flags` variable in
`virshGetNetworkDescription()` which ended up in a wrong enum being
passed to `virNetworkGetMetadata()` (enum being that of LIVE instead of
CONFIG).

Although the domain object has the same code, this didn't cause a problem
there because the enum values of `VIR_DOMAIN_INACTIVE_XML` and
`VIR_DOMAIN_METADATA_CONFIG` turn out to be the same (1 << 1), whereas
they are not for network equivalent ones (1 << 0, 1 << 1).

Signed-off-by: K Shiva Kiran <shiva_kr@riseup.net>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
tools/virsh-network.c