Revision 72aef731
b/hw/scsi-disk.c | ||
---|---|---|
70 | 70 |
char *serial; |
71 | 71 |
}; |
72 | 72 |
|
73 |
static SCSIDiskReq *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun) |
|
73 |
static SCSIDiskReq *scsi_new_request(SCSIDiskState *s, uint32_t tag, |
|
74 |
uint32_t lun) |
|
74 | 75 |
{ |
75 | 76 |
SCSIRequest *req; |
76 | 77 |
SCSIDiskReq *r; |
77 | 78 |
|
78 |
req = scsi_req_alloc(sizeof(SCSIDiskReq), d, tag, lun);
|
|
79 |
req = scsi_req_alloc(sizeof(SCSIDiskReq), &s->qdev, tag, lun);
|
|
79 | 80 |
r = DO_UPCAST(SCSIDiskReq, req, req); |
80 |
r->iov.iov_base = qemu_memalign(512, SCSI_DMA_BUF_SIZE);
|
|
81 |
r->iov.iov_base = qemu_blockalign(s->bs, SCSI_DMA_BUF_SIZE);
|
|
81 | 82 |
return r; |
82 | 83 |
} |
83 | 84 |
|
... | ... | |
939 | 940 |
} |
940 | 941 |
/* ??? Tags are not unique for different luns. We only implement a |
941 | 942 |
single lun, so this should not matter. */ |
942 |
r = scsi_new_request(d, tag, lun);
|
|
943 |
r = scsi_new_request(s, tag, lun);
|
|
943 | 944 |
outbuf = (uint8_t *)r->iov.iov_base; |
944 | 945 |
is_write = 0; |
945 | 946 |
DPRINTF("Command: lun=%d tag=0x%x data=0x%02x", lun, tag, buf[0]); |
b/hw/sd.c | ||
---|---|---|
440 | 440 |
SDState *sd; |
441 | 441 |
|
442 | 442 |
sd = (SDState *) qemu_mallocz(sizeof(SDState)); |
443 |
sd->buf = qemu_memalign(512, 512);
|
|
443 |
sd->buf = qemu_blockalign(bs, 512);
|
|
444 | 444 |
sd->spi = is_spi; |
445 | 445 |
sd->enable = 1; |
446 | 446 |
sd_reset(sd, bs); |
b/posix-aio-compat.c | ||
---|---|---|
270 | 270 |
* Ok, we have to do it the hard way, copy all segments into |
271 | 271 |
* a single aligned buffer. |
272 | 272 |
*/ |
273 |
buf = qemu_memalign(512, aiocb->aio_nbytes);
|
|
273 |
buf = qemu_blockalign(aiocb->common.bs, aiocb->aio_nbytes);
|
|
274 | 274 |
if (aiocb->aio_type & QEMU_AIO_WRITE) { |
275 | 275 |
char *p = buf; |
276 | 276 |
int i; |
b/qemu-io.c | ||
---|---|---|
61 | 61 |
|
62 | 62 |
if (misalign) |
63 | 63 |
len += MISALIGN_OFFSET; |
64 |
buf = qemu_memalign(512, len);
|
|
64 |
buf = qemu_blockalign(bs, len);
|
|
65 | 65 |
memset(buf, pattern, len); |
66 | 66 |
if (misalign) |
67 | 67 |
buf += MISALIGN_OFFSET; |
b/qemu-nbd.c | ||
---|---|---|
446 | 446 |
max_fd = sharing_fds[0]; |
447 | 447 |
nb_fds++; |
448 | 448 |
|
449 |
data = qemu_memalign(512, NBD_BUFFER_SIZE);
|
|
449 |
data = qemu_blockalign(bs, NBD_BUFFER_SIZE);
|
|
450 | 450 |
if (data == NULL) |
451 | 451 |
errx(EXIT_FAILURE, "Cannot allocate data buffer"); |
452 | 452 |
|
Also available in: Unified diff