Commit 51bbd47d3641beb4a8c2a35d55488c859b60c82d

Authored by Linus Torvalds

Merge branch 'lguest' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus

* 'lguest' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  lguest: Odd Fixes
  lguest: clean up warnings in demonstration launcher.

Showing 3 changed files Side-by-side Diff

Documentation/lguest/Makefile
1 1 # This creates the demonstration utility "lguest" which runs a Linux guest.
2   -CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include -I../../arch/x86/include -U_FORTIFY_SOURCE
  2 +# Missing headers? Add "-I../../include -I../../arch/x86/include"
  3 +CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE
3 4  
4 5 all: lguest
5 6  
Documentation/lguest/lguest.c
... ... @@ -39,14 +39,14 @@
39 39 #include <limits.h>
40 40 #include <stddef.h>
41 41 #include <signal.h>
42   -#include "linux/lguest_launcher.h"
43   -#include "linux/virtio_config.h"
44   -#include "linux/virtio_net.h"
45   -#include "linux/virtio_blk.h"
46   -#include "linux/virtio_console.h"
47   -#include "linux/virtio_rng.h"
48   -#include "linux/virtio_ring.h"
49   -#include "asm/bootparam.h"
  42 +#include <linux/virtio_config.h>
  43 +#include <linux/virtio_net.h>
  44 +#include <linux/virtio_blk.h>
  45 +#include <linux/virtio_console.h>
  46 +#include <linux/virtio_rng.h>
  47 +#include <linux/virtio_ring.h>
  48 +#include <asm/bootparam.h>
  49 +#include "../../include/linux/lguest_launcher.h"
50 50 /*L:110
51 51 * We can ignore the 42 include files we need for this program, but I do want
52 52 * to draw attention to the use of kernel-style types.
53 53  
... ... @@ -1447,14 +1447,15 @@
1447 1447 static void configure_device(int fd, const char *tapif, u32 ipaddr)
1448 1448 {
1449 1449 struct ifreq ifr;
1450   - struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr;
  1450 + struct sockaddr_in sin;
1451 1451  
1452 1452 memset(&ifr, 0, sizeof(ifr));
1453 1453 strcpy(ifr.ifr_name, tapif);
1454 1454  
1455 1455 /* Don't read these incantations. Just cut & paste them like I did! */
1456   - sin->sin_family = AF_INET;
1457   - sin->sin_addr.s_addr = htonl(ipaddr);
  1456 + sin.sin_family = AF_INET;
  1457 + sin.sin_addr.s_addr = htonl(ipaddr);
  1458 + memcpy(&ifr.ifr_addr, &sin, sizeof(sin));
1458 1459 if (ioctl(fd, SIOCSIFADDR, &ifr) != 0)
1459 1460 err(1, "Setting %s interface address", tapif);
1460 1461 ifr.ifr_flags = IFF_UP;
... ... @@ -3488,7 +3488,7 @@
3488 3488 M: Rusty Russell <rusty@rustcorp.com.au>
3489 3489 L: lguest@lists.ozlabs.org
3490 3490 W: http://lguest.ozlabs.org/
3491   -S: Maintained
  3491 +S: Odd Fixes
3492 3492 F: Documentation/lguest/
3493 3493 F: arch/x86/lguest/
3494 3494 F: drivers/lguest/