Re: [Qemu-devel] [PATCH v5 2/5] Add Error **errp for xen_host_pci_device_get()

2016-01-17 Thread Cao jin
On 01/16/2016 12:41 AM, Eric Blake wrote: On 01/14/2016 08:11 PM, Cao jin wrote: buf[rc] = 0; -rc = qemu_strtoul(buf, , base, ); -if (!rc) { -*pvalue = value; +rc = qemu_strtoul(buf, , base, (unsigned long *)pvalue); Ouch. Casting unsigned int * to unsigned long

Re: [Qemu-devel] [PATCH v5 2/5] Add Error **errp for xen_host_pci_device_get()

2016-01-15 Thread Eric Blake
On 01/14/2016 08:11 PM, Cao jin wrote: >>> buf[rc] = 0; >>> -rc = qemu_strtoul(buf, , base, ); >>> -if (!rc) { >>> -*pvalue = value; >>> +rc = qemu_strtoul(buf, , base, (unsigned long *)pvalue); >> >> Ouch. Casting unsigned int * to unsigned long * and then dereferencing

Re: [Qemu-devel] [PATCH v5 2/5] Add Error **errp for xen_host_pci_device_get()

2016-01-14 Thread Eric Blake
On 01/13/2016 05:51 AM, Cao jin wrote: > To catch the error msg. Also modify the caller > > Signed-off-by: Cao jin > --- > hw/xen/xen-host-pci-device.c | 142 > +-- > hw/xen/xen-host-pci-device.h | 5 +- > hw/xen/xen_pt.c

Re: [Qemu-devel] [PATCH v5 2/5] Add Error **errp for xen_host_pci_device_get()

2016-01-14 Thread Cao jin
On 01/15/2016 06:29 AM, Eric Blake wrote: On 01/13/2016 05:51 AM, Cao jin wrote: To catch the error msg. Also modify the caller Signed-off-by: Cao jin --- hw/xen/xen-host-pci-device.c | 142 +--