Skip to content

Commit

Permalink
Rename old "qemu_procfs" connector name to new "qemu" connector name
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkhoury committed Feb 21, 2024
1 parent 2a9f252 commit 3a6d270
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions doc/src/reference/drivers/memflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[memflow](https://github.com/memflow/memflow) is a live memory introspection framework with a modular architecture.

It has multiple connectors which can be used to access physical memory:
- [qemu_procfs](https://github.com/memflow/memflow-qemu-procfs): access QEMU physical memory
- [qemu](https://github.com/memflow/memflow-qemu): access QEMU physical memory
- [kvm](https://github.com/memflow/memflow-kvm)
- [pcileech](https://github.com/memflow/memflow-pcileech): access pcileech interface
- [coredump](https://github.com/memflow/memflow-coredump): access Microsoft Windows Coredump files
Expand All @@ -18,4 +18,4 @@ It has multiple connectors which can be used to access physical memory:

- `memflow_connector_name`: required
- `memflow_connector_args`: optional
- `vm_name`: optional, will be used if `memflow_connector_name=qemu_procfs`
- `vm_name`: optional, will be used if `memflow_connector_name=qemu`
6 changes: 3 additions & 3 deletions doc/src/tutorial/libvmi.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ cmake --build build

The following example is based on `memflow`, but any libmicrovmi driver can be used.

Assuming memflow connector `qemu_procfs` is installed and a QEMU VM is running:
Assuming memflow connector `qemu` is installed and a QEMU VM is running:
~~~
sudo -E ./examples/vmi-win-guid name <vm name>
~~~

Note: memflow `qemu_procfs` connector requires to be root.
Note: memflow `qemu` connector requires to be root.
Note2: `RUST_LOG=info` or `RUST_LOG=debug` will give you extra info about libmicrovmi searching for available drivers.
Note3: at this point, the `qemu_procfs` connector is hardcoded in LibVMI, but extending the command line argument and `vmi_init` function should be an easy task.
Note3: at this point, the `qemu` connector is hardcoded in LibVMI, but extending the command line argument and `vmi_init` function should be an easy task.
2 changes: 1 addition & 1 deletion python/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_volatility_kvm(session):
def test_volatility_memflow(session):
"""Run the PsList volatility plugin on the memflow connector specified by the URL"""
# example:
# nox -r -s test_volatility_memflow -- vmi:///?memflow_connector_name=qemu_procfs
# nox -r -s test_volatility_memflow -- vmi:///?memflow_connector_name=qemu
args = session.posargs
if not args:
raise RuntimeError("URL required. Example: nox -r -s test_volatility_memflow -- vmi:///...")
Expand Down
4 changes: 2 additions & 2 deletions src/api/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum KVMInitParams {
/// This enumeration reflects the possibilities to initialize Memflow
/// - default: will simply forward the string arguments to the connector
// TODO
// - [`qemu_procfs`](https://github.com/memflow/memflow-qemu-procfs)
// - [`qemu`](https://github.com/memflow/memflow-qemu)
// - [`kvm`](https://github.com/memflow/memflow-kvm)
// - [`pcileech`](https://github.com/memflow/memflow-pcileech)
// - [`coredump`](https://github.com/memflow/memflow-coredump)
Expand Down Expand Up @@ -97,7 +97,7 @@ pub struct CommonInitParams {
/// // memflow.connector_name: mandatory
/// // memflow.connector_args: optional
/// let init_params = DriverInitParams {
/// memflow: Some(MemflowInitParams { connector_name: String::from("qemu_procfs"), ///
/// memflow: Some(MemflowInitParams { connector_name: String::from("qemu"), ///
/// ..Default::default()}),
/// ..Default::default()
/// };
Expand Down
4 changes: 2 additions & 2 deletions src/driver/memflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub enum MemflowDriverError {
InvalidConnectorArgument(String),
}

const QEMU_PROCFS_CONNECTOR_NAME: &str = "qemu_procfs";
const QEMU_PROCFS_CONNECTOR_NAME: &str = "qemu";

pub struct Memflow {
// refcell required because read methods are mutable
Expand All @@ -36,7 +36,7 @@ impl Memflow {
#[allow(clippy::single_match)]
match memflow_init_params.connector_name.as_str() {
QEMU_PROCFS_CONNECTOR_NAME => {
// if init_params.common.vm_name exists and connector_name is qemu_procfs
// if init_params.common.vm_name exists and connector_name is qemu
// then insert vm_name value as 'name' connector args
if init_params.common.is_some() {
extra_args = extra_args.insert("name", &init_params.common.unwrap().vm_name);
Expand Down

0 comments on commit 3a6d270

Please sign in to comment.