factor common code in virHashAddEntry and virHashUpdateEntry
The only difference between these 2 functions is that one errors out when the entry is already present while the other modifies the existing entry. Add an helper function with a boolean argument indicating whether existing entries should be updated or not, and use this helper in both functions.
Showing
想要评论请 注册 或 登录