From 3bd161f8623c189f867a103b9050dad5ebf50ca7 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 1 Jul 2016 16:07:51 +0200 Subject: [PATCH] openvz: Remove use of virDomainLiveConfigHelperMethod --- src/openvz/openvz_driver.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 48c264b0ba..844193a197 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -2084,7 +2084,7 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, struct openvz_driver *driver = dom->conn->privateData; virDomainDeviceDefPtr dev = NULL; virDomainObjPtr vm = NULL; - virDomainDefPtr vmdef = NULL; + virDomainDefPtr def = NULL; bool persist = false; virCheckFlags(VIR_DOMAIN_DEVICE_MODIFY_LIVE | @@ -2098,22 +2098,17 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, _("no domain with matching uuid")); goto cleanup; } - vmdef = vm->def; - if (virStrToLong_i(vmdef->name, NULL, 10, &veid) < 0) { + if (virStrToLong_i(vm->def->name, NULL, 10, &veid) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not convert domain name to VEID")); goto cleanup; } - if (virDomainLiveConfigHelperMethod(driver->caps, - driver->xmlopt, - vm, - &flags, - &vmdef) < 0) + if (!(def = virDomainObjGetOneDef(vm, flags))) goto cleanup; - dev = virDomainDeviceDefParse(xml, vmdef, driver->caps, driver->xmlopt, + dev = virDomainDeviceDefParse(xml, def, driver->caps, driver->xmlopt, VIR_DOMAIN_DEF_PARSE_INACTIVE); if (!dev) goto cleanup; @@ -2121,7 +2116,7 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, if (flags & VIR_DOMAIN_AFFECT_CONFIG) persist = true; - if (openvzUpdateDevice(vmdef, dev, persist) < 0) + if (openvzUpdateDevice(def, dev, persist) < 0) goto cleanup; ret = 0;