diff --git a/Makefile b/Makefile
-index c395e77..f789785 100644
+index 5f4f4cf..42da5b6 100644
--- a/Makefile
+++ b/Makefile
-@@ -264,8 +264,9 @@ endif
+@@ -266,8 +266,9 @@ endif
test speed: all
$(MAKE) -C tests $@
+#endif /* !BLOCK_RAW_POSIX_H */
diff --git a/hw/atapi-pt.c b/hw/atapi-pt.c
new file mode 100644
-index 0000000..b1c380f
+index 0000000..2f63492
--- /dev/null
+++ b/hw/atapi-pt.c
@@ -0,0 +1,970 @@
+ }
+}
diff --git a/hw/ide.c b/hw/ide.c
-index e8d676e..fa75de7 100644
+index e8d676e..85a2813 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -22,6 +22,7 @@
/* ATA DMA state */
int io_buffer_size;
QEMUSGList sg;
-@@ -940,6 +998,8 @@ static inline void ide_set_irq(IDEState *s)
- if (bm) {
- bm->status |= BM_STATUS_INT;
- }
-+ if (s->is_cdrom)
-+ puts("@@@@@@@@ CDROM IRQ");
- qemu_irq_raise(s->irq);
- }
- }
-@@ -1321,9 +1381,9 @@ static void ide_sector_write(IDEState *s)
+@@ -1321,9 +1379,9 @@ static void ide_sector_write(IDEState *s)
that at the expense of slower write performances. Use this
option _only_ to install Windows 2000. You must disable it
for normal use. */
#endif
{
ide_set_irq(s);
-@@ -1499,6 +1559,13 @@ static inline int ube16_to_cpu(const uint8_t *buf)
+@@ -1499,6 +1557,13 @@ static inline int ube16_to_cpu(const uint8_t *buf)
return (buf[0] << 8) | buf[1];
}
static inline int ube32_to_cpu(const uint8_t *buf)
{
return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
-@@ -1567,12 +1634,14 @@ static void ide_atapi_io_error(IDEState *s, int ret)
+@@ -1567,12 +1632,14 @@ static void ide_atapi_io_error(IDEState *s, int ret)
static void ide_atapi_cmd_reply_end(IDEState *s)
{
int byte_count_limit, size, ret;
if (s->packet_transfer_size <= 0) {
/* end of transfer */
ide_transfer_stop(s);
-@@ -1582,63 +1651,65 @@ static void ide_atapi_cmd_reply_end(IDEState *s)
+@@ -1582,63 +1649,65 @@ static void ide_atapi_cmd_reply_end(IDEState *s)
#ifdef DEBUG_IDE_ATAPI
printf("status=0x%x\n", s->status);
#endif
}
}
-@@ -1882,6 +1953,10 @@ static int ide_dvd_read_structure(IDEState *s, int format,
+@@ -1882,6 +1951,10 @@ static int ide_dvd_read_structure(IDEState *s, int format,
}
}
static void ide_atapi_cmd(IDEState *s)
{
const uint8_t *packet;
-@@ -1922,7 +1997,6 @@ static void ide_atapi_cmd(IDEState *s)
+@@ -1922,7 +1995,6 @@ static void ide_atapi_cmd(IDEState *s)
ASC_MEDIUM_NOT_PRESENT);
}
break;
case GPCMD_MODE_SENSE_10:
{
int action, code;
-@@ -1935,9 +2009,9 @@ static void ide_atapi_cmd(IDEState *s)
+@@ -1935,9 +2007,9 @@ static void ide_atapi_cmd(IDEState *s)
switch(action) {
case 0: /* current values */
switch(code) {
buf[3] = 0;
buf[4] = 0;
buf[5] = 0;
-@@ -1954,17 +2028,17 @@ static void ide_atapi_cmd(IDEState *s)
+@@ -1954,17 +2026,17 @@ static void ide_atapi_cmd(IDEState *s)
buf[15] = 0x00;
ide_atapi_cmd_reply(s, 16, max_len);
break;
buf[10] = 0x00;
buf[11] = 0x00;
-@@ -1987,6 +2061,7 @@ static void ide_atapi_cmd(IDEState *s)
+@@ -1987,6 +2059,7 @@ static void ide_atapi_cmd(IDEState *s)
buf[27] = 0;
ide_atapi_cmd_reply(s, 28, max_len);
break;
default:
goto error_cmd;
}
-@@ -2110,7 +2185,7 @@ static void ide_atapi_cmd(IDEState *s)
+@@ -2110,7 +2183,7 @@ static void ide_atapi_cmd(IDEState *s)
break;
case GPCMD_MECHANISM_STATUS:
{
cpu_to_ube16(buf, 0);
/* no current LBA */
buf[2] = 0;
-@@ -2125,7 +2200,6 @@ static void ide_atapi_cmd(IDEState *s)
+@@ -2125,7 +2198,6 @@ static void ide_atapi_cmd(IDEState *s)
{
int format, msf, start_track, len;
uint64_t total_sectors;
bdrv_get_geometry(s->bs, &total_sectors);
total_sectors >>= 2;
if (total_sectors == 0) {
-@@ -2279,7 +2353,7 @@ static void ide_atapi_cmd(IDEState *s)
+@@ -2279,7 +2351,7 @@ static void ide_atapi_cmd(IDEState *s)
max_len = 512;
memset(buf, 0, max_len);
* the number of sectors from the media tells us which profile
* to use as current. 0 means there is no media
*/
-@@ -2484,7 +2558,11 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
+@@ -2484,7 +2556,11 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
/* Only DEVICE RESET is allowed while BSY or/and DRQ are set */
if ((s->status & (BUSY_STAT|DRQ_STAT)) && val != WIN_DEVICE_RESET)
switch(val) {
case WIN_IDENTIFY:
-@@ -2727,7 +2805,7 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
+@@ -2727,7 +2803,7 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
else
s->status = READY_STAT | SEEK_STAT;
s->error = 0x01; /* Device 0 passed, Device 1 passed or not
*/
ide_set_irq(s);
break;
-@@ -2748,7 +2826,7 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
+@@ -2748,7 +2824,7 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
s->atapi_dma = s->feature & 1;
s->nsector = 1;
ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE,
break;
/* CF-ATA commands */
case CFA_REQ_EXT_ERROR_CODE:
-@@ -3133,8 +3211,20 @@ static void ide_init2(IDEState *ide_state,
+@@ -3133,8 +3209,20 @@ static void ide_init2(IDEState *ide_state,
if (bdrv_get_type_hint(s->bs) == BDRV_TYPE_CDROM) {
s->is_cdrom = 1;
s->drive_serial = drive_serial++;
strncpy(s->drive_serial_str, drive_get_serial(s->bs),
diff --git a/vl.c b/vl.c
-index 7b925eb..f7b696d 100644
+index f3b0dae..91fb696 100644
--- a/vl.c
+++ b/vl.c
-@@ -2193,8 +2193,10 @@ static int bt_parse(const char *opt)
+@@ -2192,8 +2192,10 @@ static int bt_parse(const char *opt)
#define HD_ALIAS "index=%d,media=disk"
#ifdef TARGET_PPC
#define CDROM_ALIAS "index=1,media=cdrom"
#endif
#define FD_ALIAS "index=%d,if=floppy"
#define PFLASH_ALIAS "if=pflash"
-@@ -2332,7 +2334,7 @@ int drive_init(struct drive_opt *arg, int snapshot, void *opaque)
+@@ -2331,7 +2333,7 @@ int drive_init(struct drive_opt *arg, int snapshot, void *opaque)
char serial[21];
const char *mediastr = "";
BlockInterfaceType type;
int bus_id, unit_id;
int cyls, heads, secs, translation;
BlockDriverState *bdrv;
-@@ -2486,6 +2488,8 @@ int drive_init(struct drive_opt *arg, int snapshot, void *opaque)
+@@ -2485,6 +2487,8 @@ int drive_init(struct drive_opt *arg, int snapshot, void *opaque)
return -1;
}
media = MEDIA_CDROM;
} else {
fprintf(stderr, "qemu: '%s' invalid media\n", str);
return -1;
-@@ -2640,6 +2644,9 @@ int drive_init(struct drive_opt *arg, int snapshot, void *opaque)
+@@ -2639,6 +2643,9 @@ int drive_init(struct drive_opt *arg, int snapshot, void *opaque)
case MEDIA_CDROM:
bdrv_set_type_hint(bdrv, BDRV_TYPE_CDROM);
break;
}
break;
case IF_SD:
-@@ -4243,6 +4250,7 @@ enum {
+@@ -4244,6 +4251,7 @@ enum {
QEMU_OPTION_hdc,
QEMU_OPTION_hdd,
QEMU_OPTION_cdrom,
{ "drive", HAS_ARG, QEMU_OPTION_drive },
{ "mtdblock", HAS_ARG, QEMU_OPTION_mtdblock },
{ "sd", HAS_ARG, QEMU_OPTION_sd },
-@@ -5036,13 +5045,16 @@ int main(int argc, char **argv, char **envp)
+@@ -5035,13 +5044,16 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_cdrom:
drive_add(optarg, CDROM_ALIAS);
break;
--- /dev/null
+diff -r fe4c575ded12 Makefile
+--- a/Makefile Mon Jun 15 17:17:13 2009 +0100
++++ b/Makefile Mon Jun 15 17:33:03 2009 +0100
+@@ -10,6 +10,7 @@
+
+
+ CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
++CFLAGS+=-Dfprintf=__syslog_fprintf
+ LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
+
+ CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@
+@@ -92,6 +93,7 @@
+ OBJS+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
+ OBJS+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
+ OBJS+=qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
++OBJS+=logging.o
+
+ ifdef CONFIG_BRLAPI
+ OBJS+= baum.o
+diff -r fe4c575ded12 Makefile.target
+--- a/Makefile.target Mon Jun 15 17:17:13 2009 +0100
++++ b/Makefile.target Mon Jun 15 17:33:03 2009 +0100
+@@ -79,6 +79,8 @@
+ > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
+
+ HELPER_CFLAGS=
++
++CFLAGS+=-Dfprintf=__syslog_fprintf
+
+ ifeq ($(ARCH),i386)
+ HELPER_CFLAGS+=-fomit-frame-pointer
+diff -r fe4c575ded12 logging.c
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/logging.c Mon Jun 15 17:33:03 2009 +0100
+@@ -0,0 +1,19 @@
++#include "logging.h"
++
++void cpu_set_log_syslog(const char *ident)
++{
++ closelog();
++ openlog(ident, LOG_NOWAIT | LOG_PID, LOG_DAEMON);
++}
++
++int __syslog_fprintf(FILE *stream, const char *format, ...)
++{
++ va_list ap;
++
++ va_start(ap, format);
++ vsyslog(LOG_DAEMON | LOG_NOTICE, format, ap);
++ va_end(ap);
++
++ return 0;
++}
++
+diff -r fe4c575ded12 logging.h
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/logging.h Mon Jun 15 17:33:03 2009 +0100
+@@ -0,0 +1,11 @@
++#ifndef QEMU_LOGGING_H
++#define QEMU_LOGGING_H
++
++#include <syslog.h>
++#include <stdarg.h>
++#include <stdio.h>
++
++void cpu_set_log_syslog(const char *ident);
++
++#endif
++
+diff -r fe4c575ded12 qemu-common.h
+--- a/qemu-common.h Mon Jun 15 17:17:13 2009 +0100
++++ b/qemu-common.h Mon Jun 15 17:33:03 2009 +0100
+@@ -31,6 +31,7 @@
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ #include "config-host.h"
++#include "logging.h"
+
+ #ifndef O_LARGEFILE
+ #define O_LARGEFILE 0
+diff -r fe4c575ded12 vl.c
+--- a/vl.c Mon Jun 15 17:17:13 2009 +0100
++++ b/vl.c Mon Jun 15 17:33:03 2009 +0100
+@@ -5391,6 +5391,8 @@
+ snprintf(domain_name, sizeof(domain_name),
+ "Xen-%s", optarg);
+ qemu_name = optarg;
++ cpu_set_log_syslog(domain_name);
++ cpu_set_log(0);
+ break;
+ #if defined(TARGET_SPARC) || defined(TARGET_PPC)
+ case QEMU_OPTION_prom_env:
diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c
-index cf214a4..edede92 100644
+index 3803824..4e0410b 100644
--- a/hw/piix4acpi.c
+++ b/hw/piix4acpi.c
@@ -30,6 +30,7 @@
}
static inline int test_bit(uint8_t *map, int bit)
+@@ -283,8 +285,8 @@ static void acpi_dbg_writel(void *opaque, uint32_t addr, uint32_t val)
+ {
+ #if defined(DEBUG)
+ printf("ACPI: DBG: 0x%08x\n", val);
+-#endif
+ fprintf(logfile, "ACPI:debug: write addr=0x%x, val=0x%x.\n", addr, val);
++#endif
+ }
+
+ /*
+@@ -315,8 +317,10 @@ static uint32_t acpi_php_readb(void *opaque, uint32_t addr)
+ val = hotplug_slots->status[num];
+ }
+
++#if defined(DEBUG)
+ fprintf(logfile, "ACPI PCI hotplug: read addr=0x%x, val=0x%x.\n",
+ addr, val);
++#endif
+
+ return val;
+ }
+@@ -326,8 +330,10 @@ static void acpi_php_writeb(void *opaque, uint32_t addr, uint32_t val)
+ PHPSlots *hotplug_slots = opaque;
+ int slot;
+
++#if defined(DEBUG)
+ fprintf(logfile, "ACPI PCI hotplug: write addr=0x%x, val=0x%x.\n",
+ addr, val);
++#endif
+
+ switch (addr)
+ {
diff --git a/hw/thermal_mgmt.c b/hw/thermal_mgmt.c
new file mode 100644
index 0000000..649b622
+#endif
+
diff --git a/qemu-xen.h b/qemu-xen.h
-index 60ee108..0cc5dd8 100644
+index 6dac050..7883718 100644
--- a/qemu-xen.h
+++ b/qemu-xen.h
-@@ -125,9 +125,12 @@ char *xenstore_device_model_read(int domid, const char *key, unsigned int *len);
+@@ -127,9 +127,12 @@ char *xenstore_device_model_read(int domid, const char *key, unsigned int *len);
int xenstore_extended_power_mgmt_read_int(const char *key, int default_value);
char *xenstore_read_battery_data(int battery_status);
int xenstore_refresh_battery_status(void);
int xenstore_pv_driver_build_blacklisted(uint16_t product_number,
uint32_t build_nr);
diff --git a/xen-hooks.mak b/xen-hooks.mak
-index 03d670e..7c94718 100644
+index 6fd75cf..799f80d 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -36,6 +36,7 @@ OBJS += pci_emulation.o
OBJS += xen_acpi_wmi.o
+OBJS += thermal_mgmt.o
- ifdef CONFIG_STUBDOM
- CPPFLAGS += $(TARGET_CPPFLAGS) -DNEED_CPU_H \
+ CONFIG_AUDIO=1
+
diff --git a/xenstore.c b/xenstore.c
-index 7cd4d54..01afcf0 100644
+index 9fc79f4..3cd2ba6 100644
--- a/xenstore.c
+++ b/xenstore.c
-@@ -1464,6 +1464,11 @@ int xenstore_refresh_battery_status(void)
+@@ -1465,6 +1465,11 @@ int xenstore_refresh_battery_status(void)
return xenstore_extended_power_mgmt_event_trigger("refreshbatterystatus", "1");
}
+
void xenstore_register_for_pm_events(void)
{
- xs_watch(xsh, "/pm/events/acadapterstatechanged", "acadapterstatechangeevt");
-@@ -1487,6 +1492,16 @@ int xenstore_read_lid_state(void)
+ char *inject_sci_buffer;
+@@ -1501,6 +1506,16 @@ int xenstore_read_lid_state(void)
return xenstore_extended_power_mgmt_read_int("lid_state", 1);
}