Bug 1477665 - Running file on /dev/agpgart raises an error
Summary: Running file on /dev/agpgart raises an error
Keywords:
Status: CLOSED DUPLICATE of bug 1477623
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-02 15:11 UTC by mathieu.tarral
Modified: 2017-08-03 07:55 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-08-03 07:55:20 UTC
Embargoed:


Attachments (Terms of Use)
Dockerfile to reproduce environment (658 bytes, text/plain)
2017-08-02 15:11 UTC, mathieu.tarral
no flags Details

Description mathieu.tarral 2017-08-02 15:11:53 UTC
Created attachment 1308294 [details]
Dockerfile to reproduce environment

Description of problem:

I'm trying to run the file utility on every file of the filesystem, through libguestfs.

I'm walking through the filesystem using guestfs.ls(), and then calling guestfs.file()

I found a special device that is reported present on the filesystem, but absent when asking for file to identify it.


Version-Release number of selected component (if applicable):


How reproducible:
Always


Steps to Reproduce:
1. Mount a Linux filesystem in libguestfs
2. Run Python API guestfs.file('/dev/agpgart')
3. A RuntimeError is raised

Actual results:
A RuntimeError is raised:

In [8]: g.file('/dev/agpgart')
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
/root/test_guestfs.py in <module>()
----> 1 g.file('/dev/agpgart')

/usr/lib/python3/dist-packages/guestfs.py in file(self, path)
   2569         """
   2570         self._check_not_closed ()
-> 2571         r = libguestfsmod.file (self._o, path)
   2572         return r
   2573 

RuntimeError: file: file_stub: /dev/agpgart: No such file or directory



Expected results:
file output for /dev/agpgart


Additional info:

I created a Dockerfile to reproduce the issue.

https://gist.github.com/Wenzel/09b222f3572fa34ec01b50f69c5a556e

Look at https://bugzilla.redhat.com/show_bug.cgi?id=1477623 for how to use it.

Thanks !

Comment 1 Richard W.M. Jones 2017-08-02 15:26:07 UTC
What does
  g.ll ('/dev/agpgart')
return?

Comment 2 Richard W.M. Jones 2017-08-02 15:30:38 UTC
Forget that.  The reproducer is:

$ virt-builder fedora-26
$ guestfish -a fedora-26.img -i
><fs> mknod-c 0777 10 175 /dev/agpgart
><fs> file /dev/agpgart 
libguestfs: error: file: file_stub: /dev/agpgart: No such file or directory

This is reproducible with libguestfs from git.

Comment 3 mathieu.tarral 2017-08-02 20:23:58 UTC
Hi,

thanks for checking it.
If you still wanted the output:


In [1]: g.ll('/dev/agpgart')
Out[1]: 'crw-rw---- 1 0 44 10, 175 Jul 21 14:35 /sysroot/dev/agpgart\n'

Thanks :)

Comment 4 Richard W.M. Jones 2017-08-03 07:55:20 UTC

*** This bug has been marked as a duplicate of bug 1477623 ***


Note You need to log in before you can comment on or make changes to this bug.