summaryrefslogtreecommitdiff
path: root/src/vmx
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2022-11-10 14:24:43 +0100
committerMichal Privoznik <mprivozn@redhat.com>2022-11-16 12:15:08 +0100
commitc428bccc3fc27379c438697a478171f492466220 (patch)
treeb282cc31a3f857c7472008a3977bebade03418fd /src/vmx
parent059e096435db1297e70e1df4d6f396583e93f4be (diff)
downloadlibvirt-c428bccc3fc27379c438697a478171f492466220.tar.gz
vmx: Convert virVMXConfigScanResultsCollector() to use STRCASESKIP()
Now that we have STRCASESKIP() there's no need to open code it. Convert virVMXConfigScanResultsCollector() so that it uses this new macro. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Diffstat (limited to 'src/vmx')
-rw-r--r--src/vmx/vmx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index bf0dba17d8..d3e452e3ef 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -1321,12 +1321,13 @@ virVMXConfigScanResultsCollector(const char* name,
void *opaque)
{
struct virVMXConfigScanResults *results = opaque;
+ const char *suffix = NULL;
- if (STRCASEPREFIX(name, "ethernet")) {
+ if ((suffix = STRCASESKIP(name, "ethernet"))) {
unsigned int idx;
char *p;
- if (virStrToLong_uip(name + 8, &p, 10, &idx) < 0 ||
+ if (virStrToLong_uip(suffix, &p, 10, &idx) < 0 ||
*p != '.') {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse the index of the VMX key '%s'"),