diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2012-08-20 17:44:14 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2012-09-13 12:24:12 +0100 |
commit | beac09fd68ed259ab8d669d218c348a0788f806f (patch) | |
tree | 65049de5445922121a509453bf35666fe3b6761b /tests/qemuhelptest.c | |
parent | Allow caps to be NULL when creating virDomainObjPtr instances (diff) | |
download | libvirt-beac09fd68ed259ab8d669d218c348a0788f806f.tar.gz libvirt-beac09fd68ed259ab8d669d218c348a0788f806f.tar.bz2 libvirt-beac09fd68ed259ab8d669d218c348a0788f806f.zip |
Turn QEMU capabilities object into a full virObjectPtr
The current qemu capabilities are stored in a virBitmapPtr
object, whose type is exposed to callers. We want to store
more data besides just the flags, so we need to move to a
struct type. This object will also need to be reference
counted, since we'll be maintaining a cache of data per
binary. This change introduces a 'qemuCapsPtr' virObject
class. Most of the change is just renaming types and
variables in all the callers
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'tests/qemuhelptest.c')
-rw-r--r-- | tests/qemuhelptest.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 0d884f4d0..748c43fb4 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -11,14 +11,14 @@ struct testInfo { const char *name; - virBitmapPtr flags; + qemuCapsPtr flags; unsigned int version; unsigned int is_kvm; unsigned int kvm_version; }; -static void printMismatchedFlags(virBitmapPtr got, - virBitmapPtr expect) +static void printMismatchedFlags(qemuCapsPtr got, + qemuCapsPtr expect) { int i; @@ -38,7 +38,7 @@ static int testHelpStrParsing(const void *data) char *path = NULL; char *help = NULL; unsigned int version, is_kvm, kvm_version; - virBitmapPtr flags = NULL; + qemuCapsPtr flags = NULL; int ret = -1; char *got = NULL; char *expected = NULL; @@ -75,8 +75,8 @@ static int testHelpStrParsing(const void *data) goto cleanup; } - got = virBitmapString(flags); - expected = virBitmapString(info->flags); + got = qemuCapsFlagsString(flags); + expected = qemuCapsFlagsString(info->flags); if (!got || !expected) goto cleanup; @@ -116,7 +116,7 @@ static int testHelpStrParsing(const void *data) cleanup: VIR_FREE(path); VIR_FREE(help); - qemuCapsFree(flags); + virObjectUnref(flags); VIR_FREE(got); VIR_FREE(expected); return ret; @@ -138,7 +138,7 @@ mymain(void) if (virtTestRun("QEMU Help String Parsing " name, \ 1, testHelpStrParsing, &info) < 0) \ ret = -1; \ - qemuCapsFree(info.flags); \ + virObjectUnref(info.flags); \ } while (0) DO_TEST("qemu-0.9.1", 9001, 0, 0, |