提交 6c37ee4d 编写于 作者: M Michal Privoznik

qemuProcessStop: Set @def early

The @def variable holds pointer to the domain defintion, but is
set only somewhere in the middle of the function. This is
suboptimal.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 78e90879
......@@ -7331,7 +7331,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
int retries = 0;
qemuDomainObjPrivatePtr priv = vm->privateData;
virErrorPtr orig_err;
virDomainDefPtr def;
virDomainDefPtr def = vm->def;
virNetDevVPortProfilePtr vport = NULL;
size_t i;
char *timestamp;
......@@ -7386,7 +7386,6 @@ void qemuProcessStop(virQEMUDriverPtr driver,
virDomainConfVMNWFilterTeardown(vm);
if (cfg->macFilter) {
def = vm->def;
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr net = def->nets[i];
if (net->ifname == NULL)
......@@ -7483,7 +7482,6 @@ void qemuProcessStop(virQEMUDriverPtr driver,
qemuHostdevReAttachDomainDevices(driver, vm->def);
def = vm->def;
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr net = def->nets[i];
vport = virDomainNetGetActualVirtPortProfile(net);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册