Re: [Qemu-devel] [PATCH v2 4/4] block: Convert open calls to qemu_open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 06/13/2012 06:26 AM, Kevin Wolf wrote:
Am 08.06.2012 17:42, schrieb Corey Bryant:
This patch converts all block layer open calls to qemu_open.  This
enables all block layer open paths to dup(X) a pre-opened file
descriptor if the filename is of the format /dev/fd/X.  This is
useful if QEMU is restricted from opening certain files.

Note that this adds the O_CLOEXEC flag to the changed open paths
when the O_CLOEXEC macro is defined.

v2:
  -Convert calls to qemu_open instead of file_open (kwolf@xxxxxxxxxx)
  -Mention introduction of O_CLOEXEC (kwolf@xxxxxxxxxx)

Signed-off-by: Corey Bryant <coreyb@xxxxxxxxxxxxxxxxxx>

@@ -950,7 +950,7 @@ static int floppy_probe_device(const char *filename)
      if (strstart(filename, "/dev/fd", NULL))
          prio = 50;

Good to have this context here. I think this has to be removed in
another patch or all our file descriptors will become host_floppy...


Good catch, thanks.  I just sent a patch to fix this.


-    fd = open(filename, O_RDONLY | O_NONBLOCK);
+    fd = qemu_open(filename, O_RDONLY | O_NONBLOCK);
      if (fd < 0) {
          goto out;
      }

Kevin


--
Regards,
Corey


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]