[libvirt] [PATCH] conf: avoid NULL deref for pmsuspended domain state

Eric Blake eblake at redhat.com
Fri Jan 25 16:36:57 UTC 2013


On 01/23/2013 07:55 PM, Osier Yang wrote:
> On 2013年01月24日 08:12, Eric Blake wrote:
>> While working with a pmsuspend vs. snapshot issue, I noticed that
>> the state file in /var/run/libvirt/qemu/dom.xml contained a rather
>> suspicious "(null)" string, which does not round-trip well through
>> a libvirtd restart.  Had I been on a platform other than glibc
>> where printf("%s",NULL) crashes instead of printing (null), we might
>> have noticed the problem much sooner.
>>
>> And in fixing that problem, I also noticed that we had several
>> missing states, because we were #defining several *_LAST names
>> to a value _different_ than what they were already given as enums
>> in libvirt.h.  Yuck.  I got rid of default: labels in the case
>> statements, because they get in the way of gcc's -Wswitch helping
>> us ensure we cover all enum values.
>>

> 
> ACK, with the emacs tail. But it will be nice to
> use the emacs tail for all the private syms files
> before pushing.

Sure, I reordered the patch, and added the emacs tail to ALL the syms
files, before pushing.  Thanks for the review.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130125/7c813c31/attachment-0001.sig>


More information about the libvir-list mailing list