mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemuxml2argvtest: Adapt to ethernet automatic tap creation
After 9c17d665fd the tap device for ethernet network type is
automatically precreated before spawning qemu. Problem is, the
qemuxml2argvtest wasn't updated and thus is failing. Because of
all the APIs that new code is calling, I had to mock a lot. Also,
since the tap FDs are labeled separately from the rest of the
devices/files I had to enable NOP security driver for the test
too.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
@@ -555,6 +555,8 @@ int qemuTestCapsCacheInsert(virQEMUCapsCachePtr cache, const char *binary,
|
||||
|
||||
int qemuTestDriverInit(virQEMUDriver *driver)
|
||||
{
|
||||
virSecurityManagerPtr mgr = NULL;
|
||||
|
||||
memset(driver, 0, sizeof(*driver));
|
||||
|
||||
if (virMutexInit(&driver->lock) < 0)
|
||||
@@ -588,9 +590,16 @@ int qemuTestDriverInit(virQEMUDriver *driver)
|
||||
if (qemuTestCapsCacheInsert(driver->qemuCapsCache, "empty", NULL) < 0)
|
||||
goto error;
|
||||
|
||||
if (!(mgr = virSecurityManagerNew("none", "qemu",
|
||||
VIR_SECURITY_MANAGER_PRIVILEGED)))
|
||||
goto error;
|
||||
if (!(driver->securityManager = virSecurityManagerNewStack(mgr)))
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virObjectUnref(mgr);
|
||||
qemuTestDriverFree(driver);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user