... > + > + if (operation == TEST_DEVICE_DETACH) > + parse_flags |= VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE;
^This should be added by patch 3/5 > + > + if (xml) { > + if (!(dev = virDomainDeviceDefParse(xml, def, > + driver->caps, driver->xmlopt, > + NULL, parse_flags))) > + goto cleanup; > + } else if (alias) { > + if (VIR_ALLOC(dev) < 0 || virDomainDefFindDevice(def, alias, dev, > true) < 0) > + goto cleanup; > + } > + > + switch (operation) { > + case TEST_DEVICE_ATTACH: > + if (testDomainAttachDeviceLiveAndConfig(def, dev) < 0) > + goto cleanup; > + break; > + case TEST_DEVICE_DETACH: > + break; > + case TEST_DEVICE_UPDATE: > + break; > + } > + > + ret = 0; > + cleanup: > + if (xml) > + virDomainDeviceDefFree(dev); > + else > + VIR_FREE(dev); virDomainDeviceDefFree() can handle both cases. Reviewed-by: Erik Skultety <eskul...@redhat.com> -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list