[CRIU] [PATCH 03/12] posix-timer: Add protobuf structure

Pavel Emelyanov xemul at parallels.com
Thu May 30 06:45:44 EDT 2013


On 05/30/2013 03:36 AM, Pavel Tikhomirov wrote:
> 
> Signed-off-by: Pavel Tikhomirov <snorcht at gmail.com>
> ---
>  include/protobuf-desc.h    |    1 +
>  protobuf-desc.c            |    2 ++
>  protobuf/Makefile          |    1 +
>  protobuf/posix-timer.proto |   13 +++++++++++++
>  4 files changed, 17 insertions(+)
>  create mode 100644 protobuf/posix-timer.proto
> 
> diff --git a/include/protobuf-desc.h b/include/protobuf-desc.h
> index 604216b..7321123 100644
> --- a/include/protobuf-desc.h
> +++ b/include/protobuf-desc.h
> @@ -13,6 +13,7 @@ enum {
>  	PB_VMAS,
>  	PB_SIGACT,
>  	PB_ITIMERS,
> +	PB_POSIX_TIMERS,
>  	PB_CREDS,
>  	PB_FS,
>  	PB_UTSNS,
> diff --git a/protobuf-desc.c b/protobuf-desc.c
> index 9846680..9000ac2 100644
> --- a/protobuf-desc.c
> +++ b/protobuf-desc.c
> @@ -37,6 +37,7 @@
>  #include "protobuf/sk-packet.pb-c.h"
>  #include "protobuf/creds.pb-c.h"
>  #include "protobuf/itimer.pb-c.h"
> +#include "protobuf/posix-timer.pb-c.h"
>  #include "protobuf/utsns.pb-c.h"
>  #include "protobuf/ipc-var.pb-c.h"
>  #include "protobuf/ipc-shm.pb-c.h"
> @@ -109,6 +110,7 @@ void cr_pb_init(void)
>  	CR_PB_DESC(INETSK,		InetSk,		inet_sk);
>  	CR_PB_DESC(SK_QUEUES,		SkPacket,	sk_packet);
>  	CR_PB_DESC(ITIMERS,		Itimer,		itimer);
> +	CR_PB_DESC(POSIX_TIMERS,	PosixTimer,	posix_timer);
>  	CR_PB_DESC(CREDS,		Creds,		creds);
>  	CR_PB_DESC(UTSNS,		Utsns,		utsns);
>  	CR_PB_DESC(IPCNS_VAR,		IpcVar,		ipc_var);
> diff --git a/protobuf/Makefile b/protobuf/Makefile
> index eb46a4c..fb0f8d5 100644
> --- a/protobuf/Makefile
> +++ b/protobuf/Makefile
> @@ -35,6 +35,7 @@ proto-obj-y	+= mnt.o
>  proto-obj-y	+= pipe-data.o
>  proto-obj-y	+= sa.o
>  proto-obj-y	+= itimer.o
> +proto-obj-y	+= posix-timer.o
>  proto-obj-y	+= mm.o
>  proto-obj-y	+= sk-opts.o
>  proto-obj-y	+= sk-unix.o
> diff --git a/protobuf/posix-timer.proto b/protobuf/posix-timer.proto
> new file mode 100644
> index 0000000..5c8027b
> --- /dev/null
> +++ b/protobuf/posix-timer.proto

I'd rename itimer.proto file into timer.proto (don't forget to tell git
to detect renames when generating and sending patches) and just added this
new message in there. No need in new .proto file really.

> @@ -0,0 +1,13 @@
> +message posix_timer_entry {
> +	required uint32 	it_id 		= 1;
> +	required uint32		clock_id	= 2;
> +	required uint32 	si_signo	= 3;
> +	required uint32		it_sigev_notify = 4;
> +	required uint64		sival_ptr	= 5;
> +	required uint32		overrun		= 6;
> +
> +	required uint64		isec		= 7;
> +	required uint64		insec		= 8;
> +	required uint64		vsec		= 9;
> +	required uint64		vnsec		= 10;
> +}
> 




More information about the CRIU mailing list