Lines Matching refs:len
215 void *dest, unsigned len) in iov_consume() argument
222 used = iov[i].iov_len < len ? iov[i].iov_len : len; in iov_consume()
229 len -= used; in iov_consume()
231 if (len != 0) in iov_consume()
328 static void map_at(int fd, void *addr, unsigned long offset, unsigned long len) in map_at() argument
341 if (mmap(addr, len, PROT_READ|PROT_WRITE, in map_at()
346 r = pread(fd, addr, len, offset); in map_at()
347 if (r != len) in map_at()
348 err(1, "Reading offset %lu len %lu gave %zi", offset, len, r); in map_at()
495 unsigned long len; in load_initrd() local
506 len = page_align(st.st_size); in load_initrd()
507 map_at(ifd, from_guest_phys(mem - len), 0, st.st_size); in load_initrd()
513 verbose("mapped initrd %s size=%lu @ %p\n", name, len, (void*)mem-len); in load_initrd()
516 return len; in load_initrd()
526 unsigned int i, len = 0; in concat() local
530 strcat(dst+len, " "); in concat()
531 len++; in concat()
533 strcpy(dst+len, args[i]); in concat()
534 len += strlen(args[i]); in concat()
537 dst[len] = '\0'; in concat()
720 if (desc[i].len % sizeof(struct vring_desc)) in wait_for_vq_desc()
723 max = desc[i].len / sizeof(struct vring_desc); in wait_for_vq_desc()
724 desc = check_pointer(desc[i].addr, desc[i].len); in wait_for_vq_desc()
730 iov[*out_num + *in_num].iov_len = desc[i].len; in wait_for_vq_desc()
732 = check_pointer(desc[i].addr, desc[i].len); in wait_for_vq_desc()
759 static void add_used(struct virtqueue *vq, unsigned int head, int len) in add_used() argument
769 used->len = len; in add_used()
777 static void add_used_and_trigger(struct virtqueue *vq, unsigned head, int len) in add_used_and_trigger() argument
779 add_used(vq, head, len); in add_used_and_trigger()
798 int len; in console_input() local
809 len = readv(STDIN_FILENO, iov, in_num); in console_input()
810 if (len <= 0) { in console_input()
822 add_used_and_trigger(vq, head, len); in console_input()
832 if (len != 1 || ((char *)iov[0].iov_base)[0] != 3) { in console_input()
863 int len = writev(STDOUT_FILENO, iov, out); in console_output() local
864 if (len <= 0) { in console_output()
865 warn("Write to stdout gave %i (%d)", len, errno); in console_output()
868 iov_consume(iov, out, NULL, len); in console_output()
934 int len; in net_input() local
958 len = readv(net_info->tunfd, iov, in); in net_input()
959 if (len <= 0) in net_input()
966 add_used(vq, head, len); in net_input()
1271 static void set_config(struct device *dev, unsigned len, const void *conf) in set_config() argument
1274 if (device_config(dev) + len > devices.descpage + getpagesize()) in set_config()
1278 memcpy(device_config(dev), conf, len); in set_config()
1279 dev->desc->config_len = len; in set_config()
1282 assert(dev->desc->config_len == len); in set_config()
1572 off64_t len; member
1656 if (ret > 0 && off + ret > vblk->len) { in blk_request()
1658 ftruncate64(vblk->fd, vblk->len); in blk_request()
1713 vblk->len = lseek64(vblk->fd, 0, SEEK_END); in setup_block_file()
1719 conf.capacity = cpu_to_le64(vblk->len / 512); in setup_block_file()
1749 int len; in rng_input() local
1764 len = readv(rng_info->rfd, iov, in_num); in rng_input()
1765 if (len <= 0) in rng_input()
1766 err(1, "Read from /dev/random gave %i", len); in rng_input()
1767 iov_consume(iov, in_num, NULL, len); in rng_input()
1768 totlen += len; in rng_input()