Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 317341 - [PATCH] sys-apps/sandbox (git): add libkvm support for FreeBSD + minor build fix
Summary: [PATCH] sys-apps/sandbox (git): add libkvm support for FreeBSD + minor build fix
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-26 18:41 UTC by Alexis Ballier
Modified: 2020-09-08 11:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
libkvm support (0001-Detect-and-use-libkvm.patch,6.25 KB, patch)
2010-04-26 18:42 UTC, Alexis Ballier
Details | Diff
new version (0001-Detect-and-use-libkvm.patch,6.12 KB, patch)
2010-04-27 17:57 UTC, Alexis Ballier
Details | Diff
new patch again (0001-Detect-and-use-libkvm.patch,6.12 KB, patch)
2010-04-27 18:00 UTC, Alexis Ballier
Details | Diff
updated version (0001-Detect-and-use-libkvm.patch,6.15 KB, patch)
2010-04-27 21:13 UTC, Alexis Ballier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Ballier gentoo-dev 2010-04-26 18:41:39 UTC
libkvm allows to get the command line used for a process; it's used here as an alternative of reading /proc which is not available on FreeBSD.
Comment 1 Alexis Ballier gentoo-dev 2010-04-26 18:42:06 UTC
Created attachment 229293 [details, diff]
libkvm support
Comment 2 SpanKY gentoo-dev 2010-04-27 17:01:44 UTC
style problems:
 - sys/sysctl.h order is incorrect in configure.ac
 - HAVE_XXX values should be defined/undefined, not 0/1 ... then use #ifdef
 - style in sb_get_kvm_cmdline() is broken in many ways
 - replace sb_get_cmdline instead of a new sb_get_kvm_cmdline() -- have it return a dummy file name
 - move the contents of sb_get_kvm_cmdline() to your own sb_copy_file_to_fd().  if you want to extend the arguments to also pass in the pid, that's fine.
Comment 3 Alexis Ballier gentoo-dev 2010-04-27 17:57:41 UTC
Created attachment 229423 [details, diff]
new version
Comment 4 Alexis Ballier gentoo-dev 2010-04-27 18:00:06 UTC
Created attachment 229425 [details, diff]
new patch again

missed one #if -> #ifdef
Comment 5 Alexis Ballier gentoo-dev 2010-04-27 18:01:14 UTC
(In reply to comment #2)
> style problems:
>  - sys/sysctl.h order is incorrect in configure.ac
>  - HAVE_XXX values should be defined/undefined, not 0/1 ... then use #ifdef

done

>  - style in sb_get_kvm_cmdline() is broken in many ways

please be more verbose

>  - replace sb_get_cmdline instead of a new sb_get_kvm_cmdline() -- have it
> return a dummy file name
>  - move the contents of sb_get_kvm_cmdline() to your own sb_copy_file_to_fd(). 
> if you want to extend the arguments to also pass in the pid, that's fine.

done and renamed to match the extra argument
Comment 6 SpanKY gentoo-dev 2010-04-27 18:54:05 UTC
reading the rest of the file shows the correct style ...
 - you need whitespace between for/if and the paren
 - whitespace doesnt save code, so you need spaces after the semicolons in for() and commas in function arguments
 - dont put if statements on the same line
 - you dont need the paren in the 3rd arg to kvm_getprocs
 - it's "type *var", not "type * var".
Comment 7 Alexis Ballier gentoo-dev 2010-04-27 21:13:59 UTC
Created attachment 229447 [details, diff]
updated version