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>
This commit is contained in:
Michal Privoznik 2022-11-10 14:24:43 +01:00
parent 059e096435
commit c428bccc3f

View File

@ -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'"),