On Tue 06 Nov 2018 04:13:58 PM CET, Vladimir Sementsov-Ogievskiy wrote: > 06.11.2018 18:06, Alberto Garcia wrote: >> On Thu 01 Nov 2018 07:27:37 PM CET, Vladimir Sementsov-Ogievskiy wrote: >> >>> + buf = g_try_malloc(csize); >>> + if (!buf) { >>> + return -ENOMEM; >>> + } >>> + iov.iov_base = buf; >>> + iov.iov_len = csize; >>> + qemu_iovec_init_external(&local_qiov, &iov, 1); >>> >>> - iov.iov_base = s->cluster_data; >>> - iov.iov_len = csize; >>> - qemu_iovec_init_external(&local_qiov, &iov, 1); >>> + out_buf = qemu_blockalign(bs, s->cluster_size); >> You should also check whether out_buf is NULL, shouldn't you? > > No, it will abort on fail. qemu_try_blockalign result should be > checked.
Is there any reason why some parts of the QEMU code use qemu_blockalign and others qemu_try_blockalign() ? From what I can see it seems to be up to whoever wrote it... Berto