]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl_driver: Resolve Coverity errors
authorJohn Ferlan <jferlan@redhat.com>
Thu, 28 Feb 2013 14:48:16 +0000 (09:48 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 6 Mar 2013 03:52:51 +0000 (22:52 -0500)
commit40e904490f0697a4363f0f3c359231f255d559b9
tree5fc1af2bba261a915e3c5403e1674a4008e1d7ad
parent50de0e0807c27a660ace9550018e7d10b3ed6b5a
libxl_driver: Resolve Coverity errors

1. The virObjectLock() call was unconditional, but Unlock was conditional
   on vm being valid.  Removed the check

2. A call to virDomainEventNewFromObj() isn't guaranteed to return an
   event - that check needs to be made prior to libxlDomainEventQueue()
   of the event. Did not add libxlDriverLock/Unlock around the call since
   some callers already have lock taken

3. Need to initialize fd = -1 in libxlDoDomainSave() since we can jump
   to cleanup before it's set.

4. Missing break;'s in libxlDomainModifyDeviceFlags() for case
   LIBXL_DEVICE_UPDATE.  The default: case would report an error
src/libxl/libxl_driver.c