[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r20484: {torvm} Fix incorrect shasum for precached Tor pkg, clean up vmroute (in torvm/trunk/build: kamikaze/common kamikaze/patches win32/src/torvm-w32)



Author: coderman
Date: 2009-09-05 20:54:56 -0400 (Sat, 05 Sep 2009)
New Revision: 20484

Modified:
   torvm/trunk/build/kamikaze/common/pkg-cache.mk
   torvm/trunk/build/kamikaze/patches/001-kamikaze-tor-package.patch
   torvm/trunk/build/kamikaze/patches/002-kamikaze-mod-basefiles.patch
   torvm/trunk/build/kamikaze/patches/003-kamikaze-kernel-config.patch
   torvm/trunk/build/win32/src/torvm-w32/apicommon.c
   torvm/trunk/build/win32/src/torvm-w32/torvm.c
Log:
Fix incorrect shasum for precached Tor pkg, clean up vmrouter util, add support for virtio entropy source, switch Qemu virtual disk to virtio interface.

Modified: torvm/trunk/build/kamikaze/common/pkg-cache.mk
===================================================================
--- torvm/trunk/build/kamikaze/common/pkg-cache.mk	2009-09-05 09:09:31 UTC (rev 20483)
+++ torvm/trunk/build/kamikaze/common/pkg-cache.mk	2009-09-06 00:54:56 UTC (rev 20484)
@@ -130,10 +130,9 @@
 
 TOR_F=tor-0.2.2.1-alpha.tar.gz
 TOR_URL=http://www.torproject.org/dist/$(TOR_F)
-TOR_SUM=10c66a84cedc43726fecf219b6c523e54eac4efff57d6ce4d9031a86933de015
+TOR_SUM=10c66a84cedc43726fecf219b6c523e54eac4efff57d6ce4d9031a86933de013
 
 
-
 # iterative definition to retrieve all of the necessary packages.
 
 ALL_NAMES=GMP MPFR M4 AUTOCONF AUTOMAKE BISON PKGCFG SED IPKGUTIL GENEXT2 LZMAOLD SQUASHFSOLD LZMA SQUASHFS MTD QUILT CCACHE BINUTILS GCC LINUX26 BUSYBOX E2FSPROG LIBTOOL IPTABLES IPROUTE2 LIBEVENT LIBPCAP LIBUPNP ZLIB OPENSSL TOR

Modified: torvm/trunk/build/kamikaze/patches/001-kamikaze-tor-package.patch
===================================================================
--- torvm/trunk/build/kamikaze/patches/001-kamikaze-tor-package.patch	2009-09-05 09:09:31 UTC (rev 20483)
+++ torvm/trunk/build/kamikaze/patches/001-kamikaze-tor-package.patch	2009-09-06 00:54:56 UTC (rev 20484)
@@ -494,8 +494,8 @@
 +TransListenAddress 0.0.0.0
 diff -Naur a/package/tor/files/torvminit b/package/tor/files/torvminit
 --- a/package/tor/files/torvminit	1970-01-01 00:00:00.000000000 +0000
-+++ b/package/tor/files/torvminit	2009-08-19 09:11:07.321473102 +0000
-@@ -0,0 +1,267 @@
++++ b/package/tor/files/torvminit	2009-09-05 23:17:14.921449320 +0000
+@@ -0,0 +1,285 @@
 +#!/bin/sh
 +# Copyright (C) 2008-2009  The Tor Project, Inc.
 +# See LICENSE file for rights and terms.
@@ -549,7 +549,7 @@
 +mkdir -p /dev/pts /dev/shm
 +mount devpts /dev/pts -t devpts
 +
-+# attempt mount of persistent virtual disk
++# setup device files
 +mdbin=`which makedevs`
 +devtable=/etc/device_table.txt
 +if [ -x $mdbin ]; then 
@@ -560,14 +560,18 @@
 +    MAKEDEVS >/dev/null 2>&1
 +  fi
 +fi
-+# last attempt: if no disk exists, assume hda1 and create manually with mknod.
-+hddev=/dev/hda1
-+hdopt="b 3 1"
++
++# check for paravirt disk device
 +hdmntopt="-onoatime,nodiratime"
-+if [ ! -e $hddev ]; then
-+  grep `basename $hddev` /proc/partitions >/dev/null 2>&1
++grep vda1 /proc/partitions >/dev/null 2>&1
++if [ $? -eq 0 ]; then
++  hddev=/dev/vda1
++else
++  grep hda1 /proc/partitions >/dev/null 2>&1
 +  if [ $? -eq 0 ]; then
-+    mknod $hddev $hdopt
++    hddev=/dev/hda1
++  else
++    hddev=/dev/sda1
 +  fi
 +fi
 +mkdir /home
@@ -598,11 +602,25 @@
 +fi
 +
 +# if a read-only directory is available to mount from host OS mnt it too.
-+rofsdev=/dev/hdc1
++rodrives="sdb sda hda hdc vdb vdc"
++rofsdev=""
++for RODR in $rodrives; do
++  grep $RODR /proc/partitions >/dev/null 2>&1
++  if [ $? -eq 0 ]; then
++    grep "${RODR}1" /proc/partitions >/dev/null 2>&1
++    if [ $? -ne 0 ]; then
++      rofsdev="/dev/${RODR}"
++    fi
++  fi
++done
++# If the VM software (Qemu) doesn't show CDROM as block dev, fallback to hdc
++if [[ "$rofsdev" == "" ]]; then
++  rofsdev=/dev/hdc
++fi
 +rofsopt="-oro,noexec,nodev"
 +if [ -e $rofsdev ]; then
 +  mkdir /rofs
-+  mount $rofsopt $rofsdev /rofs 
++  mount $rofsopt $rofsdev /rofs >/dev/null 2>&1
 +  if [ $? -ne 0 ]; then
 +    rmdir /rofs
 +  fi
@@ -765,9 +783,9 @@
 +fi
 diff -Naur a/package/tor/files/vmrouter.sh b/package/tor/files/vmrouter.sh
 --- a/package/tor/files/vmrouter.sh	1970-01-01 00:00:00.000000000 +0000
-+++ b/package/tor/files/vmrouter.sh	2009-09-03 02:24:59.053455953 +0000
-@@ -0,0 +1,171 @@
-+#!/bin/bash
++++ b/package/tor/files/vmrouter.sh	2009-09-06 00:49:21.396238259 +0000
+@@ -0,0 +1,174 @@
++#!/bin/sh
 +# Utility script for Tor VM routing
 +# Source or run directly.
 +
@@ -781,6 +799,9 @@
 +if [ -z $DOLOG ]; then
 +  export DOLOG=1
 +fi
++if [ $DOLOG -eq 0 ]; then
++  LOG_TO=/dev/null
++fi
 +
 +trap_tbl="TRAP"
 +host_filt_tbl="HOSTIN"
@@ -789,18 +810,18 @@
 +cli_postnat_tbl="CLIPOST"
 +
 +vmr_trapon() {
-+  if (( DOLOG )); then echo "vmr_trapon:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_trapon:">>$LOG_TO 2>&1; fi
 +  iptables -t filter -I $trap_tbl -j DROP >>$LOG_TO 2>&1
 +  iptables -t filter -I $trap_tbl -p tcp -j TARPIT >>$LOG_TO 2>&1
 +}
 +
 +vmr_trapoff() {
-+  if (( DOLOG )); then echo "vmr_trapoff:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_trapoff:">>$LOG_TO 2>&1; fi
 +  iptables -t filter --flush $trap_tbl >>$LOG_TO 2>&1
 +}
 +
 +vmr_init() {
-+  if (( DOLOG )); then echo "vmr_init:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_init:">>$LOG_TO 2>&1; fi
 +  iptables -t filter --flush INPUT >>$LOG_TO 2>&1
 +  iptables -t filter --flush FORWARD >>$LOG_TO 2>&1
 +  iptables -t filter --flush OUTPUT >>$LOG_TO 2>&1
@@ -843,9 +864,9 @@
 +}
 +
 +vmr_fwdsetup() {
-+  if (( DOLOG )); then echo "vmr_fwdsetup:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_fwdsetup:">>$LOG_TO 2>&1; fi
 +  # expects default route interface argument
-+  if [ -z "$1" ]; then
++  if [ -z $1 ]; then
 +    return $FAIL
 +  fi
 +  iptables -t filter -I $cli_filt_tbl -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu >>$LOG_TO 2>&1
@@ -861,9 +882,9 @@
 +}
 +
 +vmr_fwdadd() {
-+  if (( DOLOG )); then echo "vmr_fwdadd:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_fwdadd:">>$LOG_TO 2>&1; fi
 +  # expects interface to forward for as argument
-+  if [ -z "$1" ]; then
++  if [ -z $1 ]; then
 +    return $FAIL
 +  fi
 +  iptables -t nat -A $cli_prenat_tbl -i "$1" -p tcp -j REDIRECT --to $TOR_TRANSPORT >>$LOG_TO 2>&1
@@ -871,9 +892,9 @@
 +}
 +
 +vmr_fwddel() {
-+  if (( DOLOG )); then echo "vmr_fwddel:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_fwddel:">>$LOG_TO 2>&1; fi
 +  # expects interface to forward for as argument
-+  if [ -z "$1" ]; then
++  if [ -z $1 ]; then
 +    return $FAIL
 +  fi
 +  iptables -t nat -D $cli_prenat_tbl -i "$1" -p tcp -j REDIRECT --to $TOR_TRANSPORT >>$LOG_TO 2>&1
@@ -881,58 +902,58 @@
 +}
 +
 +vmr_opendhcp() {
-+  if (( DOLOG )); then echo "vmr_opendhcp:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_opendhcp:">>$LOG_TO 2>&1; fi
 +  # expects dhcp interface as argument
-+  if [ -z "$1" ]; then
++  if [ -z $1 ]; then
 +    return $FAIL
 +  fi
 +  iptables -t filter -I $host_filt_tbl -i "$1" -p udp --dport 67:68 --sport 67:68 -j ACCEPT >>$LOG_TO 2>&1
 +}
 +
 +vmr_opentcp() {
-+  if (( DOLOG )); then echo "vmr_opentcp:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_opentcp:">>$LOG_TO 2>&1; fi
 +  iptables -t filter -D $host_filt_tbl -i "$1" -d "$2" -p tcp --dport "$3" -j DROP >>$LOG_TO 2>&1
 +  iptables -t filter -I $host_filt_tbl -i "$1" -d "$2" -p tcp --dport "$3" -j ACCEPT >>$LOG_TO 2>&1
 +}
 +
 +vmr_openudp() {
-+  if (( DOLOG )); then echo "vmr_openudp:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_openudp:">>$LOG_TO 2>&1; fi
 +  iptables -t filter -D $host_filt_tbl -i "$1" -d "$2" -p udp --dport "$3" -j DROP >>$LOG_TO 2>&1
 +  iptables -t filter -I $host_filt_tbl -i "$1" -d "$2" -p udp --dport "$3" -j ACCEPT >>$LOG_TO 2>&1
 +}
 +
 +vmr_closetcp() {
-+  if (( DOLOG )); then echo "vmr_closetcp:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_closetcp:">>$LOG_TO 2>&1; fi
 +  iptables -t filter -D $host_filt_tbl -i "$1" -d "$2" -p tcp --dport "$3" -j ACCEPT >>$LOG_TO 2>&1
 +  iptables -t filter -I $host_filt_tbl -i "$1" -d "$2" -p tcp --dport "$3" -j DROP >>$LOG_TO 2>&1
 +}
 +
 +vmr_closeudp() {
-+  if (( DOLOG )); then echo "vmr_closeudp:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_closeudp:">>$LOG_TO 2>&1; fi
 +  iptables -t filter -D $host_filt_tbl -i "$1" -d "$2" -p udp --dport "$3" -j ACCEPT >>$LOG_TO 2>&1
 +  iptables -t filter -I $host_filt_tbl -i "$1" -d "$2" -p udp --dport "$3" -j DROP >>$LOG_TO 2>&1
 +}
 +
 +vmr_redirtcp() {
-+  if (( DOLOG )); then echo "vmr_redirtcp:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_redirtcp:">>$LOG_TO 2>&1; fi
 +  iptables -t nat -A $cli_prenat_tbl -i "$1" -d "$2" -p tcp --dport "$3" -j REDIRECT --to "$4" >>$LOG_TO 2>&1
 +}
 +
 +vmr_undirtcp() {
-+  if (( DOLOG )); then echo "vmr_undirtcp:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_undirtcp:">>$LOG_TO 2>&1; fi
 +  iptables -t nat -D $cli_prenat_tbl -i "$1" -d "$2" -p tcp --dport "$3" -j REDIRECT --to "$4" >>$LOG_TO 2>&1
 +}
 +
 +vmr_setarp() {
-+  if (( DOLOG )); then echo "vmr_setarp:">>$LOG_TO 2>&1; fi
++  if [ $DOLOG -eq 1 ]; then echo "vmr_setarp:">>$LOG_TO 2>&1; fi
 +  # expects interface, ip, mac arguments
-+  if [ -z "$1" ]; then
++  if [ -z $1 ]; then
 +    return $FAIL
 +  fi
-+  if [ -z "$2" ]; then
++  if [ -z $2 ]; then
 +    return $FAIL
 +  fi
-+  if [ -z "$3" ]; then
++  if [ -z $3 ]; then
 +    return $FAIL
 +  fi
 +  arp -i "$1" -s "$2" "$3" >>$LOG_TO 2>&1

Modified: torvm/trunk/build/kamikaze/patches/002-kamikaze-mod-basefiles.patch
===================================================================
--- torvm/trunk/build/kamikaze/patches/002-kamikaze-mod-basefiles.patch	2009-09-05 09:09:31 UTC (rev 20483)
+++ torvm/trunk/build/kamikaze/patches/002-kamikaze-mod-basefiles.patch	2009-09-06 00:54:56 UTC (rev 20484)
@@ -309,8 +309,8 @@
 -	option timezone	UTC
 diff -Naur a/package/base-files/files/etc/device_table.txt b/package/base-files/files/etc/device_table.txt
 --- a/package/base-files/files/etc/device_table.txt	1970-01-01 00:00:00.000000000 +0000
-+++ b/package/base-files/files/etc/device_table.txt	2009-02-01 09:30:07.194358000 +0000
-@@ -0,0 +1,44 @@
++++ b/package/base-files/files/etc/device_table.txt	2009-09-05 23:00:56.137449152 +0000
+@@ -0,0 +1,52 @@
 +#<name>		<type>	<mode>	<uid>	<gid>	<major>	<minor>	<start>	<inc>	<count>
 +#/dev		d	755	0	0	-	-	-	-	-
 +#/dev		d	755	0	0	-	-	-	-	-
@@ -355,6 +355,14 @@
 +/dev/sdh	b	640	0	0	8	113	1	1	15
 +/dev/sg	c	640	0	0	21	0	0	1	15
 +/dev/scd	b	640	0	0	11	0	0	1	15
++/dev/vda	b	640	0	0	254	0	0	0	-
++/dev/vda	b	640	0	0	254	1	1	1	15
++/dev/vdb	b	640	0	0	254	16	0	0	-
++/dev/vdb	b	640	0	0	254	17	1	1	15
++/dev/vdc	b	640	0	0	254	32	0	0	-
++/dev/vdc	b	640	0	0	254	33	1	1	15
++/dev/vdd	b	640	0	0	254	48	0	0	-
++/dev/vdd	b	640	0	0	254	49	1	1	15
 diff -Naur a/package/base-files/files/etc/diag.sh b/package/base-files/files/etc/diag.sh
 --- a/package/base-files/files/etc/diag.sh	2009-04-30 21:00:57.896294000 +0000
 +++ b/package/base-files/files/etc/diag.sh	1970-01-01 00:00:00.000000000 +0000

Modified: torvm/trunk/build/kamikaze/patches/003-kamikaze-kernel-config.patch
===================================================================
--- torvm/trunk/build/kamikaze/patches/003-kamikaze-kernel-config.patch	2009-09-05 09:09:31 UTC (rev 20483)
+++ torvm/trunk/build/kamikaze/patches/003-kamikaze-kernel-config.patch	2009-09-06 00:54:56 UTC (rev 20484)
@@ -1,6 +1,6 @@
 diff -Naur a/target/linux/x86/config-2.6.28 b/target/linux/x86/config-2.6.28
 --- a/target/linux/x86/config-2.6.28	2009-05-15 10:40:04.149461000 +0000
-+++ b/target/linux/x86/config-2.6.28	2009-09-03 17:12:02.497449021 +0000
++++ b/target/linux/x86/config-2.6.28	2009-09-05 22:40:47.701450885 +0000
 @@ -2,7 +2,6 @@
  CONFIG_4KSTACKS=y
  # CONFIG_60XX_WDT is not set
@@ -111,7 +111,7 @@
  CONFIG_GENERIC_IOMAP=y
  CONFIG_GENERIC_ISA_DMA=y
  # CONFIG_GENERIC_TIME_VSYSCALL is not set
-@@ -126,36 +137,46 @@
+@@ -126,36 +137,47 @@
  CONFIG_HAVE_ARCH_TRACEHOOK=y
  CONFIG_HAVE_ATOMIC_IOMAP=y
  # CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
@@ -159,18 +159,18 @@
  CONFIG_HT_IRQ=y
  # CONFIG_HUGETLBFS is not set
  CONFIG_HW_CONSOLE=y
--CONFIG_HW_RANDOM=y
-+# CONFIG_HW_RANDOM is not set
+ CONFIG_HW_RANDOM=y
  # CONFIG_HW_RANDOM_AMD is not set
 -CONFIG_HW_RANDOM_GEODE=y
 +# CONFIG_HW_RANDOM_GEODE is not set
  # CONFIG_HW_RANDOM_INTEL is not set
 -CONFIG_HW_RANDOM_VIA=y
 +# CONFIG_HW_RANDOM_VIA is not set
++CONFIG_HW_RANDOM_VIRTIO=y
  # CONFIG_I2C is not set
  # CONFIG_I6300ESB_WDT is not set
  # CONFIG_I8K is not set
-@@ -170,7 +191,7 @@
+@@ -170,7 +192,7 @@
  CONFIG_IDE_GENERIC=y
  # CONFIG_IDE_PROC_FS is not set
  CONFIG_IDE_TIMINGS=y
@@ -179,7 +179,7 @@
  CONFIG_INPUT=y
  CONFIG_INPUT_KEYBOARD=y
  CONFIG_INPUT_MOUSE=y
-@@ -178,6 +199,8 @@
+@@ -178,6 +200,8 @@
  CONFIG_INPUT_MOUSEDEV_PSAUX=y
  CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
  CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
@@ -188,7 +188,7 @@
  # CONFIG_IOMMU_HELPER is not set
  CONFIG_IO_DELAY_0X80=y
  # CONFIG_IO_DELAY_0XED is not set
-@@ -195,6 +218,9 @@
+@@ -195,6 +219,9 @@
  # CONFIG_IT87_WDT is not set
  # CONFIG_ITCO_WDT is not set
  CONFIG_KALLSYMS=y
@@ -198,7 +198,7 @@
  CONFIG_KEXEC=y
  CONFIG_KEYBOARD_ATKBD=y
  # CONFIG_KEYBOARD_LKKBD is not set
-@@ -204,13 +230,15 @@
+@@ -204,13 +231,15 @@
  # CONFIG_KEYBOARD_XTKBD is not set
  CONFIG_KTIME_SCALAR=y
  # CONFIG_LANCE is not set
@@ -216,7 +216,7 @@
  # CONFIG_MACHZ_WDT is not set
  # CONFIG_MACINTOSH_DRIVERS is not set
  CONFIG_MATH_EMULATION=y
-@@ -231,15 +259,16 @@
+@@ -231,15 +260,16 @@
  # CONFIG_MK6 is not set
  # CONFIG_MK7 is not set
  # CONFIG_MK8 is not set
@@ -239,7 +239,7 @@
  # CONFIG_MOUSE_SERIAL is not set
  # CONFIG_MOUSE_VSXXXAA is not set
  # CONFIG_MPENTIUM4 is not set
-@@ -259,10 +288,13 @@
+@@ -259,17 +289,36 @@
  # CONFIG_MWINCHIPC6 is not set
  CONFIG_NAMESPACES=y
  # CONFIG_NATSEMI is not set
@@ -253,21 +253,31 @@
  # CONFIG_NSC_GPIO is not set
  CONFIG_NVRAM=y
  # CONFIG_OLPC is not set
-@@ -270,6 +302,13 @@
+ # CONFIG_OPTIMIZE_INLINING is not set
  CONFIG_PAGEFLAGS_EXTENDED=y
  CONFIG_PAGE_OFFSET=0xC0000000
- # CONFIG_PARAVIRT_GUEST is not set
+-# CONFIG_PARAVIRT_GUEST is not set
 +CONFIG_VIRTUALIZATION=y
++CONFIG_PARAVIRT_GUEST=y
++# CONFIG_VMI is not set
 +# CONFIG_KVM is not set
-+# CONFIG_LGUEST is not set
++CONFIG_KVM_CLOCK=y
++# CONFIG_KVM_GUEST is not set
++CONFIG_LGUEST=y
++CONFIG_LGUEST_GUEST=y
++CONFIG_PARAVIRT=y
++CONFIG_PARAVIRT_CLOCK=y
 +CONFIG_VIRTIO=y
 +CONFIG_VIRTIO_RING=y
 +CONFIG_VIRTIO_PCI=y
 +CONFIG_VIRTIO_BALLOON=y
++CONFIG_VIRTIO_BLK=y
++CONFIG_VIRTIO_NET=y
++CONFIG_VIRTIO_CONSOLE=y
  # CONFIG_PC8736x_GPIO is not set
  # CONFIG_PC87413_WDT is not set
  CONFIG_PCI=y
-@@ -282,26 +321,30 @@
+@@ -282,26 +331,30 @@
  # CONFIG_PCI_GODIRECT is not set
  # CONFIG_PCI_GOMMCONFIG is not set
  # CONFIG_PCI_GOOLPC is not set
@@ -303,7 +313,7 @@
  # CONFIG_SCSI_DMA is not set
  CONFIG_SCx200=y
  CONFIG_SCx200HR_TIMER=y
-@@ -318,26 +361,29 @@
+@@ -318,26 +371,29 @@
  # CONFIG_SERIO_RAW is not set
  CONFIG_SERIO_SERPORT=y
  # CONFIG_SLAB is not set
@@ -336,7 +346,7 @@
  CONFIG_VM86=y
  CONFIG_VM_EVENT_COUNTERS=y
  # CONFIG_VORTEX is not set
-@@ -349,23 +395,25 @@
+@@ -349,23 +405,25 @@
  # CONFIG_WDT is not set
  CONFIG_X86=y
  CONFIG_X86_32=y
@@ -366,7 +376,7 @@
  CONFIG_X86_LOCAL_APIC=y
  # CONFIG_X86_LONGRUN is not set
  CONFIG_X86_MCE=y
-@@ -377,13 +425,13 @@
+@@ -377,13 +435,13 @@
  # CONFIG_X86_P4_CLOCKMOD is not set
  # CONFIG_X86_PAE is not set
  CONFIG_X86_PAT=y
@@ -382,7 +392,7 @@
  CONFIG_X86_RESERVE_LOW_64K=y
  # CONFIG_X86_SPEEDSTEP_CENTRINO is not set
  # CONFIG_X86_SPEEDSTEP_ICH is not set
-@@ -392,6 +440,240 @@
+@@ -392,6 +450,240 @@
  CONFIG_X86_UP_APIC=y
  CONFIG_X86_UP_IOAPIC=y
  CONFIG_X86_VERBOSE_BOOTUP=y

Modified: torvm/trunk/build/win32/src/torvm-w32/apicommon.c
===================================================================
--- torvm/trunk/build/win32/src/torvm-w32/apicommon.c	2009-09-05 09:09:31 UTC (rev 20483)
+++ torvm/trunk/build/win32/src/torvm-w32/apicommon.c	2009-09-06 00:54:56 UTC (rev 20484)
@@ -633,17 +633,17 @@
 BOOL entropy(DWORD   len,
              BYTE ** rndbuf)
 {
-  *rndbuf = NULL;
   HCRYPTPROV provhnd;
   int retval, i;
   BYTE *nullbuf = NULL;
   DWORD nblen = 1024;
+  *rndbuf = NULL;
   retval = CryptAcquireContext(&provhnd, NULL, NULL, PROV_RSA_FULL, 0);
   if (retval == 0) {
     lerror("CryptAcquireContext failed in call to entropy.");
     return FALSE;
   }
-  rndbuf = malloc(len);
+  *rndbuf = malloc(len);
   nullbuf = malloc(nblen);
   for (i = 0; i < 128; i++) {
     if (!CryptGenRandom(provhnd, nblen, nullbuf)) {

Modified: torvm/trunk/build/win32/src/torvm-w32/torvm.c
===================================================================
--- torvm/trunk/build/win32/src/torvm-w32/torvm.c	2009-09-05 09:09:31 UTC (rev 20483)
+++ torvm/trunk/build/win32/src/torvm-w32/torvm.c	2009-09-06 00:54:56 UTC (rev 20484)
@@ -1493,7 +1493,7 @@
   BYTE * rndstr = NULL;
   char * rndarg = NULL;
   char * cchr;
-  DWORD rndlen = 32;
+  int rndlen = 32;
   const char * basecmds = "quiet loglevel=0 clocksource=hpet";
   const char * dbgcmds  = "loglevel=9 clocksource=hpet DEBUGINIT";
   *cmdline = malloc(cmdlen);
@@ -1508,11 +1508,12 @@
     cchr = rndarg;
     while (*cchr)
       cchr++;
-    for (; rndlen >= 0; --rndlen) {
-      snprintf (cchr, 2,
+    while (rndlen > 0) {
+      snprintf (cchr, 3,
                 "%02X",
-                *(rndstr + rndlen));
+                rndstr[rndlen-1]);
       cchr += 2;
+      rndlen--;
     }
     *cchr = 0;
     free(rndstr);
@@ -1538,7 +1539,7 @@
   else {
     if (brif->isdhcp == FALSE) {
       snprintf (*cmdline, cmdlen -1,
-                "%s %s%s %s IP=%s MASK=%s GW=%s MAC=%s MTU=%d PRIVIP=%s CTLSOCK=%s:9051 HASHPW=%s %s%s%s%s%s",
+                "%s %s%s %s IP=%s MASK=%s GW=%s MAC=%s MTU=%d PRIVIP=%s CTLSOCK=%s:9051 HASHPW=%s %s%s%s%s %s",
                 usedebug ? dbgcmds : basecmds,
                 myhostname ? "USEHOSTNAME=" : "",
                 myhostname ? myhostname : "",
@@ -1563,7 +1564,7 @@
         myhostname = brif->dhcpname;
 
       snprintf (*cmdline, cmdlen -1,
-                "%s %s%s %s IP=%s MASK=%s GW=%s MAC=%s MTU=%d PRIVIP=%s ISDHCP DHCPSVR=%s DHCPNAME=%s CTLSOCK=%s:9051 HASHPW=%s %s%s%s%s %s%s%s%s%s",
+                "%s %s%s %s IP=%s MASK=%s GW=%s MAC=%s MTU=%d PRIVIP=%s ISDHCP DHCPSVR=%s DHCPNAME=%s CTLSOCK=%s:9051 HASHPW=%s %s%s%s%s %s%s%s%s %s",
                 usedebug ? dbgcmds : basecmds,
                 myhostname ? "USEHOSTNAME=" : "",
                 myhostname ? myhostname : "",
@@ -1618,7 +1619,7 @@
   TCHAR *cmd = malloc(CMDMAX);
   /* TODO: clean this up once the msys path munging works.  kernel and hdd need to be unixy paths */
   snprintf (cmd, CMDMAX -1,
-            "\"%s\" -L . -no-reboot -kernel ../lib/vmlinuz -append \"loglevel=9 NOINIT\" -hda ../state/hdd.img -m %d -sdl -vga std", qemubin, QEMU_DEF_MEM);
+            "\"%s\" -L . -no-reboot -kernel ../lib/vmlinuz -append \"loglevel=9 NOINIT\" -drive file=../state/hdd.img,if=virtio -m %d -sdl -vga std", qemubin, QEMU_DEF_MEM);
   ldebug ("Launching Qemu with cmd: %s", cmd);
   if( !CreateProcess(NULL,
                      cmd,
@@ -1921,9 +1922,10 @@
               "-hdc \"%s\" ",
               iso);
   }
+  ldebug ("Qemu invocation with cmdline: %s and iso path: %s", cmdline, iso ? iso : "");
   if (tapname) {
     snprintf (cmd, CMDMAX -1,
-              "\"%s\" -name \"Tor VM \" -L . -no-reboot -kernel ../lib/vmlinuz -append \"%s\" -hda ../state/hdd.img %s-m %d -sdl -vga std -net nic,model=pcnet,macaddr=%s -net pcap,devicename=\"%s\" -net nic,vlan=0,model=pcnet -net tap,vlan=0,ifname=\"%s\"",
+              "\"%s\" -name \"Tor VM \" -L . -no-reboot -kernel ../lib/vmlinuz -append \"%s\" -drive file=../state/hdd.img,if=virtio %s-m %d -sdl -vga std -net nic,model=virtio,macaddr=%s -net pcap,devicename=\"%s\" -net nic,model=virtio -net tap,ifname=\"%s\"",
 	      qemubin,
               cmdline,
               iso ? isoarg : "",
@@ -1934,7 +1936,7 @@
   }
   else {
     snprintf (cmd, CMDMAX -1,
-              "\"%s\" -name \"Tor VM \" -L . -no-reboot -kernel ../lib/vmlinuz -append \"%s\" -hda ../state/hdd.img %s-m %d -sdl -vga std -net nic,model=pcnet,macaddr=%s -net pcap,devicename=\"%s\"",
+              "\"%s\" -name \"Tor VM \" -L . -no-reboot -kernel ../lib/vmlinuz -append \"%s\" -drive file=../state/hdd.img,if=virtio %s-m %d -sdl -vga std -net nic,model=virtio,macaddr=%s -net pcap,devicename=\"%s\"",
 	      qemubin,
               cmdline,
               iso ? isoarg : "",