/* copy_reserved_iova - copies the reserved between domains @from: - source doamin from where to copy @to: - destination domin where to copy This function copies reserved iova's from one doamin to other.  */
void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to)
/* copy_reserved_iova - copies the reserved between domains @from: - source doamin from where to copy @to: - destination domin where to copy This function copies reserved iova's from one doamin to other.  */
void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to)
{
	unsigned long flags;
	struct rb_node *node;
	spin_lock_irqsave(&from->iova_rbtree_lock, flags);
	for (node = rb_first(&from->rbroot); node; node = rb_next(node)) {
		struct iova *iova = container_of(node, struct iova, node);
		struct iova *new_iova;
		new_iova = reserve_iova(to, iova->pfn_lo, iova->pfn_hi);
		if (!new_iova)
			printk(KERN_ERR "Reserve iova range %lx@%lx failed\n",
				iova->pfn_lo, iova->pfn_lo);
	}
	spin_unlock_irqrestore(&from->iova_rbtree_lock, flags);
}