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.
&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);