From: Peter Krempa Date: Tue, 7 Jul 2020 14:52:50 +0000 (+0200) Subject: virDomainBackupDiskDefFormat: Format internal disk state only when valid X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1a7ce56ae12c71f4a28fb9578240630dc9afee49;p=libvirt.git virDomainBackupDiskDefFormat: Format internal disk state only when valid Format the disk state only when it isn't _NONE. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index 781dd53f6b..5e4144d371 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -370,7 +370,7 @@ virDomainBackupDiskDefFormat(virBufferPtr buf, virBufferEscapeString(&attrBuf, " name='%s'", disk->name); virBufferAsprintf(&attrBuf, " backup='%s'", virTristateBoolTypeToString(disk->backup)); - if (internal) + if (internal && disk->state != VIR_DOMAIN_BACKUP_DISK_STATE_NONE) virBufferAsprintf(&attrBuf, " state='%s'", virDomainBackupDiskStateTypeToString(disk->state)); if (disk->backup == VIR_TRISTATE_BOOL_YES) {