node_device: remove unnecessary checks in virNodeDeviceDefFormat

virBufferEscapeString already contains the null check.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Boris Fiuczynski 2024-02-22 14:02:00 +01:00 committed by Michal Privoznik
parent c877908e14
commit c65c078655

View File

@ -672,16 +672,14 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def)
virBufferAdjustIndent(&buf, 2);
virBufferEscapeString(&buf, "<name>%s</name>\n", def->name);
virBufferEscapeString(&buf, "<path>%s</path>\n", def->sysfs_path);
if (def->devnode)
virBufferEscapeString(&buf, "<devnode type='dev'>%s</devnode>\n",
def->devnode);
virBufferEscapeString(&buf, "<devnode type='dev'>%s</devnode>\n",
def->devnode);
if (def->devlinks) {
for (i = 0; def->devlinks[i]; i++)
virBufferEscapeString(&buf, "<devnode type='link'>%s</devnode>\n",
def->devlinks[i]);
}
if (def->parent)
virBufferEscapeString(&buf, "<parent>%s</parent>\n", def->parent);
virBufferEscapeString(&buf, "<parent>%s</parent>\n", def->parent);
if (def->driver) {
virBufferAddLit(&buf, "<driver>\n");
virBufferAdjustIndent(&buf, 2);