From: Ian Jackson Date: Mon, 16 Mar 2009 13:47:18 +0000 (+0000) Subject: Post-merge compilation fixes X-Git-Tag: xen-3.4.0-rc2~65 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=13669683830d4508b6c8ed87de088785fa95ed3c;p=qemu-xen-3.4-testing.git Post-merge compilation fixes Signed-off-by: Ian Jackson --- diff --git a/block-raw-posix.c b/block-raw-posix.c index 8ffde81d..f62b7878 100644 --- a/block-raw-posix.c +++ b/block-raw-posix.c @@ -617,7 +617,6 @@ static void raw_aio_remove(RawAIOCB *acb) break; } else if (*pacb == acb) { *pacb = acb->next; - raw_fd_pool_put(acb); qemu_aio_release(acb); break; } diff --git a/configure b/configure index a5e8d29c..bd767fbd 100755 --- a/configure +++ b/configure @@ -157,7 +157,7 @@ sparse="no" bigendian="no" mingw32="no" EXESUF="" -gdbstub="yes" +gdbstub="no" slirp="yes" vde="yes" fmod_lib="" diff --git a/cpu-all.h b/cpu-all.h index 56a768ad..793a8390 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -891,6 +891,11 @@ extern ram_addr_t ram_size; typedef void CPUWriteMemoryFunc(void *opaque, target_phys_addr_t addr, uint32_t value); typedef uint32_t CPUReadMemoryFunc(void *opaque, target_phys_addr_t addr); +#ifdef CONFIG_DM +void cpu_register_physical_memory(target_phys_addr_t start_addr, + ram_addr_t size, + ram_addr_t phys_offset); +#else void cpu_register_physical_memory_offset(target_phys_addr_t start_addr, ram_addr_t size, ram_addr_t phys_offset, @@ -901,6 +906,7 @@ static inline void cpu_register_physical_memory(target_phys_addr_t start_addr, { cpu_register_physical_memory_offset(start_addr, size, phys_offset, 0); } +#endif ram_addr_t cpu_get_physical_page_desc(target_phys_addr_t addr); ram_addr_t qemu_ram_alloc(ram_addr_t); diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 91d248eb..83dc616c 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -31,7 +31,8 @@ #include "pci.h" #include "console.h" #include "vga_int.h" -#include "kvm.h" +#include "qemu-xen.h" +#include "qemu-log.h" /* * TODO: @@ -306,6 +307,7 @@ static uint8_t rop_to_index[256]; static void cirrus_bitblt_reset(CirrusVGAState *s); static void cirrus_update_memory_access(CirrusVGAState *s); +static void cirrus_vga_mem_writew(void *opaque, target_phys_addr_t addr, uint32_t val); /*************************************** * @@ -1225,12 +1227,6 @@ static void cirrus_update_bank_ptr(CirrusVGAState * s, unsigned bank_index) } if (limit > 0) { - /* Thinking about changing bank base? First, drop the dirty bitmap information - * on the current location, otherwise we lose this pointer forever */ - if (s->lfb_vram_mapped) { - target_phys_addr_t base_addr = isa_mem_base + 0xa0000 + bank_index * 0x8000; - cpu_physical_sync_dirty_bitmap(base_addr, base_addr + 0x8000); - } s->cirrus_bank_base[bank_index] = offset; s->cirrus_bank_limit[bank_index] = limit; } else { @@ -1359,7 +1355,6 @@ cirrus_hook_write_sr(CirrusVGAState * s, unsigned reg_index, int reg_value) s->hw_cursor_y = (reg_value << 3) | (reg_index >> 5); break; case 0x07: // Extended Sequencer Mode - cirrus_update_memory_access(s); case 0x08: // EEPROM Control case 0x09: // Scratch Register 0 case 0x0a: // Scratch Register 1 @@ -1404,7 +1399,6 @@ cirrus_hook_write_sr(CirrusVGAState * s, unsigned reg_index, int reg_value) cirrus_vga_mem_writew(s, addr, (reg_value << 8) | s->gr[0xFE]); } break; - default: default: #ifdef DEBUG_CIRRUS @@ -1547,7 +1541,6 @@ cirrus_hook_write_gr(CirrusVGAState * s, unsigned reg_index, int reg_value) s->gr[reg_index] = reg_value; cirrus_update_bank_ptr(s, 0); cirrus_update_bank_ptr(s, 1); - cirrus_update_memory_access(s); break; case 0x0B: s->gr[reg_index] = reg_value; @@ -2638,60 +2631,6 @@ static CPUWriteMemoryFunc *cirrus_linear_bitblt_write[3] = { cirrus_linear_bitblt_writel, }; -static void map_linear_vram(CirrusVGAState *s) -{ - if (s->lfb_addr && s->lfb_end && s->vram_gmfn != s->lfb_addr) { - set_vram_mapping(s, s->lfb_addr, s->lfb_end); - } - vga_dirty_log_stop((VGAState *)s); - - if (!s->map_addr && s->lfb_addr && s->lfb_end) { - s->map_addr = s->lfb_addr; - s->map_end = s->lfb_end; - cpu_register_physical_memory(s->map_addr, s->map_end - s->map_addr, s->vram_offset); - } - - if (!s->map_addr) - return; - - s->lfb_vram_mapped = 0; - - if (!(s->cirrus_srcptr != s->cirrus_srcptr_end) - && !((s->sr[0x07] & 0x01) == 0) - && !((s->gr[0x0B] & 0x14) == 0x14) - && !(s->gr[0x0B] & 0x02)) { - - cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x8000, - (s->vram_offset + s->cirrus_bank_base[0]) | IO_MEM_RAM); - cpu_register_physical_memory(isa_mem_base + 0xa8000, 0x8000, - (s->vram_offset + s->cirrus_bank_base[1]) | IO_MEM_RAM); - - s->lfb_vram_mapped = 1; - } - else { - cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000, - s->vga_io_memory); - } - - vga_dirty_log_start((VGAState *)s); -} - -static void unmap_linear_vram(CirrusVGAState *s) -{ - if (s->lfb_addr && s->lfb_end && s->vram_gmfn != s->lfb_addr) { - unset_vram_mapping(s); - } - vga_dirty_log_stop((VGAState *)s); - - if (s->map_addr && s->lfb_addr && s->lfb_end) - s->map_addr = s->map_end = 0; - - cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000, - s->vga_io_memory); - - vga_dirty_log_start((VGAState *)s); -} - /* Compute the memory access functions */ static void cirrus_update_memory_access(CirrusVGAState *s) { @@ -2710,13 +2649,17 @@ static void cirrus_update_memory_access(CirrusVGAState *s) mode = s->gr[0x05] & 0x7; if (mode < 4 || mode > 5 || ((s->gr[0x0B] & 0x4) == 0)) { - map_linear_vram(s); + if (s->lfb_addr && s->lfb_end && s->vram_gmfn != s->lfb_addr) { + set_vram_mapping(s, s->lfb_addr, s->lfb_end); + } s->cirrus_linear_write[0] = cirrus_linear_mem_writeb; s->cirrus_linear_write[1] = cirrus_linear_mem_writew; s->cirrus_linear_write[2] = cirrus_linear_mem_writel; } else { generic_io: - unmap_linear_vram(s); + if (s->lfb_addr && s->lfb_end && s->vram_gmfn != s->lfb_addr) { + unset_vram_mapping(s); + } s->cirrus_linear_write[0] = cirrus_linear_writeb; s->cirrus_linear_write[1] = cirrus_linear_writew; s->cirrus_linear_write[2] = cirrus_linear_writel; @@ -3129,7 +3072,7 @@ static void cirrus_vga_save(QEMUFile *f, void *opaque) /* XXX: we do not save the bitblt state - we assume we do not save the state when the blitter is active */ - vga_acc = (s->lfb_addr == s->vram_gmfn); + uint8_t vga_acc = (s->lfb_addr == s->vram_gmfn); qemu_put_8s(f, &vga_acc); /* XXX old versions saved rubbish here, keeping for compatibility */ qemu_put_be32(f, 0xffffffff); @@ -3202,7 +3145,7 @@ static int cirrus_vga_load(QEMUFile *f, void *opaque, int version_id) if (version_id >= 3) qemu_get_be64s(f, &s->vram_gmfn); - t = s->vram_gmfn; + uint64_t t = s->vram_gmfn; if (!s->vram_gmfn) { /* Old guest, VRAM is not mapped, we have to restore it * ourselves */ @@ -3214,7 +3157,6 @@ static int cirrus_vga_load(QEMUFile *f, void *opaque, int version_id) if (version_id < 3 || (!vga_acc && !t)) qemu_get_buffer(f, s->vram_ptr, s->vram_size); - cirrus_update_memory_access(s); /* force refresh */ s->graphic_mode = -1; cirrus_update_bank_ptr(s, 0); @@ -3232,8 +3174,9 @@ static void cirrus_reset(void *opaque) { CirrusVGAState *s = opaque; - vga_reset(s); - unmap_linear_vram(s); + memset(s, 0, sizeof(*s)); + s->graphic_mode = -1; /* force full update */ + s->sr[0x06] = 0x0f; if (s->device_id == CIRRUS_ID_CLGD5446) { /* 4MB 64 bit memory config, always PCI */ @@ -3304,10 +3247,10 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci) register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s); register_ioport_read(0x3da, 1, 1, vga_ioport_read, s); - s->vga_io_memory = cpu_register_io_memory(0, cirrus_vga_mem_read, + int vga_io_memory = cpu_register_io_memory(0, cirrus_vga_mem_read, cirrus_vga_mem_write, s); cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000, - s->vga_io_memory); + vga_io_memory); qemu_register_coalesced_mmio(isa_mem_base + 0x000a0000, 0x20000); /* I/O handler for LFB */ @@ -3390,14 +3333,6 @@ static void cirrus_pci_lfb_map(PCIDevice *d, int region_num, cpu_register_physical_memory(addr + 0x1000000, 0x400000, s->cirrus_linear_bitblt_io_addr); - - s->map_addr = s->map_end = 0; - s->lfb_addr = addr & TARGET_PAGE_MASK; - s->lfb_end = ((addr + VGA_RAM_SIZE) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK; - /* account for overflow */ - if (s->lfb_end < addr + VGA_RAM_SIZE) - s->lfb_end = addr + VGA_RAM_SIZE; - vga_dirty_log_start((VGAState *)s); } @@ -3410,22 +3345,6 @@ static void cirrus_pci_mmio_map(PCIDevice *d, int region_num, s->cirrus_mmio_io_addr); } -static void pci_cirrus_write_config(PCIDevice *d, - uint32_t address, uint32_t val, int len) -{ - PCICirrusVGAState *pvs = container_of(d, PCICirrusVGAState, dev); - CirrusVGAState *s = &pvs->cirrus_vga; - - vga_dirty_log_stop((VGAState *)s); - - pci_default_write_config(d, address, val, len); - if (s->map_addr && pvs->dev.io_regions[0].addr == -1) - s->map_addr = 0; - cirrus_update_memory_access(s); - - vga_dirty_log_start((VGAState *)s); -} - void pci_cirrus_vga_init(PCIBus *bus, uint8_t *vga_ram_base, ram_addr_t vga_ram_offset, int vga_ram_size) { @@ -3439,7 +3358,7 @@ void pci_cirrus_vga_init(PCIBus *bus, uint8_t *vga_ram_base, /* setup PCI configuration registers */ d = (PCICirrusVGAState *)pci_register_device(bus, "Cirrus VGA", sizeof(PCICirrusVGAState), - -1, NULL, pci_cirrus_write_config); + -1, NULL, NULL); pci_conf = d->dev.config; pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_CIRRUS); pci_config_set_device_id(pci_conf, device_id); diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index 74d9e1f2..81cc754c 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -68,7 +68,7 @@ struct RTCState { int64_t next_periodic_time; /* second update */ int64_t next_second_time; -#ifdef TARGET_I386 +#ifdef IRQ_COALESCE_HACK uint32_t irq_coalesced; uint32_t period; #endif @@ -109,7 +109,7 @@ static void rtc_timer_update(RTCState *s, int64_t current_time) period_code += 7; /* period in 32 Khz cycles */ period = 1 << (period_code - 1); -#ifdef TARGET_I386 +#ifdef IRQ_COALESCE_HACK if(period != s->period) s->irq_coalesced = (s->irq_coalesced * s->period) / period; s->period = period; @@ -120,7 +120,7 @@ static void rtc_timer_update(RTCState *s, int64_t current_time) s->next_periodic_time = muldiv64(next_irq_clock, ticks_per_sec, 32768) + 1; qemu_mod_timer(s->periodic_timer, s->next_periodic_time); } else { -#ifdef TARGET_I386 +#ifdef IRQ_COALESCE_HACK s->irq_coalesced = 0; #endif qemu_del_timer(s->periodic_timer); @@ -132,7 +132,7 @@ static void rtc_periodic_timer(void *opaque) RTCState *s = opaque; rtc_timer_update(s, s->next_periodic_time); -#ifdef TARGET_I386 +#ifdef IRQ_COALESCE_HACK if ((s->cmos_data[RTC_REG_C] & 0xc0) && rtc_td_hack) { s->irq_coalesced++; return; @@ -402,7 +402,7 @@ static uint32_t cmos_ioport_read(void *opaque, uint32_t addr) case RTC_REG_C: ret = s->cmos_data[s->cmos_index]; qemu_irq_lower(s->irq); -#ifdef TARGET_I386 +#ifdef IRQ_COALESCE_HACK if(s->irq_coalesced) { apic_reset_irq_delivered(); qemu_irq_raise(s->irq); @@ -505,7 +505,7 @@ static int rtc_load(QEMUFile *f, void *opaque, int version_id) return 0; } -#ifdef TARGET_I386 +#ifdef IRQ_COALESCE_HACK static void rtc_save_td(QEMUFile *f, void *opaque) { RTCState *s = opaque; @@ -558,7 +558,7 @@ RTCState *rtc_init(int base, qemu_irq irq, int base_year) register_ioport_read(base, 2, 1, cmos_ioport_read, s); register_savevm("mc146818rtc", base, 1, rtc_save, rtc_load, s); -#ifdef TARGET_I386 +#ifdef IRQ_COALESCE_HACK if (rtc_td_hack) register_savevm("mc146818rtc-td", base, 1, rtc_save_td, rtc_load_td, s); #endif @@ -670,7 +670,7 @@ RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq, cpu_register_physical_memory(base, 2 << it_shift, io_memory); register_savevm("mc146818rtc", base, 1, rtc_save, rtc_load, s); -#ifdef TARGET_I386 +#ifdef IRQ_COALESCE_HACK if (rtc_td_hack) register_savevm("mc146818rtc-td", base, 1, rtc_save_td, rtc_load_td, s); #endif diff --git a/hw/pc.c b/hw/pc.c index 81e0935c..77f6812b 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -980,12 +980,14 @@ vga_bios_error: isa_cirrus_vga_init(phys_ram_base + vga_ram_addr, vga_ram_addr, vga_ram_size); } +#ifndef CONFIG_DM } else if (vmsvga_enabled) { if (pci_enabled) pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr, vga_ram_addr, vga_ram_size); else fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__); +#endif } else if (std_vga_enabled) { if (pci_enabled) { pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr, @@ -1148,6 +1150,7 @@ vga_bios_error: } } +#ifndef CONFIG_DM /* Add virtio block devices */ if (pci_enabled) { int index; @@ -1170,6 +1173,7 @@ vga_bios_error: virtio_console_init(pci_bus, virtcon_hds[i]); } } +#endif } static void pc_init_pci(ram_addr_t ram_size, int vga_ram_size, @@ -1208,14 +1212,6 @@ void cmos_set_s3_resume(void) rtc_set_memory(rtc_state, 0xF, 0xFE); } -/* set CMOS shutdown status register (index 0xF) as S3_resume(0xFE) - BIOS will read it and start S3 resume at POST Entry */ -void cmos_set_s3_resume(void) -{ - if (rtc_state) - rtc_set_memory(rtc_state, 0xF, 0xFE); -} - QEMUMachine pc_machine = { .name = "pc", .desc = "Standard PC", diff --git a/hw/pc.h b/hw/pc.h index 7817a872..0f7044aa 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -95,7 +95,6 @@ extern int fd_bootchk; void ioport_set_a20(int enable); int ioport_get_a20(void); -void cmos_set_s3_resume(void); /* acpi.c */ extern int acpi_enabled; @@ -137,7 +136,7 @@ extern enum vga_retrace_method vga_retrace_method; #define VGA_RAM_SIZE (9 * 1024 * 1024) #endif -int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base, +int isa_vga_init(uint8_t *vga_ram_base, unsigned long vga_ram_offset, int vga_ram_size); int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base, unsigned long vga_ram_offset, int vga_ram_size, diff --git a/hw/pci.c b/hw/pci.c index e1a84d9f..28800e8d 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -646,7 +646,6 @@ static const char * const pci_nic_models[] = { "i82557b", "i82559er", "rtl8139", - "e100", "e1000", "pcnet", "virtio", @@ -661,7 +660,6 @@ static PCINICInitFn pci_nic_init_fns[] = { pci_i82557b_init, pci_i82559er_init, pci_rtl8139_init, - pci_e100_init, pci_e1000_init, pci_pcnet_init, virtio_net_init, diff --git a/hw/vga.c b/hw/vga.c index 13519255..99452389 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -2304,7 +2304,7 @@ static void vga_map(PCIDevice *pci_dev, int region_num, } /* do the same job as vgabios before vgabios get ready - yeah */ -void vga_bios_init(VGAState *s) +static void vga_bios_init(VGAState *s) { uint8_t palette_model[192] = { 0, 0, 0, 0, 0, 170, 0, 170, diff --git a/hw/xen_platform.c b/hw/xen_platform.c index 9271d276..65a2da49 100644 --- a/hw/xen_platform.c +++ b/hw/xen_platform.c @@ -28,6 +28,7 @@ #include "pci.h" #include "irq.h" #include "qemu-xen.h" +#include "net.h" #include #include @@ -361,7 +362,7 @@ struct pci_config_header { uint8_t max_lat; }; -void xen_pci_save(QEMUFile *f, void *opaque) +static void xen_pci_save(QEMUFile *f, void *opaque) { PCIXenPlatformState *d = opaque; uint64_t t = 0; @@ -371,7 +372,7 @@ void xen_pci_save(QEMUFile *f, void *opaque) qemu_put_be64s(f, &t); } -int xen_pci_load(QEMUFile *f, void *opaque, int version_id) +static int xen_pci_load(QEMUFile *f, void *opaque, int version_id) { PCIXenPlatformState *d = opaque; int ret; diff --git a/i386-dm/config.h b/i386-dm/config.h index c5fc6535..48a1739e 100644 --- a/i386-dm/config.h +++ b/i386-dm/config.h @@ -4,4 +4,3 @@ #define TARGET_I386 1 #define CONFIG_SOFTMMU 1 #define CONFIG_SOFTFLOAT 1 -#define CONFIG_DM 1 diff --git a/i386-dm/cpu.h b/i386-dm/cpu.h index cba81153..4738e4fa 100644 --- a/i386-dm/cpu.h +++ b/i386-dm/cpu.h @@ -87,6 +87,7 @@ int cpu_get_pic_interrupt(CPUX86State *s); void cpu_set_ferr(CPUX86State *s); void cpu_x86_set_a20(CPUX86State *env, int a20_state); +uint64_t cpu_get_tsc(CPUX86State *env); /* used to debug */ #define X86_DUMP_FPU 0x0001 /* dump FPU state too */ diff --git a/i386-dm/exec-dm.c b/i386-dm/exec-dm.c index 20ac93c0..cec54a08 100644 --- a/i386-dm/exec-dm.c +++ b/i386-dm/exec-dm.c @@ -33,8 +33,11 @@ #include #include "cpu.h" +#include "cpu-all.h" #include "exec-all.h" #include "hw.h" +#include "pc.h" +#include "disas.h" #include "qemu-xen.h" //#define DEBUG_TB_INVALIDATE @@ -283,8 +286,8 @@ unsigned long mmio_cnt; page size. If (phys_offset & ~TARGET_PAGE_MASK) != 0, then it is an io memory page */ void cpu_register_physical_memory(target_phys_addr_t start_addr, - unsigned long size, - unsigned long phys_offset) + ram_addr_t size, + ram_addr_t phys_offset) { int i; @@ -401,7 +404,7 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, } #else -int iomem_index(target_phys_addr_t addr) +static int iomem_index(target_phys_addr_t addr) { int i; @@ -422,8 +425,9 @@ void unregister_iomem(target_phys_addr_t start) { int index = iomem_index(start); if (index) { - fprintf(logfile, "squash iomem [%lx, %lx).\n", mmio[index].start, - mmio[index].start + mmio[index].size); + fprintf(logfile, "squash iomem [%lx, %lx).\n", + (unsigned long)(mmio[index].start), + (unsigned long)(mmio[index].start + mmio[index].size)); mmio[index].start = mmio[index].size = 0; } } @@ -704,6 +708,60 @@ void cpu_physical_memory_write_rom(target_phys_addr_t addr, return cpu_physical_memory_write(addr,buf,len); } +void qemu_register_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size) { } +void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size) { } + + +void *cpu_physical_memory_map(target_phys_addr_t addr, + target_phys_addr_t *plen, + int is_write) { + xen_pfn_t first, last, count, i; + target_phys_addr_t offset; + void *vaddr; + + if (!*plen) + return NULL; + + first = addr >> XC_PAGE_SHIFT; + last = (addr + *plen - 1) >> XC_PAGE_SHIFT; + count = last - first + 1; + offset = addr & (XC_PAGE_SIZE-1); + + xen_pfn_t pfns[count]; + + for (i = 0; i < count; i++) + pfns[i] = first + i; + + vaddr = xc_map_foreign_batch(xc_handle, domid, + is_write ? PROT_WRITE : PROT_READ, + pfns, count); + if (!vaddr) + perror("cpu_physical_memory_map: map failed"); + + return vaddr; +} + +void cpu_physical_memory_unmap(void *buffer, target_phys_addr_t len, + int is_write, target_phys_addr_t access_len) { + uintptr_t start, end; + int ret; + + if (!len) return; + + start = (uintptr_t)buffer & (XC_PAGE_SIZE - 1); + end = ((uintptr_t)(buffer + len - 1) | (XC_PAGE_SIZE - 1)) + 1; + + ret = munmap((void*)start, end - start); + if (ret) + perror("cpu_physical_memory_unmap: munmap failed"); +} + +void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque)) { + return 0; +} +void cpu_unregister_map_client(void *cookie) { +} + /* stub out various functions for Xen DM */ void dump_exec_info(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)) { diff --git a/net.c b/net.c index febbe95f..d7bf022e 100644 --- a/net.c +++ b/net.c @@ -122,18 +122,7 @@ static VLANState *first_vlan; -static TAPState *head_net_tap; - -void net_tap_shutdown_all(void) -{ - struct IOHandlerRecord **pioh, *ioh; - - while (head_net_tap) { - qemu_set_fd_handler2(head_net_tap->fd, 0,0,0,0); - close(head_net_tap->fd); - head_net_tap = head_net_tap->next; - } -} +static struct TAPState *head_net_tap; /***********************************************************/ /* network device redirectors */ @@ -1692,7 +1681,7 @@ int net_client_init(const char *device, const char *p) } if (get_param_value(script_arg, sizeof(script_arg), "scriptarg", p) == 0 && get_param_value(script_arg, sizeof(script_arg), "bridge", p) == 0) { /* deprecated; for xend compatibility */ -+ pstrcpy(script_arg, sizeof(script_arg), ""); + pstrcpy(script_arg, sizeof(script_arg), ""); } ret = net_tap_init(vlan, device, name, ifname, setup_script, down_script, script_arg); } @@ -1831,7 +1820,8 @@ void net_cleanup(void) TAPState *s = vc->opaque; if (s->down_script[0]) - launch_script(s->down_script, s->down_script_arg, s->fd); + launch_script(s->down_script, s->down_script_arg, + s->script_arg, s->fd); } #if defined(CONFIG_VDE) if (vc->fd_read == vde_from_qemu) { @@ -1859,3 +1849,14 @@ void net_client_check(void) vlan->id); } } + +void net_tap_shutdown_all(void) +{ + struct IOHandlerRecord **pioh, *ioh; + + while (head_net_tap) { + qemu_set_fd_handler2(head_net_tap->fd, 0,0,0,0); + close(head_net_tap->fd); + head_net_tap = head_net_tap->next; + } +} diff --git a/net.h b/net.h index 1662724c..271b94f2 100644 --- a/net.h +++ b/net.h @@ -98,6 +98,7 @@ void net_slirp_redir(const char *redir_str); void net_cleanup(void); int slirp_is_inited(void); void net_client_check(void); +void net_tap_shutdown_all(void); #ifndef DEFAULT_NETWORK_SCRIPT #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" diff --git a/qemu-xen.h b/qemu-xen.h index e3f29f71..7ca94287 100644 --- a/qemu-xen.h +++ b/qemu-xen.h @@ -31,8 +31,6 @@ void set_vram_mapping(void *opaque, unsigned long begin, unsigned long end); void unset_vram_mapping(void *opaque); #endif -void ide_unplug_harddisks(void); -void net_tap_shutdown_all(void); void pci_unplug_netifs(void); void destroy_hvm_domain(void); void unregister_iomem(target_phys_addr_t start); @@ -107,4 +105,7 @@ int xenfb_connect_vfb(const char *path); int has_tpm_device_danger(void); +static void vga_dirty_log_start(void *s) { } +static void vga_dirty_log_stop(void *s) { } + #endif /*QEMU_XEN_H*/ diff --git a/sysemu.h b/sysemu.h index c4d0f64c..2fc49142 100644 --- a/sysemu.h +++ b/sysemu.h @@ -185,6 +185,8 @@ int load_uimage(const char *filename, target_ulong *ep, target_ulong *loadaddr, int fread_targphys(target_phys_addr_t dst_addr, size_t nbytes, FILE *f); int fread_targphys_ok(target_phys_addr_t dst_addr, size_t nbytes, FILE *f); int read_targphys(int fd, target_phys_addr_t dst_addr, size_t nbytes); +void pstrcpy_targphys(target_phys_addr_t dest, int buf_size, + const char *source); #endif #ifdef HAS_AUDIO diff --git a/vl.c b/vl.c index 871ab059..172a3f75 100644 --- a/vl.c +++ b/vl.c @@ -43,6 +43,12 @@ #include "kvm.h" #include "balloon.h" +#include "hw/pci.h" +#include "hw/xen.h" +#include + +#include "qemu-xen.h" + #include #include #include @@ -181,8 +187,8 @@ static IOPortWriteFunc *ioport_write_table[3][MAX_IOPORTS]; to store the VM snapshots */ DriveInfo drives_table[MAX_DRIVES+1]; int nb_drives; -static int vga_ram_size; enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB; +int vga_ram_size; static DisplayState *display_state; int nographic; static int curses; @@ -263,6 +269,8 @@ static QEMUTimer *nographic_timer; uint8_t qemu_uuid[16]; +#include "xen-vl-extra.c" + /***********************************************************/ /* x86 ISA bus support */ @@ -490,7 +498,7 @@ void hw_error(const char *fmt, ...) fprintf(stderr, "\n"); for(env = first_cpu; env != NULL; env = env->next_cpu) { fprintf(stderr, "CPU #%d:\n", env->cpu_index); -#ifdef TARGET_I386 +#if defined(TARGET_I386) && !defined(CONFIG_DM) cpu_dump_state(env, stderr, fprintf, X86_DUMP_FPU); #else cpu_dump_state(env, stderr, fprintf, 0); @@ -924,7 +932,7 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t); static int unix_start_timer(struct qemu_alarm_timer *t); static void unix_stop_timer(struct qemu_alarm_timer *t); -#ifdef __linux__ +#if defined(__linux__) && !defined(CONFIG_DM) static int dynticks_start_timer(struct qemu_alarm_timer *t); static void dynticks_stop_timer(struct qemu_alarm_timer *t); @@ -1007,7 +1015,7 @@ static void init_icount_adjust(void) static struct qemu_alarm_timer alarm_timers[] = { #ifndef _WIN32 -#ifdef __linux__ +#if defined(__linux__) && !defined(CONFIG_DM) {"dynticks", ALARM_FLAG_DYNTICKS, dynticks_start_timer, dynticks_stop_timer, dynticks_rearm_timer, NULL}, /* HPET - if available - is preferred */ @@ -1140,6 +1148,12 @@ void qemu_del_timer(QEMUTimer *ts) } } +void qemu_advance_timer(QEMUTimer *ts, int64_t expire_time) +{ + if (ts->expire_time > expire_time) + qemu_mod_timer(ts, expire_time); +} + /* modify the current timer so that it will be fired when current_time >= expire_time. The corresponding callback will be called. */ void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time) @@ -1258,13 +1272,31 @@ void qemu_get_timer(QEMUFile *f, QEMUTimer *ts) } } +/* run the specified timer */ +void qemu_run_one_timer(QEMUTimer *ts) +{ + uint64_t current_time; + + /* remove timer from the list before calling the callback */ + qemu_del_timer(ts); + + while ((current_time = qemu_get_clock(rt_clock)) < ts->expire_time) + /* sleep until the expire time */ + usleep((ts->expire_time - current_time) * 1000); + + /* run the callback */ + ts->cb(ts->opaque); +} + static void timer_save(QEMUFile *f, void *opaque) { if (cpu_ticks_enabled) { hw_error("cannot save state if virtual timers are running"); } +#ifndef CONFIG_DM qemu_put_be64(f, cpu_ticks_offset); qemu_put_be64(f, ticks_per_sec); +#endif qemu_put_be64(f, cpu_clock_offset); } @@ -1275,14 +1307,19 @@ static int timer_load(QEMUFile *f, void *opaque, int version_id) if (cpu_ticks_enabled) { return -EINVAL; } +#ifndef CONFIG_DM cpu_ticks_offset=qemu_get_be64(f); ticks_per_sec=qemu_get_be64(f); if (version_id == 2) { +#else + if (version_id == 1 || version_id == 2) { +#endif cpu_clock_offset=qemu_get_be64(f); } return 0; } +#ifndef CONFIG_DM /* ends just before fcntl_setfl */ #ifdef _WIN32 void CALLBACK host_alarm_handler(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) @@ -1391,6 +1428,7 @@ static uint64_t qemu_next_deadline_dyntick(void) return delta; } #endif +#endif #ifndef _WIN32 @@ -1409,6 +1447,7 @@ static int fcntl_setfl(int fd, int flag) return 0; } +#ifndef CONFIG_DM /* ends after end of win32_rearm_timer */ #if defined(__linux__) #define RTC_FREQ 1024 @@ -1727,6 +1766,7 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t) } #endif /* _WIN32 */ +#endif /* !CONFIG_DM */ static int init_timer_alarm(void) { @@ -2538,6 +2578,8 @@ static int drive_init(struct drive_opt *arg, int snapshot, case IF_MTD: case IF_VIRTIO: break; + case IF_BLKTAP: + abort(); } if (!file[0]) return 0; @@ -2984,6 +3026,11 @@ void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque) /***********************************************************/ /* ram save/restore */ +#ifdef CONFIG_DM +static int ram_save_live(QEMUFile *f, int stage, void *opaque) { return 1; } +static int ram_load(QEMUFile *f, void *opaque, int version_id) { return 0; } +#else /* !CONFIG_DM */ + static int ram_get_page(QEMUFile *f, uint8_t *buf, int len) { int v; @@ -3255,6 +3302,8 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) return 0; } +#endif /* !CONFIG_DM */ + void qemu_service_io(void) { CPUState *env = cpu_single_env; @@ -3713,7 +3762,9 @@ void main_loop_wait(int timeout) } -static int main_loop(void) +#ifndef CONFIG_DM + +int main_loop(void) { int ret, timeout; #ifdef CONFIG_PROFILER @@ -3862,6 +3913,12 @@ static int main_loop(void) return ret; } +#else /* CONFIG_DM */ +void main_loop_prepare(void) { + cur_cpu = first_cpu; +} +#endif /* !CONFIG_DM */ + static void help(int exitcode) { /* Please keep in synch with QEMU_OPTION_ enums, qemu_options[] @@ -3916,6 +3973,9 @@ static void help(int exitcode) "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n" "-no-quit disable SDL window close capability\n" "-sdl enable SDL\n" +#ifdef CONFIG_OPENGL + "-disable-opengl disable OpenGL rendering, using SDL" +#endif #endif "-portrait rotate graphical output 90 deg left (only PXA LCD)\n" "-vga [std|cirrus|vmware|none]\n" @@ -3938,11 +3998,12 @@ static void help(int exitcode) "-net tap[,vlan=n][,name=str],ifname=name\n" " connect the host TAP network interface to VLAN 'n'\n" #else - "-net tap[,vlan=n][,name=str][,fd=h][,ifname=name][,script=file][,downscript=dfile]\n" + "-net tap[,vlan=n][,name=str][,fd=h][,ifname=name][,script=file][,downscript=dfile][,scriptarg=extraargument]\n" " connect the host TAP network interface to VLAN 'n' and use the\n" " network scripts 'file' (default=%s)\n" " and 'dfile' (default=%s);\n" " use '[down]script=no' to disable script execution;\n" + " use 'scriptarg=...' to pass an additional (nonempty) argument;\n" " use 'fd=h' to connect to an already opened TAP interface\n" #endif "-net socket[,vlan=n][,name=str][,fd=h][,listen=[host]:port][,connect=host:port]\n" @@ -4044,6 +4105,13 @@ static void help(int exitcode) "-tb-size n set TB size\n" "-incoming p prepare for incoming migration, listen on port p\n" "\n" + "Options specific to the Xen version:\n" + "-videoram set amount of memory available to virtual video adapter\n" + "-direct-pci s specify pci passthrough, with configuration string s\n" + "-pciemulation name:vendorid:deviceid:command:status:revision:classcode:headertype:subvendorid:subsystemid:interruputline:interruputpin\n" + "-vncunused bind the VNC server to an unused port\n" + "-std-vga alias for -vga std\n" + "\n" "During emulation, the following keys are useful:\n" "ctrl-alt-f toggle full screen\n" "ctrl-alt-n switch to virtual console 'n'\n" @@ -4127,6 +4195,18 @@ enum { QEMU_OPTION_append, QEMU_OPTION_initrd, + /* Xen tree: */ + QEMU_OPTION_disable_opengl, + QEMU_OPTION_direct_pci, + QEMU_OPTION_pci_emulation, + QEMU_OPTION_vncunused, + QEMU_OPTION_videoram, + QEMU_OPTION_std_vga, + QEMU_OPTION_domid, + QEMU_OPTION_domainname, + QEMU_OPTION_acpi, + QEMU_OPTION_vcpus, + /* Debug/Expert options: */ QEMU_OPTION_serial, QEMU_OPTION_parallel, @@ -4283,6 +4363,27 @@ static const QEMUOption qemu_options[] = { #if defined(TARGET_ARM) || defined(TARGET_M68K) { "semihosting", 0, QEMU_OPTION_semihosting }, #endif + + /* Xen tree options: */ + { "std-vga", 0, QEMU_OPTION_std_vga }, + { "videoram", HAS_ARG, QEMU_OPTION_videoram }, + { "d", HAS_ARG, QEMU_OPTION_domid }, /* deprecated; for xend compatibility */ + { "domid", HAS_ARG, QEMU_OPTION_domid }, + { "domain-name", 1, QEMU_OPTION_domainname }, +#ifdef CONFIG_OPENGL + { "disable-opengl", 0, QEMU_OPTION_disable_opengl }, +#endif + { "acpi", 0, QEMU_OPTION_acpi }, /* deprecated, for xend compatibility */ + { "direct_pci", HAS_ARG, QEMU_OPTION_direct_pci }, + { "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation }, + { "vncunused", 0, QEMU_OPTION_vncunused }, + { "vcpus", 0, QEMU_OPTION_vcpus }, +#ifdef CONFIG_XEN + { "xen-domid", HAS_ARG, QEMU_OPTION_xen_domid }, + { "xen-create", 0, QEMU_OPTION_xen_create }, + { "xen-attach", 0, QEMU_OPTION_xen_attach }, +#endif + #if defined(TARGET_ARM) { "old-param", 0, QEMU_OPTION_old_param }, #endif @@ -4333,7 +4434,7 @@ static void read_passwords(void) #ifdef HAS_AUDIO struct soundhw soundhw[] = { #ifdef HAS_AUDIO_CHOICE -#if defined(TARGET_I386) || defined(TARGET_MIPS) +#if (defined(TARGET_I386) || defined(TARGET_MIPS)) && !defined(CONFIG_DM) { "pcspk", "PC speaker", @@ -4600,6 +4701,34 @@ int main(int argc, char **argv, char **envp) const char *incoming = NULL; qemu_cache_utils_init(envp); + logfile = stderr; /* initial value */ + +#if !defined(__sun__) && !defined(CONFIG_STUBDOM) + struct rlimit rl; + /* Maximise rlimits. Needed where default constraints are tight (*BSD). */ + if (getrlimit(RLIMIT_STACK, &rl) != 0) { + perror("getrlimit(RLIMIT_STACK)"); + exit(1); + } + rl.rlim_cur = rl.rlim_max; + if (setrlimit(RLIMIT_STACK, &rl) != 0) + perror("setrlimit(RLIMIT_STACK)"); + if (getrlimit(RLIMIT_DATA, &rl) != 0) { + perror("getrlimit(RLIMIT_DATA)"); + exit(1); + } + rl.rlim_cur = rl.rlim_max; + if (setrlimit(RLIMIT_DATA, &rl) != 0) + perror("setrlimit(RLIMIT_DATA)"); + rl.rlim_cur = RLIM_INFINITY; + rl.rlim_max = RLIM_INFINITY; + if (setrlimit(RLIMIT_RSS, &rl) != 0) + perror("setrlimit(RLIMIT_RSS)"); + rl.rlim_cur = RLIM_INFINITY; + rl.rlim_max = RLIM_INFINITY; + if (setrlimit(RLIMIT_MEMLOCK, &rl) != 0) + perror("setrlimit(RLIMIT_MEMLOCK)"); +#endif LIST_INIT (&vm_change_state_head); #ifndef _WIN32 @@ -4636,8 +4765,7 @@ int main(int argc, char **argv, char **envp) machine = first_machine; cpu_model = NULL; initrd_filename = NULL; - ram_size = 0; - vga_ram_size = VGA_RAM_SIZE; + ram_size = VGA_RAM_SIZE; #ifdef CONFIG_GDBSTUB use_gdbstub = 0; gdbstub_port = DEFAULT_GDBSTUB_PORT; @@ -5070,6 +5198,7 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_loadvm: loadvm = optarg; + restore = 1; break; case QEMU_OPTION_full_screen: full_screen = 1; @@ -5088,6 +5217,61 @@ int main(int argc, char **argv, char **envp) sdl = 1; break; #endif + + case QEMU_OPTION_pci_emulation: + if (nb_pci_emulation >= MAX_PCI_EMULATION) { + fprintf(stderr, "Too many PCI emulations\n"); + exit(1); + } + pstrcpy(pci_emulation_config_text[nb_pci_emulation], + sizeof(pci_emulation_config_text[0]), + optarg); + nb_pci_emulation++; + break; + case QEMU_OPTION_domid: /* depricated, use -xen-* instead */ + xen_domid = domid = atoi(optarg); + xen_mode = XEN_ATTACH; + fprintf(logfile, "domid: %d\n", domid); + break; + case QEMU_OPTION_videoram: + { + char *ptr; + vga_ram_size = strtol(optarg,&ptr,10); + vga_ram_size *= 1024 * 1024; + } + break; + case QEMU_OPTION_std_vga: + cirrus_vga_enabled = 0; + vmsvga_enabled = 0; + break; + case QEMU_OPTION_disable_opengl: + opengl_enabled = 0; + break; + case QEMU_OPTION_direct_pci: + direct_pci = optarg; + break; + case QEMU_OPTION_vcpus: + vcpus = atoi(optarg); + fprintf(logfile, "qemu: the number of cpus is %d\n", vcpus); + break; + case QEMU_OPTION_acpi: + acpi_enabled = 1; + break; + case QEMU_OPTION_vncunused: + vncunused = 1; + break; +#ifdef CONFIG_XEN + case QEMU_OPTION_xen_domid: + xen_domid = domid = atoi(optarg); + break; + case QEMU_OPTION_xen_create: + xen_mode = XEN_CREATE; + break; + case QEMU_OPTION_xen_attach: + xen_mode = XEN_ATTACH; + break; +#endif + case QEMU_OPTION_pidfile: pid_file = optarg; break; @@ -5173,7 +5357,10 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_semihosting: semihosting_enabled = 1; break; + case QEMU_OPTION_domainname: /* depricated, use -name instead */ case QEMU_OPTION_name: + snprintf(domain_name, sizeof(domain_name), + "Xen-%s", optarg); qemu_name = optarg; break; #if defined(TARGET_SPARC) || defined(TARGET_PPC) @@ -5421,13 +5608,28 @@ int main(int argc, char **argv, char **envp) } #endif +#if defined (__ia64__) + if (ram_size > VGA_IO_START) + ram_size += VGA_IO_SIZE; /* skip VGA I/O hole */ + if (ram_size > MMIO_START) + ram_size += 1 * MEM_G; /* skip 3G-4G MMIO, LEGACY_IO_SPACE etc. */ +#endif + /* init the bluetooth world */ for (i = 0; i < nb_bt_opts; i++) if (bt_parse(bt_opts[i])) exit(1); /* init the memory */ - phys_ram_size = machine->ram_require & ~RAMSIZE_FIXED; + + /* If we're on cirrus, set vga_ram_size to 4M whatever the videoram option might have set it to */ + if ( cirrus_vga_enabled && vga_ram_size != 4 * 1024 * 1024 ) + { + fprintf(stderr,"-videoram option does not work with cirrus vga device model. Videoram set to 4M.\n"); + vga_ram_size = 4 * 1024 * 1024; + } + + phys_ram_size = (machine->ram_require + vga_ram_size) & ~RAMSIZE_FIXED; if (machine->ram_require & RAMSIZE_FIXED) { if (ram_size > 0) { @@ -5447,21 +5649,38 @@ int main(int argc, char **argv, char **envp) phys_ram_size += ram_size; } +#ifndef CONFIG_DM phys_ram_base = qemu_vmalloc(phys_ram_size); if (!phys_ram_base) { fprintf(stderr, "Could not allocate physical memory\n"); exit(1); } +#endif /* init the dynamic translator */ cpu_exec_init_all(tb_size * 1024 * 1024); bdrv_init(); + xc_handle = xc_interface_open(); +#ifdef CONFIG_STUBDOM + { + char *domid_s, *msg; + if ((msg = xenbus_read(XBT_NIL, "domid", &domid_s))) + fprintf(stderr,"Can not read our own domid: %s\n", msg); + else + xenstore_parse_domain_config(atoi(domid_s)); + } +#else + xenstore_parse_domain_config(domid); +#endif /* CONFIG_STUBDOM */ + /* we always create the cdrom drive, even if no disk is there */ +#ifndef CONFIG_DM if (nb_drives_opt < MAX_DRIVES) drive_add(NULL, CDROM_ALIAS); +#endif /* we always create at least one floppy */ @@ -5483,8 +5702,10 @@ int main(int argc, char **argv, char **envp) register_savevm_live("ram", 0, 3, ram_save_live, NULL, ram_load, NULL); #ifndef _WIN32 +#ifndef CONFIG_DM /* must be after terminal init, SDL library changes signal handlers */ termsig_setup(); +#endif #endif /* Maintain compatibility with multiple stdio monitors */ @@ -5563,7 +5784,8 @@ int main(int argc, char **argv, char **envp) } machine->init(ram_size, vga_ram_size, boot_devices, - kernel_filename, kernel_cmdline, initrd_filename, cpu_model); + kernel_filename, kernel_cmdline, initrd_filename, cpu_model, + direct_pci); /* Set KVM's vcpu state to qemu's initial CPUState. */ if (kvm_enabled()) { @@ -5594,6 +5816,10 @@ int main(int argc, char **argv, char **envp) /* just use the first displaystate for the moment */ ds = display_state; /* terminal init */ +#ifdef CONFIG_STUBDOM + if (xenfb_pv_display_init(ds) == 0) { + } else +#endif if (nographic) { if (curses) { fprintf(stderr, "fatal: -nographic can't be used with -curses\n"); @@ -5607,14 +5833,20 @@ int main(int argc, char **argv, char **envp) } else #endif { - if (vnc_display != NULL) { + if (vnc_display != NULL || vncunused != 0) { + int vnc_display_port; + char password[20]; vnc_display_init(ds); - if (vnc_display_open(ds, vnc_display) < 0) + xenstore_read_vncpasswd(domid, password, sizeof(password)); + vnc_display_password(ds, password); + vnc_display_port = vnc_display_open(ds, vnc_display, vncunused); + if (vnc_display_port < 0) exit(1); + xenstore_write_vncport(vnc_display_port); } #if defined(CONFIG_SDL) if (sdl || !vnc_display) - sdl_display_init(ds, full_screen, no_frame); + sdl_display_init(ds, full_screen, no_frame, opengl_enabled); #elif defined(CONFIG_COCOA) if (sdl || !vnc_display) cocoa_display_init(ds, full_screen); @@ -5662,6 +5894,16 @@ int main(int argc, char **argv, char **envp) } } + for (i = 0; i < nb_pci_emulation; i++) { + if(pci_emulation_add(pci_emulation_config_text[i]) < 0) { + fprintf(stderr, "Warning: could not add PCI device %s\n", + pci_emulation_config_text[i]); + } + } + + if (strlen(direct_pci_str) > 0) + direct_pci = direct_pci_str; + for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) { const char *devname = virtio_consoles[i]; if (virtcon_hds[i] && devname) { @@ -5728,3 +5970,6 @@ int main(int argc, char **argv, char **envp) return 0; } + +static int unix_start_timer(struct qemu_alarm_timer *t) { return 0; } +static void unix_stop_timer(struct qemu_alarm_timer *t) { } diff --git a/vnc.c b/vnc.c index 52e46274..f8606cbd 100644 --- a/vnc.c +++ b/vnc.c @@ -1121,7 +1121,7 @@ static uint32_t read_u32(uint8_t *data, size_t offset) } #ifdef CONFIG_VNC_TLS -ssize_t vnc_tls_push(gnutls_transport_ptr_t transport, +static ssize_t vnc_tls_push(gnutls_transport_ptr_t transport, const void *data, size_t len) { struct VncState *vs = (struct VncState *)transport; @@ -1138,7 +1138,7 @@ ssize_t vnc_tls_push(gnutls_transport_ptr_t transport, } -ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport, +static ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport, void *data, size_t len) { struct VncState *vs = (struct VncState *)transport; @@ -2402,8 +2402,6 @@ static void vnc_listen_read(void *opaque) } } -extern int parse_host_port(struct sockaddr_in *saddr, const char *str); - void vnc_display_init(DisplayState *ds) { VncState *vs; @@ -2534,10 +2532,6 @@ void vnc_display_close(DisplayState *ds) #endif } -int parse_host_port(struct sockaddr_in *saddr, const char *str); - - - int vnc_display_password(DisplayState *ds, const char *password) { VncState *vs = ds ? (VncState *)ds->opaque : vnc_state; @@ -2758,34 +2752,3 @@ int vnc_display_open(DisplayState *ds, const char *display, int find_unused) return ntohs(iaddr.sin_port); } - -#ifndef CONFIG_STUBDOM -int vnc_start_viewer(int port) -{ - int pid, i, open_max; - char s[16]; - - sprintf(s, ":%d", port); - - switch (pid = fork()) { - case -1: - fprintf(stderr, "vncviewer failed fork\n"); - exit(1); - - case 0: /* child */ - open_max = sysconf(_SC_OPEN_MAX); - for (i = 0; i < open_max; i++) - if (i != STDIN_FILENO && - i != STDOUT_FILENO && - i != STDERR_FILENO) - close(i); - execlp("vncviewer", "vncviewer", s, NULL); - fprintf(stderr, "vncviewer execlp failed\n"); - exit(1); - - default: - return pid; - } -} -#endif - diff --git a/xen-config-host.h b/xen-config-host.h index 3d26f46e..5fd4577e 100644 --- a/xen-config-host.h +++ b/xen-config-host.h @@ -8,6 +8,8 @@ #define NO_BLUETOOTH_PASSTHROUGH 1 #endif +#define CONFIG_DM + extern char domain_name[64]; extern int domid, domid_backend; @@ -33,8 +35,6 @@ extern int vcpus; #define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup" #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/xen/qemu-ifdown" -void xenstore_parse_domain_config(int domid); -void xenstore_read_vncpasswd(int domid, char *pwbuf, size_t pwbuflen); #ifdef CONFIG_STUBDOM extern struct BlockDriver bdrv_vbd; #endif diff --git a/xen-hooks.mak b/xen-hooks.mak index 0e49d5b5..c6b4f8c1 100644 --- a/xen-hooks.mak +++ b/xen-hooks.mak @@ -7,7 +7,7 @@ ifeq ($(SSE2),-msse2) CFLAGS += -DUSE_SSE2=1 -msse2 endif -QEMU_PROG=qemu-dm +override QEMU_PROG=qemu-dm CFLAGS += -Wno-unused -Wno-declaration-after-statement @@ -68,7 +68,7 @@ $(info === PCI passthrough capability has been enabled ===) endif BAD_OBJS += gdbstub.o acpi.o apic.o -BAD_OBJS += vmmouse.o vmport.o tcg* helper.o +BAD_OBJS += vmmouse.o vmport.o tcg* helper.o vmware_vga.o virtio-balloon.o OBJS := $(filter-out $(BAD_OBJS), $(OBJS)) diff --git a/xen-vl-extra.c b/xen-vl-extra.c index 2bb32eb2..d47b0abf 100644 --- a/xen-vl-extra.c +++ b/xen-vl-extra.c @@ -7,7 +7,6 @@ /* There is no need for multiple-inclusion protection since * there is only one place where this file is included. */ -#include "qemu-xen.h" /* Max number of PCI emulation */ @@ -99,8 +98,6 @@ void do_loadvm(const char *name) } struct qemu_alarm_timer; -static int unix_start_timer(struct qemu_alarm_timer *t) { return 0; } -static void unix_stop_timer(struct qemu_alarm_timer *t) { } #ifdef CONFIG_STUBDOM #include