Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
+++ This bug was initially created as a clone of Bug #1026772 +++
commit 273b6581ca8dae11e6ff40e3d13813fdbb37d41b
Author: Michal Privoznik <mprivozn>
Date: Thu Sep 11 13:17:11 2014 +0200
virDomainUndefineFlags: Allow NVRAM unlinking
When a domain is undefined, there are options to remove it's
managed save state or snapshots. However, there's another file
that libvirt creates per domain: the NVRAM variable store file.
Make sure that the file is not left behind if the domain is
undefined.
Signed-off-by: Michal Privoznik <mprivozn>
added VIR_DOMAIN_UNDEFINE_NVRAM flag for virDomainUndefineFlags. We need to rebuild libvirt-python to pick up this new flag.
Version-Release number of selected component (if applicable):
libvirt-python-1.2.8-2.el7
Steps to Reproduce:
1. python -c "import libvirt; print libvirt.VIR_DOMAIN_UNDEFINE_NVRAM
Expected results:
4
You haven't really verify anything. The steps you did will work even with old libvirt-python that doesn't know anything about the new flag. Instead of using the vale of the new flag (4), you should use its name, that is:
dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM)
Sorry.I made the mistake. Verify it using libvirt.VIR_DOMAIN_UNDEFINE_NVRAM again. The result is expected.
I thought the libvirt-python can check the validity of the flag value.
[root@sriov images]# virsh define r7.xml
Domain r7 defined from r7.xml
[root@sriov images]# virsh start r7
Domain r7 started
[root@sriov images]# virsh dumpxml r7| grep "/os" -B5
<os>
<type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<nvram template='/usr/share/OVMF/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/r7_VARS.fd</nvram>
<boot dev='hd'/>
</os>
[root@sriov images]# python
Python 2.7.5 (default, Feb 11 2014, 07:46:25)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con = libvirt.open('')
>>> quit()
[root@sriov images]# ll /var/lib/libvirt/qemu/nvram/r7_VARS.fd
-rw-------. 1 qemu qemu 131072 Oct 14 16:50 /var/lib/libvirt/qemu/nvram/r7_VARS.fd
[root@sriov images]# python
Python 2.7.5 (default, Feb 11 2014, 07:46:25)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con = libvirt.open('')
>>> dom = con.lookupByName('r7')
>>> dom.destroy()
0
>>> dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM)
0
>>> quit()
[root@sriov images]# ll /var/lib/libvirt/qemu/nvram/r7_VARS.fd
ls: cannot access /var/lib/libvirt/qemu/nvram/r7_VARS.fd: No such file or directory
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2015-0334.html