[libvirt] [PATCH 09/17] qemuhotplugtest: Add tests for virtio disk hotplug

Daniel P. Berrange berrange at redhat.com
Tue Aug 20 13:30:17 UTC 2013


On Thu, Aug 01, 2013 at 09:28:18PM +0200, Jiri Denemark wrote:
> diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
> index 4712334..bb047fe 100644
> --- a/tests/qemuhotplugtest.c
> +++ b/tests/qemuhotplugtest.c
> @@ -313,12 +327,22 @@ mymain(void)
>      driver.config = virQEMUDriverConfigNew(false);
>      VIR_FREE(driver.config->spiceListen);
>      VIR_FREE(driver.config->vncListen);
> +    /* some dummy values from 'config file' */
> +    if (VIR_STRDUP_QUIET(driver.config->spicePassword, "123456") < 0)
> +        return EXIT_FAILURE;
>  
>      if (!(driver.domainEventState = virDomainEventStateNew()))
>          return EXIT_FAILURE;
>  
> -    /* some dummy values from 'config file' */
> -    if (VIR_STRDUP_QUIET(driver.config->spicePassword, "123456") < 0)
> +    driver.lockManager = virLockManagerPluginNew("nop", "qemu",
> +                                                 driver.config->configBaseDir,
> +                                                 0);
> +    if (!driver.lockManager)
> +        return EXIT_FAILURE;
> +
> +    if (!(mgr = virSecurityManagerNew(NULL, "qemu", false, false, false)))
> +        return EXIT_FAILURE;

Isn't passing "NULL" here going to cause it to auto-detect the sec
driver, potentially running the real SELinux / AppArmour drivers?

I would have thought  we'd pass 'none' here to explicitly get the
no-op security driver.


Though, in the future we likely want to have a special "test" security
driver, so we can validate that the appropriate driver methods are
being invoked for each hotplug operation. Likewise for the lock manager.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list