Re: [libvirt] [PATCH 4/7] Copy struct inotify_event entries to avoid alignment problems

2013-04-05 Thread Eric Blake
On 04/03/2013 09:06 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > When reading the inotify FD, we get back a sequence of > struct inotify_event, each with variable length data following. > It is not safe to simply cast from the char *buf to the > struct inotify_event struct since

[libvirt] [PATCH 4/7] Copy struct inotify_event entries to avoid alignment problems

2013-04-03 Thread Daniel P. Berrange
From: "Daniel P. Berrange" When reading the inotify FD, we get back a sequence of struct inotify_event, each with variable length data following. It is not safe to simply cast from the char *buf to the struct inotify_event struct since this may violate data alignment rules. Thus we must copy from