diff options
author | Dmitry Guryanov <dguryanov@parallels.com> | 2012-09-10 19:22:42 +0400 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2012-09-13 21:19:57 +0800 |
commit | fb583a8f5b7624de12cd45f5f8e953458d512f44 (patch) | |
tree | 81d480bd630a04222537d22aefcf582ce74c3bb9 /src/parallels | |
parent | Fix data types used for list sizes in QEMU capabilities (diff) | |
download | libvirt-fb583a8f5b7624de12cd45f5f8e953458d512f44.tar.gz libvirt-fb583a8f5b7624de12cd45f5f8e953458d512f44.tar.bz2 libvirt-fb583a8f5b7624de12cd45f5f8e953458d512f44.zip |
parallels: add support of containers to the driver
This patch makes parallelsLoadDomains to be able to load information
about containers. So functions, which return different information
and change state will work.
parallelsDomainDefineXML will be fixed in separate patch.
Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
Diffstat (limited to 'src/parallels')
-rw-r--r-- | src/parallels/parallels_driver.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index 2d6883f78..0538a1efb 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -130,6 +130,15 @@ parallelsBuildCapabilities(void) "parallels", NULL, NULL, 0, NULL) == NULL) goto no_memory; + if ((guest = virCapabilitiesAddGuest(caps, "exe", PARALLELS_DEFAULT_ARCH, + 64, "parallels", + NULL, 0, NULL)) == NULL) + goto no_memory; + + if (virCapabilitiesAddGuestDomain(guest, + "parallels", NULL, NULL, 0, NULL) == NULL) + goto no_memory; + caps->defaultConsoleTargetType = parallelsDefaultConsoleType; return caps; @@ -490,8 +499,20 @@ parallelsLoadDomain(parallelsConnPtr privconn, virJSONValuePtr jobj) def->mem.max_balloon <<= 10; def->mem.cur_balloon = def->mem.max_balloon; - if (!(def->os.type = strdup("hvm"))) - goto no_memory; + if (!(tmp = virJSONValueObjectGetString(jobj, "Type"))) { + parallelsParseError(); + goto cleanup; + } + + if (STREQ(tmp, "CT")) { + if (!(def->os.type = strdup("exe"))) + goto no_memory; + if (!(def->os.init = strdup("/sbin/init"))) + goto no_memory; + } else if (STREQ(tmp, "VM")) { + if (!(def->os.type = strdup("hvm"))) + goto no_memory; + } if (!(def->os.arch = strdup(PARALLELS_DEFAULT_ARCH))) goto no_memory; @@ -577,7 +598,7 @@ parallelsLoadDomains(parallelsConnPtr privconn, const char *domain_name) int ret = -1; jobj = parallelsParseOutput(PRLCTL, "list", "-j", "-a", "-i", "-H", - "--vmtype", "vm", domain_name, NULL); + "--vmtype", "all", domain_name, NULL); if (!jobj) { parallelsParseError(); goto cleanup; |