Import a couple of hunks that were missed when importing patches from xe...

...n-api

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>