Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] How to use qmp? #8

Open
therockf opened this issue Feb 29, 2024 · 0 comments
Open

[QUESTION] How to use qmp? #8

therockf opened this issue Feb 29, 2024 · 0 comments

Comments

@therockf
Copy link

therockf commented Feb 29, 2024

Hello
I am exposing qmp on qemu using the example in the readme, but qemu can't find my socket.
I am running inside a docker container

Dockerfile:

---
version: '3'
services:
  readmem:
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Rome
    pull_policy: build
    build:
      context: .
      dockerfile: "./Dockerfile"
    volumes: 
      - /tmp/qmp-my-vm.sock:/tmp/qmp-my-vm.sock
    restart: "unless-stopped"
    container_name: readmem

As you can see, the socket is mapped on /tmp/qmp-my-vm.sock.

Now how to tell the connector where my socket is?

            const char *conn_name = argc > 1? argv[1]: "qemu";
            const char *conn_arg = argc > 2? argv[2]: "";
            const char *os_name = argc > 2? argv[2]: "win32";
            const char *os_arg = argc > 4? argv[4]: "";

            ConnectorInstance<> connector, *conn = conn_name[0] ? &connector : nullptr;
            OsInstance<> os;

            if (conn) {
                if (inventory_create_connector(inventory, conn_name, conn_arg, &connector)) {
                    printf("unable to initialize connector\n");
                    inventory_free(inventory);
                } else { other code ...}
           }

EDIT: I am on cpp, using official https://github.com/memflow/memflow-cmake-example/ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant