qemu.qmp.qom_fuse module

QEMU Object Model FUSE filesystem tool

This script offers a simple FUSE filesystem within which the QOM tree may be browsed, queried and edited using traditional shell tooling.

This script requires the ‘fusepy’ python package.

usage: qom-fuse [-h] [–socket SOCKET] <mount>

Mount a QOM tree as a FUSE filesystem

positional arguments:

<mount> Mount point

optional arguments:
-h, --help

show this help message and exit

--socket SOCKET, -s SOCKET

QMP socket path or address (addr:port). May also be set via QMP_SOCKET environment variable.

class qemu.qmp.qom_fuse.QOMFuse(args: argparse.Namespace)[source]

Bases: qemu.qmp.qom_common.QOMCommand, fuse.Operations

QOMFuse implements both fuse.Operations and QOMCommand.

Operations implements the FS, and QOMCommand implements the CLI command.

classmethod configure_parser(parser: argparse.ArgumentParser)None[source]

Configure a parser with this command’s arguments.

Parameters

parser – argparse parser or subparser object.

fuse: fuse.FUSE
get_ino(path: str)int[source]

Get an inode number for a given QOM path.

getattr(path: str, fh: Optional[IO[bytes]] = None)Mapping[str, object][source]

Returns a dictionary with keys identical to the stat C structure of stat(2).

st_atime, st_mtime and st_ctime should be floats.

NOTE: There is an incompatibility between Linux and Mac OS X concerning st_nlink of directories. Mac OS X counts all files inside the directory, while Linux counts only the subdirectories.

help: str = 'Mount a QOM tree as a FUSE filesystem'

Is the given QOM path a link?

is_object(path: str)bool[source]

Is the given QOM path an object?

is_property(path: str)bool[source]

Is the given QOM path a property?

name: str = 'fuse'
read(path: str, size: int, offset: int, fh: IO[bytes])bytes[source]

Returns a string containing the data requested.

readdir(path: str, fh: IO[bytes])Iterator[str][source]

Can return either a list of names, or a list of (name, attrs, offset) tuples. attrs is a dict as in getattr.

run()int[source]

Run this command.

Returns

0 on success, 1 otherwise.