kvm: qemu: fix the prototype of virtio_net_init()
PATCH 1/18 kvm: qemu: fix the prototype of virtio_net_init()
NIC init functions don't return a PCIDevice pointer in upstream QEMU but they do in KVM for hotplug.
Fixes:
qemu/hw/pci.c:740: warning: initialization from incompatible pointer type
--- qemu/hw/virtio-net.c | 6 ++++-- qemu/hw/virtio-net.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
qemu/hw/virtio-net.c +4 -2
@@ -409,7 +409,7 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)return 0 ; } -void virtio_net_init (PCIBus *bus,NICInfo *nd,int devfn) +PCIDevice *virtio_net_init (PCIBus *bus,NICInfo *nd,int devfn) {VirtIONet *n;static int virtio_net_id;
@@ -420,7 +420,7 @@ void virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)sizeof (struct virtio_net_config ), sizeof(VirtIONet));if (!n) -return ; +return NULL ; n->vdev.get_config = virtio_net_update_config; n->vdev.get_features = virtio_net_get_features;
@@ -441,4 +441,6 @@ void virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)register_savevm ("virtio-net" , virtio_net_id++,2 , virtio_net_save, virtio_net_load, n); + +return (PCIDevice *)n; }
qemu/hw/virtio-net.h +1 -1
@@ -80,6 +80,6 @@ struct virtio_net_hdr_mrg_rxbuf uint16_t num_buffers; /* Number of merged rx buffers */ }; -void virtio_net_init (PCIBus *bus,NICInfo *nd,int devfn); +PCIDevice *virtio_net_init (PCIBus *bus,NICInfo *nd,int devfn);#endif
Signature · 1 line
1.6.0.6
PATCH 2/18 kvm: qemu: make qemu_alloc_physram() and alloc_mem_area() static
Fixes:
qemu/vl.c:4667: warning: no previous prototype for ‘alloc_mem_area’ qemu/vl.c:4710: warning: no previous prototype for ‘qemu_alloc_physram’
--- qemu/vl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
qemu/vl.c +2 -2
@@ -4664,7 +4664,7 @@ static int gethugepagesize(void)return hugepagesize; } -void *alloc_mem_area (size_t memory,unsigned long *len,const char *path) +static void *alloc_mem_area (size_t memory,unsigned long *len,const char *path) {char *filename;void *area;
@@ -4707,7 +4707,7 @@ void *alloc_mem_area(size_t memory, unsigned long *len, const char *path)return area; } -void *qemu_alloc_physram (unsigned long memory) +static void *qemu_alloc_physram (unsigned long memory) {void *area =NULL ;unsigned long map_len = memory;
Signature · 1 line
1.6.0.6
PATCH 3/18 kvm: qemu: kill some redundant declarations
Fixes:
qemu/vl.c:5295: warning: redundant redeclaration of ‘kvm_pit’ qemu/vl.c:5289: warning: previous declaration of ‘kvm_pit’ was here qemu/vl.c:5541: warning: redundant redeclaration of ‘kvm_allowed’ qemu/qemu-kvm.h:144: warning: previous declaration of ‘kvm_allowed’ was here qemu/qemu-kvm.h:144: warning: redundant redeclaration of ‘kvm_allowed’ qemu/qemu-kvm.c:11: warning: previous definition of ‘kvm_allowed’ was here qemu/qemu-kvm.h:145: warning: redundant redeclaration of ‘kvm_nested’ qemu/qemu-kvm.c:15: warning: previous definition of ‘kvm_nested’ was here qemu/kvm-tpr-opt.c:22: warning: redundant redeclaration of ‘kvm_context’ qemu/qemu-kvm.h:146: warning: previous declaration of ‘kvm_context’ was here qemu/qemu-kvm-x86.c:27: warning: redundant redeclaration of ‘kvm_context’
--- qemu/kvm-tpr-opt.c | 2 -- qemu/qemu-kvm-x86.c | 1 - qemu/qemu-kvm.c | 11 +++++------ qemu/qemu-kvm.h | 3 +++ qemu/vl.c | 4 ---- 5 files changed, 8 insertions(+), 13 deletions(-)
qemu/kvm-tpr-opt.c +0 -2
@@ -19,8 +19,6 @@#include <stdio.h> -extern kvm_context_t kvm_context; -static uint64_t map_addr (struct kvm_sregs *sregs,target_ulong virt,unsigned *perms) {uint64_t mask = ((1ull <<48 ) -1 ) & ~4095ull ;
qemu/qemu-kvm-x86.c +0 -1
@@ -24,7 +24,6 @@static struct kvm_msr_list *kvm_msr_list;extern unsigned int kvm_shadow_memory; -extern kvm_context_t kvm_context;static int kvm_has_msr_star;static int lm_capable_kernel;
qemu/qemu-kvm.c +5 -6
@@ -8,12 +8,6 @@#include "config.h" #include "config-host.h" -int kvm_allowed =1 ; -int kvm_irqchip =1 ; -int kvm_pit =1 ; -int kvm_pit_reinject =1 ; -int kvm_nested =0 ; -#include <assert.h> #include <string.h> #include "hw/hw.h"
@@ -36,6 +30,11 @@ int kvm_nested = 0;extern void perror (const char *s); +int kvm_allowed =1 ; +int kvm_irqchip =1 ; +int kvm_pit =1 ; +int kvm_pit_reinject =1 ; +int kvm_nested =0 ;kvm_context_t kvm_context;extern int smp_cpus;
qemu/qemu-kvm.h +3 -0
@@ -142,6 +142,9 @@ int handle_powerpc_dcr_write(int vcpu,uint32_t dcrn, uint32_t data);#include "sys-queue.h" extern int kvm_allowed; +extern int kvm_irqchip; +extern int kvm_pit; +extern int kvm_pit_reinject;extern int kvm_nested;extern kvm_context_t kvm_context;
qemu/vl.c +0 -4
@@ -5286,18 +5286,15 @@ int main(int argc, char **argv, char **envp) kvm_allowed =0 ;break ;case QEMU_OPTION_no_kvm_irqchip: { -extern int kvm_irqchip, kvm_pit; kvm_irqchip =0 ; kvm_pit =0 ;break ; }case QEMU_OPTION_no_kvm_pit: { -extern int kvm_pit; kvm_pit =0 ;break ; }case QEMU_OPTION_no_kvm_pit_reinjection: { -extern int kvm_pit_reinject; kvm_pit_reinject =0 ;break ; }
@@ -5538,7 +5535,6 @@ int main(int argc, char **argv, char **envp)#if USE_KVM if (kvm_enabled ()) {if (kvm_qemu_init () <0 ) { -extern int kvm_allowed;fprintf (stderr,"Could not initialize KVM, will disable KVM support\n" );#ifdef NO_CPU_EMULATION fprintf (stderr,"Compiled with --disable-cpu-emulation, exiting.\n" );
Signature · 1 line
1.6.0.6
PATCH 4/18 kvm: qemu: make lsi_scsi_uninit() static
Fixes:
qemu/hw/lsi53c895a.c:1964: warning: no previous prototype for ‘lsi_scsi_uninit’
--- qemu/hw/lsi53c895a.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
qemu/hw/lsi53c895a.c +1 -1
@@ -1961,7 +1961,7 @@ void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id) bd->devfn = s->pci_dev.devfn; } -int lsi_scsi_uninit (PCIDevice *d) +static int lsi_scsi_uninit (PCIDevice *d) {LSIState *s = (LSIState *) d;
Signature · 1 line
1.6.0.6
PATCH 5/18 kvm: qemu: Fix virtio_blk_init() calls
This QEMU commit:
pci: virtio: use pci id defines (Gerd Hoffman)
removed the vendor/device id parameters from virtio_blk_init().
Fixes:
qemu/hw/device-hotplug.c: In function ‘qemu_system_hot_add_storage’:
qemu/hw/device-hotplug.c:165: warning: implicit declaration of function ‘virtio_blk_init’ qemu/hw/device-hotplug.c:166: warning: assignment makes pointer from integer without a cast
(Note: the ia64 fix is untested)
--- qemu/hw/device-hotplug.c | 4 ++-- qemu/hw/ipf.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-)
qemu/hw/device-hotplug.c +2 -2
@@ -8,6 +8,7 @@#include "block_int.h" #include "device-assignment.h" #include "config.h" +#include "virtio-blk.h" #define PCI_BASE_CLASS_STORAGE 0x01#define PCI_BASE_CLASS_NETWORK 0x02
@@ -162,8 +163,7 @@ static PCIDevice *qemu_system_hot_add_storage(const char *opts, int bus_nr) drives_table[drive_idx].unit);break ;case IF_VIRTIO : - opaque =virtio_blk_init (pci_bus,0x1AF4 ,0x1001 , - drives_table[drive_idx].bdrv); + opaque =virtio_blk_init (pci_bus, drives_table[drive_idx].bdrv);break ;default :term_printf ("type %s not a hotpluggable PCI device.\n" , buf);
qemu/hw/ipf.c +2 -1
@@ -39,6 +39,7 @@#include "ia64intrin.h" #include <unistd.h> #include "device-assignment.h" +#include "virtio-blk.h" #include "qemu-kvm.h"
@@ -625,7 +626,7 @@ static void ipf_init1(ram_addr_t ram_size, int vga_ram_size,int unit_id =0 ;while ((index =drive_get_index (IF_VIRTIO ,0 , unit_id)) !=-1 ) { -virtio_blk_init (pci_bus,0x1AF4 ,0x1001 , drives_table[index].bdrv); +virtio_blk_init (pci_bus, drives_table[index].bdrv); unit_id++; } }
Signature · 1 line
1.6.0.6
PATCH 6/18 kvm: qemu: device-assignment: don't use libkvm's private get_slot()
get_slot() isn't exported by libkvm, so we shouldn't be using it.
The worst thing that can happen because of this change is that libkvm will spew a warning. It looks to me like that can't happen though.
Fixes:
qemu/hw/device-assignment.c:161: warning: implicit declaration of function ‘get_slot’
--- qemu/hw/device-assignment.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
qemu/hw/device-assignment.c +3 -6
@@ -157,12 +157,9 @@ static void assigned_dev_iomem_map(PCIDevice *pci_dev, int region_num, region->e_physbase = e_phys; region->e_size = e_size; -if (!first_map) { -int slot =get_slot (old_ephys); -if (slot !=-1 ) -kvm_destroy_phys_mem (kvm_context, old_ephys, -TARGET_PAGE_ALIGN (old_esize)); - } +if (!first_map) +kvm_destroy_phys_mem (kvm_context, old_ephys, +TARGET_PAGE_ALIGN (old_esize));if (e_size >0 ) ret = kvm_register_phys_mem(kvm_context, e_phys,
Signature · 1 line
1.6.0.6
PATCH 7/18 kvm: libkvm: make get_slot() and co. static
--- libkvm/kvm-common.h | 8 -------- libkvm/libkvm.c | 12 ++++++------ 2 files changed, 6 insertions(+), 14 deletions(-)
libkvm/kvm-common.h +0 -8
@@ -63,14 +63,6 @@ struct kvm_context {int coalesced_mmio; }; -void init_slots (void ); -int get_free_slot (kvm_context_t kvm); -void register_slot (int slot,unsigned long phys_addr,unsigned long len, -unsigned long userspace_addr,unsigned flags); - -void free_slot (int slot); -int get_slot (unsigned long phys_addr); -int kvm_alloc_kernel_memory (kvm_context_t kvm,unsigned long memory,void **vm_mem); int kvm_alloc_userspace_memory(kvm_context_t kvm, unsigned long memory,
libkvm/libkvm.c +6 -6
@@ -75,7 +75,7 @@ struct slot_info {struct slot_info slots[KVM_MAX_NUM_MEM_REGIONS ]; -void init_slots (void ) +static void init_slots (void ) {int i;
@@ -83,7 +83,7 @@ void init_slots(void) slots[i].len =0 ; } -int get_free_slot (kvm_context_t kvm) +static int get_free_slot (kvm_context_t kvm) {int i;int tss_ext;
@@ -110,7 +110,7 @@ int get_free_slot(kvm_context_t kvm)return -1 ; } -void register_slot (int slot,unsigned long phys_addr,unsigned long len, +static void register_slot (int slot,unsigned long phys_addr,unsigned long len,unsigned long userspace_addr,unsigned flags) { slots[slot].phys_addr = phys_addr;
@@ -119,13 +119,13 @@ void register_slot(int slot, unsigned long phys_addr, unsigned long len, slots[slot].flags = flags; } -void free_slot (int slot) +static void free_slot (int slot) { slots[slot].len =0 ; slots[slot].logging_count =0 ; } -int get_slot (unsigned long phys_addr) +static int get_slot (unsigned long phys_addr) {int i;
@@ -139,7 +139,7 @@ int get_slot(unsigned long phys_addr)/* Returns -1 if this slot is not totally contained on any other, * and the number of the slot otherwise */ -int get_container_slot (uint64_t phys_addr,unsigned long size) +static int get_container_slot (uint64_t phys_addr,unsigned long size) {int i;
Signature · 1 line
1.6.0.6
PATCH 8/18 kvm: qemu: device-assignment: add kvm_add_ioperm_data() prototype
Fixes:
qemu/hw/device-assignment.c:205: warning: implicit declaration of function ‘kvm_add_ioperm_data’
--- qemu/qemu-kvm.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
qemu/qemu-kvm.h +3 -0
@@ -125,7 +125,10 @@ int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);int kvm_uncoalesce_mmio_region (target_phys_addr_t start,ram_addr_t size);#ifdef USE_KVM_DEVICE_ASSIGNMENT +struct ioperm_data ; +void kvm_ioperm (CPUState *env,void *data); +void kvm_add_ioperm_data (struct ioperm_data *data);void kvm_arch_do_ioperm (void *_data);#endif
Signature · 1 line
1.6.0.6
PATCH 9/18 kvm: qemu: device-assignment: add assigned_dev_update_irq() prototype
Fixes:
qemu/hw/device-assignment.c:494: warning: no previous prototype for ‘assigned_dev_update_irq’
--- qemu/hw/device-assignment.h | 1 + qemu/hw/pci.c | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-)
qemu/hw/device-assignment.h +1 -0
@@ -99,6 +99,7 @@ PCIDevice *init_assigned_device(AssignedDevInfo *adev, PCIBus *bus);AssignedDevInfo *add_assigned_device (const char *arg);void add_assigned_devices (PCIBus *bus,const char **devices,int n_devices);ram_addr_t assigned_dev_load_option_roms (ram_addr_t rom_base_offset); +void assigned_dev_update_irq (PCIDevice *d);#define MAX_DEV_ASSIGN_CMDLINE 8
qemu/hw/pci.c +1 -1
@@ -28,6 +28,7 @@#include "virtio-net.h" #include "pc.h" #include "qemu-kvm.h" +#include "device-assignment.h" //#define DEBUG_PCI
@@ -51,7 +52,6 @@ struct PCIBus {static void pci_update_mappings (PCIDevice *d);static void pci_set_irq (void *opaque,int irq_num,int level); -void assigned_dev_update_irq (PCIDevice *d);target_phys_addr_t pci_mem_base;static uint16_t pci_default_sub_vendor_id =PCI_SUBVENDOR_ID_REDHAT_QUMRANET ;
Signature · 1 line
1.6.0.6
PATCH 10/18 kvm: qemu: device-assignment: fix ROM writing
Use write() instead of write_rom() to write the device number.
Cast the struct option_rom_header* to uint8_t* for write_rom().
Fixes:
qemu/hw/device-assignment.c: In function ‘scan_option_rom’:
qemu/hw/device-assignment.c:766: warning: passing argument 2 of ‘cpu_physical_memory_write_rom’ from incompatible pointer type
--- qemu/hw/device-assignment.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
qemu/hw/device-assignment.c +2 -2
@@ -760,8 +760,8 @@ static int scan_option_rom(uint8_t devfn, void *roms, ram_addr_t offset)cpu_register_physical_memory (0xd0000 + offset, total_size, addr |IO_MEM_ROM );/* Write ROM data and devfn to phys_addr */ -cpu_physical_memory_write_rom (0xd0000 + offset, rom, size); -cpu_physical_memory_write_rom (0xd0000 + offset + size, &devfn,1 ); +cpu_physical_memory_write_rom (0xd0000 + offset, (uint8_t *)rom, size); +cpu_physical_memory_write (0xd0000 + offset + size, &devfn,1 );return total_size; }
Signature · 1 line
1.6.0.6
PATCH 11/18 kvm: qemu: kill unused variable
Fixes:
qemu/hw/pc.c: In function ‘pc_init1’:
qemu/hw/pc.c:812: warning: unused variable ‘opt_rom_offset’
--- qemu/hw/pc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
qemu/hw/pc.c +1 -1
@@ -809,7 +809,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,int ret, linux_boot, i;ram_addr_t ram_addr, vga_ram_addr, bios_offset, vga_bios_offset;ram_addr_t below_4g_mem_size, above_4g_mem_size =0 ; -int bios_size, isa_bios_size, vga_bios_size, opt_rom_offset; +int bios_size, isa_bios_size, vga_bios_size;int pci_option_rom_offset;PCIBus *pci_bus;int piix3_devfn =-1 ;
Signature · 1 line
1.6.0.6
PATCH 12/18 kvm: qemu: kill redundant declarion of perror()
stdio.h is included by qemu-common.h
Fixes:
qemu/qemu-kvm.c:37: warning: redundant redeclaration of ‘perror’ /usr/include/stdio.h:817: warning: previous declaration of ‘perror’ was here
--- qemu/qemu-kvm.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
qemu/qemu-kvm.c +0 -2
@@ -28,8 +28,6 @@#define false 0#define true 1 -extern void perror (const char *s); -int kvm_allowed =1 ;int kvm_irqchip =1 ;int kvm_pit =1 ;
Signature · 1 line
1.6.0.6
PATCH 13/18 kvm: qemu: kill redundant declaration of smp_cpus and vm_running
Defined in sysemu.h, included by qemu-kvm.c
qemu/qemu-kvm.c:41: warning: redundant redeclaration of ‘smp_cpus’ qemu/sysemu.h:98: warning: previous declaration of ‘smp_cpus’ was here qemu/qemu-kvm.c:219: warning: redundant redeclaration of ‘vm_running’ qemu/sysemu.h:9: warning: previous declaration of ‘vm_running’ was here
--- qemu/qemu-kvm.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
qemu/qemu-kvm.c +0 -4
@@ -35,8 +35,6 @@ int kvm_pit_reinject = 1;int kvm_nested =0 ;kvm_context_t kvm_context; -extern int smp_cpus; -pthread_mutex_t qemu_mutex =PTHREAD_MUTEX_INITIALIZER ;pthread_cond_t qemu_vcpu_cond =PTHREAD_COND_INITIALIZER ;pthread_cond_t qemu_system_cond =PTHREAD_COND_INITIALIZER ;
@@ -213,8 +211,6 @@ int kvm_cpu_exec(CPUState *env)return 0 ; } -extern int vm_running; -static int has_work (CPUState *env) {if (!vm_running || (env && env->kvm_cpu_state.stopped))
Signature · 1 line
1.6.0.6
PATCH 14/18 kvm: qemu: make qemu_kvm_system_reset() static
Fixes:
qemu/qemu-kvm.c:373: warning: no previous prototype for ‘qemu_kvm_system_reset’
--- qemu/qemu-kvm.c | 2 +- qemu/qemu-kvm.h | 2 -- 2 files changed, 1 insertions(+), 3 deletions(-)
qemu/qemu-kvm.c +1 -1
@@ -363,7 +363,7 @@ static void setup_kernel_sigmask(CPUState *env)kvm_set_signal_mask (kvm_context, env->cpu_index, &set); } -void qemu_kvm_system_reset (void ) +static void qemu_kvm_system_reset (void ) {CPUState *penv = first_cpu;
qemu/qemu-kvm.h +0 -2
@@ -119,8 +119,6 @@ int qemu_kvm_register_coalesced_mmio(target_phys_addr_t addr,int qemu_kvm_unregister_coalesced_mmio (target_phys_addr_t addr,unsigned int size); -void qemu_kvm_system_reset_request (void ); -int kvm_coalesce_mmio_region (target_phys_addr_t start,ram_addr_t size);int kvm_uncoalesce_mmio_region (target_phys_addr_t start,ram_addr_t size);
Signature · 1 line
1.6.0.6
PATCH 15/18 kvm: qemu: kill unused variable in kvm_init_vcpu()
qemu/qemu-kvm.c: In function ‘kvm_init_vcpu’:
qemu/qemu-kvm.c:460: warning: unused variable ‘cpu’
--- qemu/qemu-kvm.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
qemu/qemu-kvm.c +0 -1
@@ -450,7 +450,6 @@ static void *ap_main_loop(void *_env)void kvm_init_vcpu (CPUState *env) { -int cpu = env->cpu_index;pthread_create (&env->kvm_cpu_state.thread,NULL , ap_main_loop, env);while (env->kvm_cpu_state.created ==0 )
Signature · 1 line
1.6.0.6
PATCH 16/18 kvm: qemu: make another couple of functions static
Fixes:
qemu/qemu-kvm.c:1170: warning: no previous prototype for ‘kvm_get_dirty_pages_log_range’ qemu/qemu-kvm.c:1200: warning: no previous prototype for ‘kvm_get_dirty_bitmap_cb’
--- qemu/qemu-kvm.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
qemu/qemu-kvm.c +6 -6
@@ -1159,10 +1159,10 @@ int kvm_physical_memory_set_dirty_tracking(int enable) }/* get kvm's dirty pages bitmap and update qemu's */ -int kvm_get_dirty_pages_log_range (unsigned long start_addr, -unsigned char *bitmap, -unsigned int offset, -unsigned long mem_size) +static int kvm_get_dirty_pages_log_range (unsigned long start_addr, +unsigned char *bitmap, +unsigned int offset, +unsigned long mem_size) {unsigned int i, j, n=0 ;unsigned char c;
@@ -1189,8 +1189,8 @@ int kvm_get_dirty_pages_log_range(unsigned long start_addr, }return 0 ; } -int kvm_get_dirty_bitmap_cb (unsigned long start,unsigned long len, -void *bitmap,void *opaque) +static int kvm_get_dirty_bitmap_cb (unsigned long start,unsigned long len, +void *bitmap,void *opaque) {return kvm_get_dirty_pages_log_range (start, bitmap, start, len); }
Signature · 1 line
1.6.0.6
PATCH 17/18 kvm: qemu: fix update_vbios_real_tpr declaration
Fixes:
qemu/kvm-tpr-opt.c:119: warning: function declaration isn’t a prototype
--- qemu/kvm-tpr-opt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
qemu/kvm-tpr-opt.c +1 -1
@@ -115,7 +115,7 @@ static uint32_t vapic_phys;static int bios_enabled;static uint32_t vbios_desc_phys; -void update_vbios_real_tpr () +static void update_vbios_real_tpr (void ) {cpu_physical_memory_rw (vbios_desc_phys, (void *)&vapic_bios,sizeof vapic_bios,0 ); vapic_bios.real_tpr = real_tpr;
Signature · 1 line
1.6.0.6
PATCH 18/18 kvm: qemu: kill unused variable in enable_vapic()
Fixes:
qemu/kvm-tpr-opt.c:22: warning: redundant redeclaration of ‘kvm_context’
--- qemu/kvm-tpr-opt.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
qemu/kvm-tpr-opt.c +0 -1
@@ -222,7 +222,6 @@ static int bios_is_mapped(CPUState *env, uint64_t rip)static int enable_vapic (CPUState *env) { -struct kvm_sregs sregs;static uint8_t one =1 ; kvm_enable_vapic(kvm_context, env->cpu_index,
Signature · 1 line
1.6.0.6
Re: [PATCH 10/18] kvm: qemu: device-assignment: fix ROM writing
In reply to Mark McLoughlinQuoted 19 lines · Mark McLoughlin
Use
write()instead ofwrite_rom()to write the device number.Cast the struct option_rom_header* to uint8_t* for
write_rom().Fixes:
qemu/hw/device-assignment.c: In function ‘scan_option_rom’:
qemu/hw/device-assignment.c:766: warning: passing argument 2 of ‘cpu_physical_memory_write_rom’ from incompatible pointer typeSigned-off-by Mark McLoughlin <[email protected]>--- qemu/hw/device-assignment.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)qemu/hw/device-assignment.c +0
-0
qemu/hw/device-assignment.c static int scan_option_rom(uint8_t devfn, void *roms, ram_addr_t offset) · line 767
Quoted 10 lines
qemu/hw/device-assignment.c +2
-2@@ -760,8 +760,8 @@ static int scan_option_rom(uint8_t devfn, void *roms, ram_addr_t offset)cpu_register_physical_memory (0xd0000 + offset, total_size, addr |IO_MEM_ROM );/* Write ROM data and devfn to phys_addr */ -cpu_physical_memory_write_rom (0xd0000 + offset, rom, size); -cpu_physical_memory_write_rom (0xd0000 + offset + size, &devfn,1 ); +cpu_physical_memory_write_rom (0xd0000 + offset, (uint8_t *)rom, size); +cpu_physical_memory_write (0xd0000 + offset + size, &devfn,1 );return total_size;
Why drop _rom? The memory region is registered as a rom, a few lines earlier?
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [PATCH 10/18] kvm: qemu: device-assignment: fix ROM writing
Quoted 28 lines · Avi Kivity
Quoted 27 lines · Mark McLoughlin
Use
write()instead ofwrite_rom()to write the device number.Cast the struct option_rom_header* to uint8_t* for
write_rom().Fixes:
qemu/hw/device-assignment.c: In function ‘scan_option_rom’:
qemu/hw/device-assignment.c:766: warning: passing argument 2 of ‘cpu_physical_memory_write_rom’ from incompatible pointer typeSigned-off-by Mark McLoughlin <[email protected]>--- qemu/hw/device-assignment.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)qemu/hw/device-assignment.c +2
-2@@ -760,8 +760,8 @@ static int scan_option_rom(uint8_t devfn, void *roms, ram_addr_t offset)cpu_register_physical_memory (0xd0000 + offset, total_size, addr |IO_MEM_ROM );/* Write ROM data and devfn to phys_addr */ -cpu_physical_memory_write_rom (0xd0000 + offset, rom, size); -cpu_physical_memory_write_rom (0xd0000 + offset + size, &devfn,1 ); +cpu_physical_memory_write_rom (0xd0000 + offset, (uint8_t *)rom, size); +cpu_physical_memory_write (0xd0000 + offset + size, &devfn,1 );
Quoted 5 lines
qemu/hw/device-assignment.c static int scan_option_rom(uint8_t devfn, void *roms, ram_addr_t offset) · line 767
Quoted 2 lines
qemu/hw/device-assignment.c +0
-0return total_size;Why drop
_rom? The memory region is registered as a rom, a few lines earlier?
My mistake, can you just apply the change to the first line?
Thanks,
Mark.
Re: [PATCH 10/18] kvm: qemu: device-assignment: fix ROM writing
Quoted 6 lines · Mark McLoughlin
Quoted 2 lines
Why drop
_rom? The memory region is registered as a rom, a few lines earlier?My mistake, can you just apply the change to the first line?
Sure, applied with _rom.
Signature · 1 line
error compiling committee.c: too many arguments to function
Avi Kivity
AppliedQuoted 8 lines · Mark McLoughlin
NIC init functions don't return a PCIDevice pointer in upstream QEMU but they do in KVM for hotplug.
Fixes:
qemu/hw/pci.c:740: warning: initialization from incompatible pointer type
I should have caught this while merging, argh.
Applied all patches except #10, thanks. If qemu gains a --developer option which enables -Werror (and if we're warning clean), I promise to use it.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Mark McLoughlin
NIC init functions don't return a PCIDevice pointer in upstream QEMU but they do in KVM for hotplug.
Fixes:
qemu/hw/pci.c:740: warning: initialization from incompatible pointer type
Quoted 5 lines
I should have caught this while merging, argh.
Applied all patches except #10, thanks. If qemu gains a --developer option which enables -Werror (and if we're warning clean), I promise to use it.
Yeah, it has --enable-werror, but it's not quite warning clean yet (tcg and slirp AFAIR)
There's still a bunch more warnings in kvm-userspace that aren't in upstream qemu - I just quickly fixed the obvious ones.
Cheers,
Mark.