47 lines
1.9 KiB
Diff
47 lines
1.9 KiB
Diff
|
From 42df6cc1b4acc40d05ff6bc8e85587e4faec6cac Mon Sep 17 00:00:00 2001
|
||
|
From: Peter Krempa <pkrempa@redhat.com>
|
||
|
Date: Wed, 24 Jan 2024 15:24:27 +0100
|
||
|
Subject: [PATCH] virPCIVPDResourceIsValidTextValue: Adjust comment to reflect
|
||
|
actual code
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
The function does not reject '&', '<', '>' contrary to what it actually
|
||
|
states. Move and adjust the comment.
|
||
|
|
||
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||
|
---
|
||
|
src/util/virpcivpd.c | 12 ++++--------
|
||
|
1 file changed, 4 insertions(+), 8 deletions(-)
|
||
|
|
||
|
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||
|
index 39557c73479..248a9b2790e 100644
|
||
|
--- a/src/util/virpcivpd.c
|
||
|
+++ b/src/util/virpcivpd.c
|
||
|
@@ -167,19 +167,15 @@ virPCIVPDResourceGetFieldValueFormat(const char *keyword)
|
||
|
* value or text field value. The expectations are based on the keywords specified
|
||
|
* in relevant sections of PCI(e) specifications
|
||
|
* ("I.3. VPD Definitions" in PCI specs, "6.28.1 VPD Format" PCIe 4.0).
|
||
|
+ *
|
||
|
+ * The PCI(e) specs mention alphanumeric characters when talking about text fields
|
||
|
+ * and the string resource but also include spaces and dashes in the provided example.
|
||
|
+ * Dots, commas, equal signs have also been observed in values used by major device vendors.
|
||
|
*/
|
||
|
bool
|
||
|
virPCIVPDResourceIsValidTextValue(const char *value)
|
||
|
{
|
||
|
size_t i = 0;
|
||
|
- /*
|
||
|
- * The PCI(e) specs mention alphanumeric characters when talking about text fields
|
||
|
- * and the string resource but also include spaces and dashes in the provided example.
|
||
|
- * Dots, commas, equal signs have also been observed in values used by major device vendors.
|
||
|
- * The specs do not specify a full set of allowed code points and for Libvirt it is important
|
||
|
- * to keep values in the ranges allowed within XML elements (mainly excluding less-than,
|
||
|
- * greater-than and ampersand).
|
||
|
- */
|
||
|
|
||
|
if (value == NULL)
|
||
|
return false;
|