[Lguest] [lguest] Reboot Implemented

Rusty Russell rusty at rustcorp.com.au
Fri Dec 28 14:04:10 EST 2007


On Thursday 27 December 2007 16:45:56 Balaji Rao wrote:
> Hi rusty,
>
> Thanks for the review!
>
> I have incorporated your suggestions into the patch. Please review it and
> let me know if there are any more mistakes.

Looks great!

I need a Signed-off-by: line (see Documentation/SubmittingPatches) then I'll 
apply it.

A few more minor comments:

> +/* Restart the guest */
> +static int restart_guest() {

It's nicer to put "void" inside the (), and the { belongs on the next line.

> +	struct device *dev = devices.dev;
> +	struct vblk_info *vblk;
> +
> +	/* Closing the waked_fd causes the waker thread to die */
> +	close  (waker_fd);
> +	/* Closing the workpipe[1] causes io_thread thread to die */
> +	while (dev) {
> +		if (strcmp(dev->name, "block") == 0) {
> +			vblk = dev->priv;
> +			close (vblk->workpipe[1]);
> +		}
> +		dev = dev->next;
> +	}
> +	return execv(main_args[0],main_args);

This could be a for loop, and I don't think it should return: I'd make 
it 'static void restart_guest(void)' and do the err(1, "Could not exec %s", 
main_args[0]); at the bottom if the execv() returns.

Thanks!
Rusty.



More information about the Lguest mailing list