[libvirt] [PATCH] qemu: Fix crash when updating media with shared device
by Peter Krempa
Mimic the fix done in 02b9097274d1330c2e1dca7f598880e09b5c2aa0 to fix crash by
accessing an already freed structure. Also copy the explaining comment why the
pointer can't be accessed any more.
---
src/qemu/qemu_driver.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 96bf235..552a81b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6073,14 +6073,17 @@ qemuDomainChangeDiskMediaLive(virDomainObjPtr vm,
goto end;
ret = qemuDomainChangeEjectableMedia(driver, vm, disk, orig_disk, force);
+ /* 'disk' must not be accessed now - it has been freed.
+ * 'orig_disk' now points to the new disk, while 'dev_copy'
+ * now points to the old disk */
+
+ /* Need to remove the shared disk entry for the original
+ * disk src if the operation is either ejecting or updating.
+ */
if (ret == 0) {
dev->data.disk = NULL;
- /* Need to remove the shared disk entry for the original
- * disk src if the operation is either ejecting or updating.
- */
- if (orig_disk->src && STRNEQ_NULLABLE(orig_disk->src, disk->src))
- ignore_value(qemuRemoveSharedDisk(driver, dev_copy->data.disk,
- vm->def->name));
+ ignore_value(qemuRemoveSharedDisk(driver, dev_copy->data.disk,
+ vm->def->name));
}
break;
default:
--
1.8.1.5
11 years, 7 months
[libvirt] ANNOUNCE: libvirt 0.10.2.4 maintenance release
by Cole Robinson
libvirt 0.10.2.4 maintenance release is now available. This is
libvirt 0.10.2 with additional bugfixes that have accumulated
upstream since the initial release.
This release can be downloaded at:
http://libvirt.org/sources/stable_updates/libvirt-0.10.2.4.tar.gz
Changes in this version:
* esx: Fix and improve esxListAllDomains function
* Fix parsing of SELinux ranges without a category
* Separate MCS range parsing from MCS range checking
* Fix memory leak on OOM in virSecuritySELinuxMCSFind
* qemu: Set migration FD blocking
* build: further fixes for broken if_bridge.h
* build: work around broken kernel header
* Fix SELinux security label test
* libxl: Fix setting of disk backend
* util: Fix mask for 172.16.0.0 private address range
* conf: don't fail to parse <boot> when parsing a single device
* Support custom 'svirt_tcg_t' context for TCG based guests
* uml: Report error if inotify fails on driver startup (cherry picked
from commit 7b97030ad430eb76fcc333652411208fb702e962)
* daemon: Preface polkit error output with 'polkit:'
* spec: Fix script warning when uninstalling libvirt-client
For info about past maintenance releases, see:
http://wiki.libvirt.org/page/Maintenance_Releases
Thanks,
Cole
11 years, 7 months
[libvirt] [RFC 0/4] target-i386: Add "feature-words" CPU object property
by Eduardo Habkost
As the work to get X86CPU subclasses static properties defined is taking very
long to get reviewed and we risk not getting it finished in 1.5, I am sending
an alternative mechanism to allow libvirt to probe for CPU model information.
It's interesting to note that this alternative solution is actually _easier_ to
use for libvirt, because libvirt logic is already based on CPUID bit values, not
"feature names", so it should be very easy to convert the current libvirt code
that (incorrectly) query the host CPU directly for available features to instead
start QEMU with "-cpu host" and use the "feature-words" array information to
find out which CPU features are supported by the host.
The property will have two main use cases:
- Checking host capabilities, by checking the features of the "host"
CPU model;
- Checking which features are enabled on each CPU model.
This series has two alternative implementations, so both approaches can get
feedback: patch 3 has a non-qapi implementation, that simply builds the list and
sets the struct fields manually. Patch 4 converts that implementation to a qapi-
based implementation.
(BTW, I really missed some documentation on the list-related visitor functions,
when writing this code)
Example output:
$ ./QMP/qmp --path=/tmp/m qom-get --path=/machine/unattached/device[1] --property=feature-words
item[0].cpuid-register: EDX
item[0].cpuid-input-eax: 1
item[0].features: 126614521
item[1].cpuid-register: ECX
item[1].cpuid-input-eax: 1
item[1].features: 2155880449
item[2].cpuid-register: EBX
item[2].cpuid-input-eax: 7
item[2].features: 0
item[2].cpuid-input-ecx: 0
item[3].cpuid-register: EDX
item[3].cpuid-input-eax: 2147483649
item[3].features: 563346425
item[4].cpuid-register: ECX
item[4].cpuid-input-eax: 2147483649
item[4].features: 101
item[5].cpuid-register: EDX
item[5].cpuid-input-eax: 3221225473
item[5].features: 0
item[6].cpuid-register: EAX
item[6].cpuid-input-eax: 1073741825
item[6].features: 0
item[7].cpuid-register: EDX
item[7].cpuid-input-eax: 2147483658
item[7].features: 0
I plan to send another RFC as followup soon, that will add:
* "-cpu force" (or "nofilter", or something else; I haven't decided about the
name, yet) flag, to disable feature filtering based on host capabilities.
* "filtered-features" property, listing which features were filtered out
because of missing host capabilities (to allow libvirt to implement "enforce"
mode in a more reliable way).
Eduardo Habkost (4):
target-i386: Add ECX information to FeatureWordInfo
target-i386: Move feature word array outside get_register_name_32()
target-i386: Add "feature-words" property
target-i386: Use qapi for x86_cpu_get_feature_words()
.gitignore | 2 +
Makefile | 11 +++++
Makefile.objs | 5 +++
cpu-qapi-schema.json | 31 ++++++++++++++
target-i386/Makefile.objs | 1 +
target-i386/cpu-qapi-schema.json | 31 ++++++++++++++
target-i386/cpu.c | 92 +++++++++++++++++++++++++++++++++-------
7 files changed, 158 insertions(+), 15 deletions(-)
create mode 100644 cpu-qapi-schema.json
create mode 100644 target-i386/cpu-qapi-schema.json
--
1.8.1.4
11 years, 7 months
[libvirt] [PATCH] Disable static libraries by default
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Every source file is currently built twice by libtool, once for
the shared library and once for the static library. Static libs
are not commonly packaged by distros and slow down compilation
time by as more than 50% compared to a shared-only build time.
Time for 'make -j 4':
shared only: 2 mins 9 secs
shared + static: 3 mins 26 secs
Time for non-parallel make
shared only: 3 mins 32 secs
shared + static: 5 mins 41 secs
Those few people who really want them, can pass --enable-static
to configure
Disabling them by default requires use of LT_INIT, but for
compat with RHEL5 we can't rely on that. So we conditionally
use LT_INIT, but fallback to AM_PROG_LIBTOOL if not present.
---
configure.ac | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 09e4ad9..0df9e5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,7 +123,11 @@ AC_TYPE_UID_T
dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL)
AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
+m4_ifndef([LT_INIT], [
+ AM_PROG_LIBTOOL
+], [
+ LT_INIT([shared disable-static])
+])
AM_PROG_CC_C_O
AM_PROG_LD
--
1.8.1.4
11 years, 7 months
[libvirt] [PATCH libvirt-glib] Disable static libraries by default
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Every source file is currently built twice by libtool, once for
the shared library and once for the static library. Static libs
are not commonly packaged by distros and slow down compilation
time by as more than 50% compared to a shared-only build time.
Time for non-parallel make
shared only: 52 secs
shared + static: 1 min 26 secs
Those few people who really want them, can pass --enable-static
to configure
Disabling them by default requires use of LT_INIT. We don't need
to support older libtool, so drop use of AM_PROG_LIBTOOL entirely
---
configure.ac | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 96dbf5a..7b5a092 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,8 +34,7 @@ AC_SUBST([LIBVIRT_GLIB_VERSION_NUMBER])
AC_PROG_CC
AM_PROG_CC_C_O
-AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
+LT_INIT([shared disable-static win32-dll])
dnl AC_CONFIG_LIBOBJ_DIR([src])
--
1.8.1.4
11 years, 7 months
[libvirt] [libvirt-glib] build: Replace obsolete macro in configure.ac
by Christophe Fergeau
From: Stefano Facchini <stefano.facchini(a)gmail.com>
Fix the build for newer automake
---
AUTHORS | 1 +
configure.ac | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/AUTHORS b/AUTHORS
index 6cec5d7..db05f64 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -17,5 +17,6 @@ Patches have been received from:
Timo Juhani Lindfors <timo.lindfors(a)iki.fi>
Alexander Larsson <alexl(a)redhat.com>
Claudio Bley <cbley(a)av-test.de>
+ Stefano Facchini <stefano.facchini(a)gmail.com>
... send patches to get your name added ...
diff --git a/configure.ac b/configure.ac
index 96dbf5a..2bf9c1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
AC_INIT(libvirt-glib, 0.1.7)
AC_CONFIG_SRCDIR(libvirt-glib/libvirt-glib-main.c)
AC_CONFIG_AUX_DIR([build-aux])
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
dnl Make automake keep quiet about wildcards & other GNUmake-isms
AM_INIT_AUTOMAKE([-Wno-portability])
--
1.8.1.4
11 years, 7 months
[libvirt] [PATCH] virsh: Call virDomainFree in cmdDomFSTrim
by Michal Privoznik
The virsh domfstrim command was not freeing allocated domain,
leaving leaked references behind.
---
tools/virsh-domain.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 5ddcedc..5fbfeee 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10058,6 +10058,8 @@ cmdDomFSTrim(vshControl *ctl, const vshCmd *cmd)
ret = true;
cleanup:
+ if (dom)
+ virDomainFree(dom);
return ret;
}
--
1.8.1.5
11 years, 7 months
[libvirt] [libvirt-glib] config: Fix 2 leaks in domain memory setters
by Christophe Fergeau
---
libvirt-gconfig/libvirt-gconfig-domain.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c
index be572ab..7ef0be8 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain.c
@@ -414,6 +414,7 @@ void gvir_config_domain_set_memory(GVirConfigDomain *domain, guint64 memory)
gvir_config_object_set_attribute(GVIR_CONFIG_OBJECT(node),
"unit", "KiB",
NULL);
+ g_object_unref(G_OBJECT(node));
g_object_notify(G_OBJECT(domain), "memory");
}
@@ -439,6 +440,7 @@ void gvir_config_domain_set_current_memory(GVirConfigDomain *domain,
gvir_config_object_set_attribute(GVIR_CONFIG_OBJECT(node),
"unit", "KiB",
NULL);
+ g_object_unref(G_OBJECT(node));
g_object_notify(G_OBJECT(domain), "current-memory");
}
--
1.8.1.4
11 years, 7 months
[libvirt] [libvirt-glib 1/4] gconfig: Add GVirConfigStoragePool getters
by Christophe Fergeau
---
libvirt-gconfig/libvirt-gconfig-storage-pool.c | 143 +++++++++++++++++++++++++
libvirt-gconfig/libvirt-gconfig-storage-pool.h | 8 ++
libvirt-gconfig/libvirt-gconfig.sym | 12 +++
3 files changed, 163 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-storage-pool.c b/libvirt-gconfig/libvirt-gconfig-storage-pool.c
index 4ad9fc1..b06c24c 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-pool.c
+++ b/libvirt-gconfig/libvirt-gconfig-storage-pool.c
@@ -74,6 +74,25 @@ GVirConfigStoragePool *gvir_config_storage_pool_new_from_xml(const gchar *xml,
return GVIR_CONFIG_STORAGE_POOL(object);
}
+/**
+ * gvir_config_storage_pool_get_pool_type:
+ * @pool: a #GVirConfigStoragePool
+ *
+ * Gets the type of the pool.
+ *
+ * Returns: #Gname of @pool.
+ */
+GVirConfigStoragePoolType gvir_config_storage_pool_get_pool_type(GVirConfigStoragePool *pool)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_STORAGE_POOL(pool),
+ GVIR_CONFIG_STORAGE_POOL_TYPE_DIR);
+
+ return gvir_config_object_get_attribute_genum(GVIR_CONFIG_OBJECT(pool),
+ NULL, "type",
+ GVIR_CONFIG_TYPE_STORAGE_POOL_TYPE,
+ GVIR_CONFIG_STORAGE_POOL_TYPE_DIR);
+}
+
void gvir_config_storage_pool_set_pool_type(GVirConfigStoragePool *pool,
GVirConfigStoragePoolType type)
{
@@ -87,6 +106,22 @@ void gvir_config_storage_pool_set_pool_type(GVirConfigStoragePool *pool,
}
/**
+ * gvir_config_storage_pool_get_name:
+ * @pool: a #GVirConfigStoragePool
+ *
+ * Gets the name of the pool.
+ *
+ * Returns: name of @pool.
+ */
+const char *gvir_config_storage_pool_get_name(GVirConfigStoragePool *pool)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_STORAGE_POOL(pool), NULL);
+
+ return gvir_config_object_get_node_content(GVIR_CONFIG_OBJECT(pool),
+ "name");
+}
+
+/**
* gvir_config_storage_pool_set_name:
* @name: (allow-none):
*/
@@ -100,6 +135,22 @@ void gvir_config_storage_pool_set_name(GVirConfigStoragePool *pool,
}
/**
+ * gvir_config_storage_pool_get_uuid:
+ * @pool: a #GVirConfigStoragePool
+ *
+ * Gets the unique identifier for @pool.
+ *
+ * Returns: unique identifier for @pool.
+ */
+const char *gvir_config_storage_pool_get_uuid(GVirConfigStoragePool *pool)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_STORAGE_POOL(pool), NULL);
+
+ return gvir_config_object_get_node_content(GVIR_CONFIG_OBJECT(pool),
+ "uuid");
+}
+
+/**
* gvir_config_storage_pool_set_uuid:
* @uuid: (allow-none):
*/
@@ -112,6 +163,22 @@ void gvir_config_storage_pool_set_uuid(GVirConfigStoragePool *pool,
"uuid", uuid);
}
+/**
+ * gvir_config_storage_pool_get_capacity:
+ * @pool: a #GVirConfigStoragePool
+ *
+ * Gets the total storage capacity for the pool.
+ *
+ * Returns: total storage capacity in bytes.
+ */
+guint64 gvir_config_storage_pool_get_capacity(GVirConfigStoragePool *pool)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_STORAGE_POOL(pool), 0);
+
+ return gvir_config_object_get_node_content_uint64(GVIR_CONFIG_OBJECT(pool),
+ "capacity");
+}
+
void gvir_config_storage_pool_set_capacity(GVirConfigStoragePool *pool,
guint64 capacity)
{
@@ -121,6 +188,22 @@ void gvir_config_storage_pool_set_capacity(GVirConfigStoragePool *pool,
"capacity", capacity);
}
+/**
+ * gvir_config_storage_pool_get_allocation:
+ * @pool: a #GVirConfigStoragePool
+ *
+ * Gets the total storage allocation for the pool.
+ *
+ * Returns: total storage allocation in bytes.
+ */
+guint64 gvir_config_storage_pool_get_allocation(GVirConfigStoragePool *pool)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_STORAGE_POOL(pool), 0);
+
+ return gvir_config_object_get_node_content_uint64(GVIR_CONFIG_OBJECT(pool),
+ "allocation");
+}
+
void gvir_config_storage_pool_set_allocation(GVirConfigStoragePool *pool,
guint64 allocation)
{
@@ -130,6 +213,22 @@ void gvir_config_storage_pool_set_allocation(GVirConfigStoragePool *pool,
"allocation", allocation);
}
+/**
+ * gvir_config_storage_pool_get_available:
+ * @pool: a #GVirConfigStoragePool
+ *
+ * Gets the free space available for allocating new volumes in the pool.
+ *
+ * Returns: free space available in bytes.
+ */
+guint64 gvir_config_storage_pool_get_available(GVirConfigStoragePool *pool)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_STORAGE_POOL(pool), 0);
+
+ return gvir_config_object_get_node_content_uint64(GVIR_CONFIG_OBJECT(pool),
+ "available");
+}
+
void gvir_config_storage_pool_set_available(GVirConfigStoragePool *pool,
guint64 available)
{
@@ -140,6 +239,28 @@ void gvir_config_storage_pool_set_available(GVirConfigStoragePool *pool,
}
/**
+ * gvir_config_storage_pool_get_source:
+ * @pool: a #GVirConfigStoragePool
+ *
+ * Gets the source for @pool
+ *
+ * Returns: (transfer full): a new #GVirConfigStoragePoolSource instance.
+ */
+GVirConfigStoragePoolSource *gvir_config_storage_pool_get_source(GVirConfigStoragePool *pool)
+{
+ GVirConfigObject *object;
+
+ g_return_val_if_fail(GVIR_CONFIG_IS_STORAGE_POOL(pool), NULL);
+
+ object = gvir_config_object_get_child_with_type
+ (GVIR_CONFIG_OBJECT(pool),
+ "source",
+ GVIR_CONFIG_TYPE_STORAGE_POOL_SOURCE);
+
+ return GVIR_CONFIG_STORAGE_POOL_SOURCE(object);
+}
+
+/**
* gvir_config_storage_pool_set_source:
* @source: (allow-none):
*/
@@ -156,6 +277,28 @@ void gvir_config_storage_pool_set_source(GVirConfigStoragePool *pool,
}
/**
+ * gvir_config_storage_pool_get_target:
+ * @pool: a #GVirConfigStoragePool
+ *
+ * Gets the target for @pool
+ *
+ * Returns: (transfer full): a new #GVirConfigStoragePoolTarget instance.
+ */
+GVirConfigStoragePoolTarget *gvir_config_storage_pool_get_target(GVirConfigStoragePool *pool)
+{
+ GVirConfigObject *object;
+
+ g_return_val_if_fail(GVIR_CONFIG_IS_STORAGE_POOL(pool), NULL);
+
+ object = gvir_config_object_get_child_with_type
+ (GVIR_CONFIG_OBJECT(pool),
+ "target",
+ GVIR_CONFIG_TYPE_STORAGE_POOL_TARGET);
+
+ return GVIR_CONFIG_STORAGE_POOL_TARGET(object);
+}
+
+/**
* gvir_config_storage_pool_set_target:
* @target: (allow-none):
*/
diff --git a/libvirt-gconfig/libvirt-gconfig-storage-pool.h b/libvirt-gconfig/libvirt-gconfig-storage-pool.h
index 9005482..ac4141e 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-pool.h
+++ b/libvirt-gconfig/libvirt-gconfig-storage-pool.h
@@ -76,20 +76,28 @@ GVirConfigStoragePool *gvir_config_storage_pool_new(void);
GVirConfigStoragePool *gvir_config_storage_pool_new_from_xml(const gchar *xml,
GError **error);
+guint64 gvir_config_storage_pool_get_allocation(GVirConfigStoragePool *pool);
void gvir_config_storage_pool_set_allocation(GVirConfigStoragePool *pool,
guint64 allocation);
+guint64 gvir_config_storage_pool_get_available(GVirConfigStoragePool *pool);
void gvir_config_storage_pool_set_available(GVirConfigStoragePool *pool,
guint64 available);
+guint64 gvir_config_storage_pool_get_capacity(GVirConfigStoragePool *pool);
void gvir_config_storage_pool_set_capacity(GVirConfigStoragePool *pool,
guint64 capacity);
+const char *gvir_config_storage_pool_get_name(GVirConfigStoragePool *pool);
void gvir_config_storage_pool_set_name(GVirConfigStoragePool *pool,
const char *name);
+GVirConfigStoragePoolType gvir_config_storage_pool_get_pool_type(GVirConfigStoragePool *pool);
void gvir_config_storage_pool_set_pool_type(GVirConfigStoragePool *pool,
GVirConfigStoragePoolType type);
+GVirConfigStoragePoolSource *gvir_config_storage_pool_get_source(GVirConfigStoragePool *pool);
void gvir_config_storage_pool_set_source(GVirConfigStoragePool *pool,
GVirConfigStoragePoolSource *source);
+GVirConfigStoragePoolTarget *gvir_config_storage_pool_get_target(GVirConfigStoragePool *pool);
void gvir_config_storage_pool_set_target(GVirConfigStoragePool *pool,
GVirConfigStoragePoolTarget *target);
+const char *gvir_config_storage_pool_get_uuid(GVirConfigStoragePool *pool);
void gvir_config_storage_pool_set_uuid(GVirConfigStoragePool *pool,
const char *uuid);
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index a1b2cc1..93b2e33 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -512,4 +512,16 @@ LIBVIRT_GCONFIG_0.1.6 {
gvir_config_domain_graphics_spice_image_compression_get_type;
} LIBVIRT_GCONFIG_0.1.5;
+LIBVIRT_GCONFIG_0.1.7 {
+ global:
+ gvir_config_storage_pool_get_allocation;
+ gvir_config_storage_pool_get_available;
+ gvir_config_storage_pool_get_capacity;
+ gvir_config_storage_pool_get_name;
+ gvir_config_storage_pool_get_pool_type;
+ gvir_config_storage_pool_get_source;
+ gvir_config_storage_pool_get_target;
+ gvir_config_storage_pool_get_uuid;
+} LIBVIRT_GCONFIG_0.1.6;
+
# .... define new API here using predicted next version number ....
--
1.8.1.4
11 years, 7 months
[libvirt] [libvirt-glib] gconfig: Add calls to [gs]et_virt_type to domain tests
by Christophe Fergeau
Setting GVirConfigDomain::virt_type is required for a working
domain configuration, using it in the test programs will be helpful
if people are using this as a base when starting to use libvirt-gconfig
---
examples/config-demo.py | 1 +
libvirt-gconfig/tests/test-domain-create.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/examples/config-demo.py b/examples/config-demo.py
index 508bbc5..268c439 100644
--- a/examples/config-demo.py
+++ b/examples/config-demo.py
@@ -3,6 +3,7 @@
from gi.repository import LibvirtGConfig;
domain = LibvirtGConfig.Domain.new()
+domain.set_virt_type(LibvirtGConfig.DomainVirtType.KVM)
domain.set_name("foo")
domain.set_memory(1024*1024) # 1 GB
domain.set_vcpus(2)
diff --git a/libvirt-gconfig/tests/test-domain-create.c b/libvirt-gconfig/tests/test-domain-create.c
index 20fedc5..e30f643 100644
--- a/libvirt-gconfig/tests/test-domain-create.c
+++ b/libvirt-gconfig/tests/test-domain-create.c
@@ -111,6 +111,9 @@ int main(int argc, char **argv)
domain = gvir_config_domain_new();
g_assert(domain != NULL);
+
+ gvir_config_domain_set_virt_type(domain, GVIR_CONFIG_DOMAIN_VIRT_KVM);
+ g_assert(gvir_config_domain_get_virt_type(domain) == GVIR_CONFIG_DOMAIN_VIRT_KVM);
gvir_config_domain_set_name(domain, "foo");
g_str_const_check(gvir_config_domain_get_name(domain), "foo");
--
1.8.1.4
11 years, 7 months