]> xenbits.xensource.com Git - libvirt.git/commit
conf: node_device: Refactor 'virNodeDeviceCapVPDParseCustomFields' to fix error reporting
authorPeter Krempa <pkrempa@redhat.com>
Mon, 29 Jan 2024 17:26:29 +0000 (18:26 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 31 Jan 2024 16:24:07 +0000 (17:24 +0100)
commitea8d864d9ecf3ee72910ccc1497244f1ef74e948
treecba032635429d0ef8c8b82ebbed6ccece9e2a7a1
parentdd328cd48a469d81e91eaf56fad832aa8bd288d6
conf: node_device: Refactor 'virNodeDeviceCapVPDParseCustomFields' to fix error reporting

The errors raised in virNodeDeviceCapVPDParseCustomFields were actually
ignored by continuing the parse rather than raised.

Rather than just replace 'continue' by 'return -1' this patch refactors
the whole parser to simplify it as well as report reasonable errors.

Parsing of individual fields is done without XPath and is extracted into
a common helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/node_device_conf.c