The documentation for the restore hook states that returning an empty
XML is equivalent with copying the input. There was a bug in the code
checking the returned string by checking the string instead of the
contents. Use the new helper to check if the string is empty.
(cherry picked from commit
e38677993734e9af3dbd0589e1cecd0b75f7e757)
&xmlout)) < 0)
goto cleanup;
- if (hookret == 0 && xmlout) {
+ if (hookret == 0 && !virStringIsEmpty(xmlout)) {
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
hook_taint = true;
newxml = xmlout;
NULL, xml, &xmlout)) < 0)
goto cleanup;
- if (hookret == 0 && xmlout) {
+ if (hookret == 0 && !virStringIsEmpty(xmlout)) {
virDomainDefPtr tmp;
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);