/* The resulting QEMUIOVector has heap-allocated iovecs and must be cleaned up with qemu_iovec_destroy().  */
static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu, size_t skip, size_t size, bool is_write)
/* The resulting QEMUIOVector has heap-allocated iovecs and must be cleaned up with qemu_iovec_destroy().  */
static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu, size_t skip, size_t size, bool is_write)
{
    QEMUIOVector elem;
    struct iovec *iov;
    unsigned int niov;
    if (is_write) {
        iov = pdu->elem.out_sg;
        niov = pdu->elem.out_num;
    } else {
        iov = pdu->elem.in_sg;
        niov = pdu->elem.in_num;
    }
    qemu_iovec_init_external(&elem, iov, niov);
    qemu_iovec_init(qiov, niov);
    qemu_iovec_concat(qiov, &elem, skip, size);
}