Description: nvram hack fix ownership

 libvirt (6.0.0-0ubuntu8.14) focal; urgency=medium
 .
   * Fixup backport of "util: Add phys_port_name support on virPCIGetNetName"
     to include the incorrectly removed "firstEntryName = NULL;" line, which
     caused a regression bringing up network pools. (LP: #1943481)
     - d/p/u/lp-1892132-Add-phys_port_name-support-on-virPCIGetNetName.patch
Author: Matthew Ruffell <matthew.ruffell@canonical.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1943481

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- libvirt-6.0.0.orig/src/qemu/qemu_process.c
+++ libvirt-6.0.0/src/qemu/qemu_process.c
@@ -4400,7 +4400,7 @@ qemuPrepareNVRAM(virQEMUDriverConfigPtr
     if ((dstFD = virFileOpenAs(loader->nvram,
                                O_WRONLY | O_CREAT | O_EXCL,
                                S_IRUSR | S_IWUSR,
-                               cfg->user, cfg->group, 0)) < 0) {
+                               cfg->user, cfg->group, (VIR_FILE_OPEN_FORCE_OWNER | VIR_FILE_OPEN_FORCE_MODE))) < 0) {
         virReportSystemError(-dstFD,
                              _("Failed to create file '%s'"),
                              loader->nvram);
