* [PATCH 0/2] cryo: fixes for handling options -l and -f
@ 2008-06-09 14:47 Benjamin Thery
2008-06-09 14:47 ` [PATCH 1/2] cryo: Fix option -l Benjamin Thery
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Benjamin Thery @ 2008-06-09 14:47 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: Containers, Benjamin Thery
Serge,
I've cloned your cryo tree and I'm starting to play with it.
Here are a couple of trivial patches to fix some small issues
with options handling: -l (list) and -f in checkpoint mode.
Still trying to restart the 'sleep' test program.
Benjamin
--
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] cryo: Fix option -l
2008-06-09 14:47 [PATCH 0/2] cryo: fixes for handling options -l and -f Benjamin Thery
@ 2008-06-09 14:47 ` Benjamin Thery
2008-06-09 14:47 ` [PATCH 2/2] cryo: Fix option -f in checkpointing mode Benjamin Thery
[not found] ` <20080609144709.408752383-4vkkeT0zb4ZEtYaxpPmRp1aPQRlvutdw@public.gmane.org>
2 siblings, 0 replies; 7+ messages in thread
From: Benjamin Thery @ 2008-06-09 14:47 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: Containers, Benjamin Thery
This tiny patch fixes the handling of option -l.
'l' must be added to the getopt() call and the subsequent switch{] if
we don't want to exit too soon.
This makes the following command works:
$ cr -l -t test.cryo
Signed-off-by: Benjamin Thery <benjamin.thery-6ktuUTfB/bM@public.gmane.org>
---
cr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: cryodev/cr.c
===================================================================
--- cryodev.orig/cr.c
+++ cryodev/cr.c
@@ -1227,10 +1227,11 @@ int main(int argc, char **argv)
int fd = 0;
int perm = O_RDONLY;
- while ((ch = getopt(argc, argv, "dmp:rRksf:")) != EOF) {
+ while ((ch = getopt(argc, argv, "dlmp:rRksf:")) != EOF) {
switch (ch) {
case 'd': cr_mode |= CR_DEBUG; Debug_mode = 1; break;
case 'k': cr_mode |= CR_KILL; break;
+ case 'l': mode = ch; break;
case 's': cr_mode |= CR_STOP; break;
case 'm': cr_mode |= CR_MMAP; break;
case 'p': mode = ch; fd = 1; perm = O_WRONLY; pid = (pid_t)atoi(optarg); break;
--
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] cryo: Fix option -f in checkpointing mode
2008-06-09 14:47 [PATCH 0/2] cryo: fixes for handling options -l and -f Benjamin Thery
2008-06-09 14:47 ` [PATCH 1/2] cryo: Fix option -l Benjamin Thery
@ 2008-06-09 14:47 ` Benjamin Thery
[not found] ` <20080609144844.524643174-4vkkeT0zb4ZEtYaxpPmRp1aPQRlvutdw@public.gmane.org>
[not found] ` <20080609144709.408752383-4vkkeT0zb4ZEtYaxpPmRp1aPQRlvutdw@public.gmane.org>
2 siblings, 1 reply; 7+ messages in thread
From: Benjamin Thery @ 2008-06-09 14:47 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: Containers, Benjamin Thery
Option -f couldn't be used in conjunction with option -p (for checkpointing).
O_CREAT is missing in the flags passed to open().
Now, we can do:
$ cr -p MYPID -f test.cryo
(I know the coding style is not perfect (long lines, several instructions
on the same line), but it fits with cryo's style :) ).
Signed-off-by: Benjamin Thery <benjamin.thery-6ktuUTfB/bM@public.gmane.org>
---
cr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: cryodev/cr.c
===================================================================
--- cryodev.orig/cr.c
+++ cryodev/cr.c
@@ -1234,7 +1234,7 @@ int main(int argc, char **argv)
case 'l': mode = ch; break;
case 's': cr_mode |= CR_STOP; break;
case 'm': cr_mode |= CR_MMAP; break;
- case 'p': mode = ch; fd = 1; perm = O_WRONLY; pid = (pid_t)atoi(optarg); break;
+ case 'p': mode = ch; fd = 1; perm = O_WRONLY|O_CREAT; pid = (pid_t)atoi(optarg); break;
case 'r': mode = ch; break;
case 'f': strncpy(filename, optarg, sizeof(filename)); break;
default: usage(); exit(1);
--
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] cryo: Fix option -f in checkpointing mode
[not found] ` <20080609144844.524643174-4vkkeT0zb4ZEtYaxpPmRp1aPQRlvutdw@public.gmane.org>
@ 2008-06-09 16:16 ` Dave Hansen
2008-06-09 16:42 ` Serge E. Hallyn
0 siblings, 1 reply; 7+ messages in thread
From: Dave Hansen @ 2008-06-09 16:16 UTC (permalink / raw)
To: Benjamin Thery; +Cc: Containers
On Mon, 2008-06-09 at 16:47 +0200, Benjamin Thery wrote:
> Option -f couldn't be used in conjunction with option -p (for
> checkpointing).
> O_CREAT is missing in the flags passed to open().
>
> Now, we can do:
>
> $ cr -p MYPID -f test.cryo
>
> (I know the coding style is not perfect (long lines, several
> instructions
> on the same line), but it fits with cryo's style :) ).
So, I suggest that we start using kernel coding style on this sucker.
We're all used to it, and the original developer isn't around to bitch
about it. :)
-- Dave
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] cryo: Fix option -f in checkpointing mode
2008-06-09 16:16 ` Dave Hansen
@ 2008-06-09 16:42 ` Serge E. Hallyn
[not found] ` <20080609164203.GB1569-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Serge E. Hallyn @ 2008-06-09 16:42 UTC (permalink / raw)
To: Dave Hansen; +Cc: Containers, Benjamin Thery
Quoting Dave Hansen (dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org):
> On Mon, 2008-06-09 at 16:47 +0200, Benjamin Thery wrote:
> > Option -f couldn't be used in conjunction with option -p (for
> > checkpointing).
> > O_CREAT is missing in the flags passed to open().
> >
> > Now, we can do:
> >
> > $ cr -p MYPID -f test.cryo
> >
> > (I know the coding style is not perfect (long lines, several
> > instructions
> > on the same line), but it fits with cryo's style :) ).
>
> So, I suggest that we start using kernel coding style on this sucker.
> We're all used to it, and the original developer isn't around to bitch
> about it. :)
Yeah, agreed. That does *not* mean that I want pure style fix patches!! :)
thanks,
-serge
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] cryo: Fix option -f in checkpointing mode
[not found] ` <20080609164203.GB1569-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2008-06-09 16:44 ` Dave Hansen
0 siblings, 0 replies; 7+ messages in thread
From: Dave Hansen @ 2008-06-09 16:44 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: Containers, Benjamin Thery
On Mon, 2008-06-09 at 11:42 -0500, Serge E. Hallyn wrote:
> > So, I suggest that we start using kernel coding style on this
> sucker.
> > We're all used to it, and the original developer isn't around to
> bitch
> > about it. :)
>
> Yeah, agreed. That does *not* mean that I want pure style fix
> patches!! :)
Yep, I'd say treat it the same way we do whitespace in the kernel.
Touch it if you're either in the *IMMEDIATE* area or or patching the
code itself.
-- Dave
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] cryo: fixes for handling options -l and -f
[not found] ` <20080609144709.408752383-4vkkeT0zb4ZEtYaxpPmRp1aPQRlvutdw@public.gmane.org>
@ 2008-06-09 16:55 ` Serge E. Hallyn
0 siblings, 0 replies; 7+ messages in thread
From: Serge E. Hallyn @ 2008-06-09 16:55 UTC (permalink / raw)
To: Benjamin Thery; +Cc: Containers
Quoting Benjamin Thery (benjamin.thery-6ktuUTfB/bM@public.gmane.org):
> Serge,
>
> I've cloned your cryo tree and I'm starting to play with it.
> Here are a couple of trivial patches to fix some small issues
> with options handling: -l (list) and -f in checkpoint mode.
>
> Still trying to restart the 'sleep' test program.
>
> Benjamin
> --
Thanks, applied.
-serge
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-06-09 16:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-09 14:47 [PATCH 0/2] cryo: fixes for handling options -l and -f Benjamin Thery
2008-06-09 14:47 ` [PATCH 1/2] cryo: Fix option -l Benjamin Thery
2008-06-09 14:47 ` [PATCH 2/2] cryo: Fix option -f in checkpointing mode Benjamin Thery
[not found] ` <20080609144844.524643174-4vkkeT0zb4ZEtYaxpPmRp1aPQRlvutdw@public.gmane.org>
2008-06-09 16:16 ` Dave Hansen
2008-06-09 16:42 ` Serge E. Hallyn
[not found] ` <20080609164203.GB1569-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-06-09 16:44 ` Dave Hansen
[not found] ` <20080609144709.408752383-4vkkeT0zb4ZEtYaxpPmRp1aPQRlvutdw@public.gmane.org>
2008-06-09 16:55 ` [PATCH 0/2] cryo: fixes for handling options -l and -f Serge E. Hallyn
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.