Skip to content

Commit

Permalink
cleanup(gvisor): use scap_gvisor_platform in params
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <luca@guerra.sh>
  • Loading branch information
LucaGuerra authored and Andreagit97 committed Jan 17, 2024
1 parent edb2926 commit 72a5082
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions userspace/libscap/engine/gvisor/gvisor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ static int32_t gvisor_init(scap_t* main_handle, scap_open_args* oargs)
{
scap_gvisor::engine *gv = main_handle->m_engine.m_handle;
struct scap_gvisor_engine_params *params = (struct scap_gvisor_engine_params *)oargs->engine_params;
scap_gvisor_platform *gvisor_platform = reinterpret_cast<struct scap_gvisor_platform*>(params->gvisor_platform);
return gv->init(params->gvisor_config_path, params->gvisor_root_path, params->no_events, params->gvisor_epoll_timeout, gvisor_platform);
return gv->init(params->gvisor_config_path, params->gvisor_root_path, params->no_events, params->gvisor_epoll_timeout, params->gvisor_platform);
}

static void gvisor_free_handle(struct scap_engine_handle engine)
Expand Down
2 changes: 1 addition & 1 deletion userspace/libscap/engine/gvisor/gvisor_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C"

bool no_events; //< Pinky swear we don't want any event from it (i.e. next will always fail, just have proc scan)
int gvisor_epoll_timeout; ///< When using gvisor, the timeout to wait for a new event
struct scap_platform *gvisor_platform; ///< The gvisor engine and platform have a bit of shared state
struct scap_gvisor_platform *gvisor_platform; ///< The gvisor engine and platform have a bit of shared state
};

struct scap_platform;
Expand Down
2 changes: 1 addition & 1 deletion userspace/libsinsp/sinsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ void sinsp::open_gvisor(const std::string& config_path, const std::string& root_
params.gvisor_epoll_timeout = epoll_timeout;

struct scap_platform* platform = scap_gvisor_alloc_platform(::on_new_entry_from_proc, this);
params.gvisor_platform = platform;
params.gvisor_platform = reinterpret_cast<scap_gvisor_platform*>(platform);

oargs.engine_params = &params;

Expand Down

0 comments on commit 72a5082

Please sign in to comment.