Your message dated Tue, 5 Oct 2021 21:45:12 +0300
with message-id <[email protected]>
and subject line Re: Bug#939413: qemu-system: Regression: `-drive 
file=/dev/fdset/$FD` fails with EPERM
has caused the Debian Bug report #939413,
regarding qemu-system: Regression: `-drive file=/dev/fdset/$FD` fails with EPERM
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
939413: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939413
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: qemu-system-x86
Version: 1:4.1-1
Severity: normal
File: qemu-system

Dear Maintainer,

Using a pre-opened file descriptor to a disk image no longer work as
documented (and as it used to with ≤1:3.1+dfsg-8~deb10u1):

    $ touch /tmp/disk.img
    $ qemu-system-x86_64 -display none \
        -add-fd "fd=3,set=0" \
        -drive "file=/dev/fdset/0,format=raw,media=disk" \
        3<>/tmp/disk.img
    qemu-system-x86_64: -drive file=/dev/fdset/0,format=raw,media=disk: Could 
not open '/dev/fdset/0': Permission denied

Interestingly, for read-only media it does work if the file descriptor
is opened in read-only mode:

    $ qemu-system-x86_64 -display none \
        -add-fd "fd=3,set=0" \
        -drive "file=/dev/fdset/0,format=raw,media=cdrom,readonly" \
        3</tmp/disk.img

-- 
Guilhem.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages qemu-system-x86 depends on:
ii  ipxe-qemu             1.0.0+git-20190125.36a4c85-1
ii  libaio1               0.3.112-5
ii  libasound2            1.1.8-1
ii  libbluetooth3         5.50-1+b1
ii  libbrlapi0.6          5.6-11
ii  libc6                 2.28-10
ii  libcacard0            1:2.6.1-1
ii  libcapstone3          4.0.1+really+3.0.5-1+b1
ii  libepoxy0             1.5.3-0.1
ii  libfdt1               1.5.0-2
ii  libgbm1               19.1.4-1
ii  libgcc1               1:9.2.1-6
ii  libglib2.0-0          2.60.6-2
ii  libgnutls30           3.6.9-4
ii  libibverbs1           24.0-2
ii  libjpeg62-turbo       1:1.5.2-2+b1
ii  libncursesw6          6.1+20190803-1
ii  libnettle6            3.5.1+really3.4.1-1
ii  libnuma1              2.0.12-1+b1
ii  libpixman-1-0         0.36.0-1
ii  libpng16-16           1.6.37-1
ii  librdmacm1            24.0-2
ii  libsasl2-2            2.1.27+dfsg-1
ii  libseccomp2           2.4.1-2
ii  libspice-server1      0.14.2-3
ii  libtinfo6             6.1+20190803-1
ii  libusb-1.0-0          2:1.0.23-1
ii  libusbredirparser1    0.8.0-1+b1
ii  libvdeplug2           2.3.2+r586-2.2+b1
ii  libvirglrenderer0     0.7.0-2
ii  libxendevicemodel1    4.11.1+92-g6c33308a8d-2+b1
ii  libxenevtchn1         4.11.1+92-g6c33308a8d-2+b1
ii  libxenforeignmemory1  4.11.1+92-g6c33308a8d-2+b1
ii  libxengnttab1         4.11.1+92-g6c33308a8d-2+b1
ii  libxenmisc4.11        4.11.1+92-g6c33308a8d-2+b1
ii  libxenstore3.0        4.11.1+92-g6c33308a8d-2+b1
ii  libxentoolcore1       4.11.1+92-g6c33308a8d-2+b1
ii  qemu-system-common    1:4.1-1
ii  qemu-system-data      1:4.1-1
ii  seabios               1.12.0-1
ii  zlib1g                1:1.2.11.dfsg-1+b1

Versions of packages qemu-system-x86 recommends:
pn  ovmf             <none>
ii  qemu-system-gui  1:4.1-1
pn  qemu-utils       <none>

Versions of packages qemu-system-x86 suggests:
pn  qemu-block-extra  <none>
pn  samba             <none>
pn  sgabios           <none>
pn  vde2              <none>

-- no debconf information

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Again, this is a feature without any documentation (an irony: the first
non-source-code hit on google for "qemu fdset" leads to this very bugreport! :),
which is non-obvious at first.

An fdset supposed to have at least two file descriptors: one opened read-only
and another opened read-write.

Internally qemu does more than one open of a given file. First it tries to
open it read-only (controllable by another not-as-well-documented flag
auto-read-only=off (default is on).  And when you give it an fdset with
a single file descriptor open for read-write, it fails to find readonly
version of it.

In order to fix this issue, you either have to give it two file descriptors
(for the SAME file!) - one rw and one ro, or you can tell it to always open
files in read-write mode.

I'm closing this bug report since it is about wrong usage which leads to
wrong results.  But the actual issue here, as far as I can tell, is the
lack of documentation.  The whole thing, as far as I can see, is supposed
to be used within libvirt or some other management tool, since the concept
is quite difficult to use from command line, especially with this huge amount
of documentation...

Thanks,

/mjt

--- End Message ---

Reply via email to