Re: [libvirt] [PATCH] qemudDomainAttachSCSIDisk: handle empty controller list

2010-03-15 Thread Wolfgang Mauerer
Jim Meyering wrote: > Daniel P. Berrange wrote: >> On Mon, Mar 15, 2010 at 03:56:55PM +0100, Wolfgang Mauerer wrote: >>> Jim Meyering wrote: Clang found something that might be a real bug. I suspect that ...drive.controller will always be at least one, >>> it can - explanation below. >>>

Re: [libvirt] [PATCH] qemudDomainAttachSCSIDisk: handle empty controller list

2010-03-15 Thread Daniel P. Berrange
On Mon, Mar 15, 2010 at 04:46:31PM +0100, Jim Meyering wrote: > > However, there's more to it than that. > The controller index, while technically "unsigned", may > be derived from an expression like -1 / 7, > since virDomainDiskDefAssignAddress does this: > > void > virDomainDiskDefAssignAdd

Re: [libvirt] [PATCH] qemudDomainAttachSCSIDisk: handle empty controller list

2010-03-15 Thread Jim Meyering
Daniel P. Berrange wrote: > On Mon, Mar 15, 2010 at 03:56:55PM +0100, Wolfgang Mauerer wrote: >> Jim Meyering wrote: >> > Clang found something that might be a real bug. >> > I suspect that ...drive.controller will always be at least one, >> it can - explanation below. >> >> > but we should not hav

Re: [libvirt] [PATCH] qemudDomainAttachSCSIDisk: handle empty controller list

2010-03-15 Thread Wolfgang Mauerer
Jim Meyering wrote: > Clang found something that might be a real bug. > I suspect that ...drive.controller will always be at least one, it can - explanation below. > but we should not have to dive into the code trying to figure > that out. It's easier/better here just to handle the potential trou

Re: [libvirt] [PATCH] qemudDomainAttachSCSIDisk: handle empty controller list

2010-03-15 Thread Daniel P. Berrange
On Mon, Mar 15, 2010 at 03:56:55PM +0100, Wolfgang Mauerer wrote: > Jim Meyering wrote: > > Clang found something that might be a real bug. > > I suspect that ...drive.controller will always be at least one, > it can - explanation below. > > > but we should not have to dive into the code trying to

Re: [libvirt] [PATCH] qemudDomainAttachSCSIDisk: handle empty controller list

2010-03-02 Thread Eric Blake
According to Jim Meyering on 3/2/2010 9:54 AM: > It's easier/better here just to handle the potential trouble: > > * src/qemu/qemu_driver.c (qemudDomainAttachSCSIDisk): Handle > the (theoretical) case of an empty controller list, so that > clang does not think the subsequent dereference of "cont"

[libvirt] [PATCH] qemudDomainAttachSCSIDisk: handle empty controller list

2010-03-02 Thread Jim Meyering
Clang found something that might be a real bug. I suspect that ...drive.controller will always be at least one, but we should not have to dive into the code trying to figure that out. It's easier/better here just to handle the potential trouble: clang saw that if it *was* zero, then the following