[libvirt] [PATCH] conf: Remove console stream callback only when freeing console helper
by Peter Krempa
Commit ba226d334acbc49f6751b430e0c4e00f69eef6bf tried to fix crash of
the daemon when a domain with a open console was destroyed. The fix was
wrong as it tried to remove the callback also when the stream was
aborted, where at that point the fd stream driver was already freed and
removed.
This patch clears the callbacks with a helper right before the hash is
freed, so that it doesn't interfere with other codepaths where the
stream object is freed.
---
src/conf/virconsole.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/conf/virconsole.c b/src/conf/virconsole.c
index 912aff6..b3f6eb6 100644
--- a/src/conf/virconsole.c
+++ b/src/conf/virconsole.c
@@ -219,9 +219,6 @@ static void virConsoleHashEntryFree(void *data,
const char *pty = name;
virStreamPtr st = data;
- /* remove callback from stream */
- virFDStreamSetInternalCloseCb(st, NULL, NULL, NULL);
-
/* free stream reference */
virStreamFree(st);
@@ -290,6 +287,18 @@ error:
}
/**
+ * Helper to clear stream callbacks when freeing the hash
+ */
+static void virConsoleFreeClearCallbacks(void *payload,
+ const void *name ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
+{
+ virStreamPtr st = payload;
+
+ virFDStreamSetInternalCloseCb(st, NULL, NULL, NULL);
+}
+
+/**
* Free structures for handling open console streams.
*
* @cons Pointer to the private structure.
@@ -300,6 +309,7 @@ void virConsoleFree(virConsolesPtr cons)
return;
virMutexLock(&cons->lock);
+ virHashForEach(cons->hash, virConsoleFreeClearCallbacks, NULL);
virHashFree(cons->hash);
virMutexUnlock(&cons->lock);
virMutexDestroy(&cons->lock);
--
1.7.8.6
12 years, 3 months
[libvirt] [PATCH v1] ESX: Add "Byte" datatype
by Ata E Husain Bohra
Append "Byte" to set of predefined datatype objects.
Signed-off-by: Ata E Husain Bohra <ata.husain(a)hotmail.com>
---
src/esx/esx_vi_generator.py | 1 +
src/esx/esx_vi_types.c | 57 +++++++++++++++++++++++++++++++++++++++++++
src/esx/esx_vi_types.h | 29 ++++++++++++++++++++++
3 files changed, 87 insertions(+)
diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py
index 910478c..af2d57e 100755
--- a/src/esx/esx_vi_generator.py
+++ b/src/esx/esx_vi_generator.py
@@ -1496,6 +1496,7 @@ def open_and_print(filename):
predefined_enums = ["Boolean"]
predefined_objects = ["AnyType",
+ "Byte",
"Int",
"Long",
"String",
diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
index 708aeda..d7bd3b7 100644
--- a/src/esx/esx_vi_types.c
+++ b/src/esx/esx_vi_types.c
@@ -774,6 +774,9 @@ esxVI_Type_ToString(esxVI_Type type)
case esxVI_Type_String:
return "xsd:string";
+ case esxVI_Type_Byte:
+ return "xsd:byte";
+
case esxVI_Type_Short:
return "xsd:short";
@@ -816,6 +819,8 @@ esxVI_Type_FromString(const char *type)
return esxVI_Type_AnyType;
} else if (STREQ(type, "xsd:string")) {
return esxVI_Type_String;
+ } else if (STREQ(type, "xsd:byte")) {
+ return esxVI_Type_Byte;
} else if (STREQ(type, "xsd:short")) {
return esxVI_Type_Short;
} else if (STREQ(type, "xsd:int")) {
@@ -942,6 +947,10 @@ esxVI_AnyType_DeepCopy(esxVI_AnyType **dest, esxVI_AnyType *src)
(*dest)->string = (*dest)->value;
break;
+ case esxVI_Type_Byte:
+ (*dest)->int8 = src->int8;
+ break;
+
case esxVI_Type_Short:
(*dest)->int16 = src->int16;
break;
@@ -1059,6 +1068,10 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
(*anyType)->string = (*anyType)->value;
break;
+ case esxVI_Type_Byte:
+ _DESERIALIZE_NUMBER(Byte, "xsd:byte", int8, INT8_MIN, INT8_MAX);
+ break;
+
case esxVI_Type_Short:
_DESERIALIZE_NUMBER(Short, "xsd:short", int16, INT16_MIN, INT16_MAX);
break;
@@ -1299,6 +1312,50 @@ esxVI_String_DeserializeValue(xmlNodePtr node, char **value)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * XSD: Byte
+ */
+
+/* esxVI_Byte_Alloc */
+ESX_VI__TEMPLATE__ALLOC(Byte)
+
+/* esxVI_Byte_Free */
+ESX_VI__TEMPLATE__FREE(Byte,
+{
+ esxVI_Byte_Free(&item->_next);
+})
+
+/* esxVI_Byte_Validate */
+ESX_VI__TEMPLATE__VALIDATE(Byte,
+{
+})
+
+/* esxVI_Byte_AppendToList */
+ESX_VI__TEMPLATE__LIST__APPEND(Byte)
+
+/* esxVI_Byte_DeepCopy */
+ESX_VI__TEMPLATE__DEEP_COPY(Byte,
+{
+ (*dest)->value = src->value;
+})
+
+/* esxVI_Byte_DeepCopyList */
+ESX_VI__TEMPLATE__LIST__DEEP_COPY(Byte)
+
+/* esxVI_Byte_Serialize */
+ESX_VI__TEMPLATE__SERIALIZE(Byte,
+{
+ virBufferAsprintf(output, "%d", (int8_t)item->value);
+})
+
+/* esxVI_Byte_SerializeList */
+ESX_VI__TEMPLATE__LIST__SERIALIZE(Byte)
+
+/* esxVI_Byte_Deserialize */
+ESX_VI__TEMPLATE__DESERIALIZE_NUMBER(Byte, "xsd:byte", INT8_MIN, INT8_MAX);
+
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* XSD: Int
*/
diff --git a/src/esx/esx_vi_types.h b/src/esx/esx_vi_types.h
index dbcfee0..4df0157 100644
--- a/src/esx/esx_vi_types.h
+++ b/src/esx/esx_vi_types.h
@@ -38,6 +38,7 @@ typedef struct _esxVI_ManagedObject esxVI_ManagedObject;
typedef enum _esxVI_Boolean esxVI_Boolean;
typedef struct _esxVI_AnyType esxVI_AnyType;
typedef struct _esxVI_String esxVI_String;
+typedef struct _esxVI_Byte esxVI_Byte;
typedef struct _esxVI_Int esxVI_Int;
typedef struct _esxVI_Long esxVI_Long;
typedef struct _esxVI_DateTime esxVI_DateTime;
@@ -73,6 +74,7 @@ enum _esxVI_Type {
esxVI_Type_Boolean,
esxVI_Type_AnyType,
esxVI_Type_String,
+ esxVI_Type_Byte,
esxVI_Type_Short,
esxVI_Type_Int,
esxVI_Type_Long,
@@ -146,6 +148,7 @@ struct _esxVI_AnyType {
union {
esxVI_Boolean boolean; /* optional */
char *string; /* optional */
+ int8_t int8; /* optional */
int16_t int16; /* optional */
int32_t int32; /* optional */
int64_t int64; /* optional */
@@ -199,6 +202,32 @@ int esxVI_String_DeserializeValue(xmlNodePtr node, char **value);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * XSD: Byte
+ */
+
+struct _esxVI_Byte {
+ esxVI_Byte *_next; /* optional */
+ esxVI_Type _type; /* required */
+
+ int8_t value; /* required */
+};
+
+int esxVI_Byte_Alloc(esxVI_Byte **number);
+void esxVI_Byte_Free(esxVI_Byte **numberList);
+int esxVI_Byte_Validate(esxVI_Byte *number);
+int esxVI_Byte_AppendToList(esxVI_Byte **numberList, esxVI_Byte *number);
+int esxVI_Byte_DeepCopy(esxVI_Byte **dest, esxVI_Byte *src);
+int esxVI_Byte_DeepCopyList(esxVI_Byte **destList, esxVI_Byte *srcList);
+int esxVI_Byte_Serialize(esxVI_Byte *number, const char *element,
+ virBufferPtr output);
+int esxVI_Byte_SerializeList(esxVI_Byte *numberList, const char *element,
+ virBufferPtr output);
+int esxVI_Byte_Deserialize(xmlNodePtr node, esxVI_Byte **number);
+
+
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* XSD: Int
*/
--
1.7.9.5
12 years, 3 months
[libvirt] [PATCH v10 0/9] Add basic driver for Parallels Cloud Server
by Dmitry Guryanov
Parallels Cloud Server is a virtualization solution
that allows users to simultaneously run multiple virtual
machines and containers on the same physical server.
More information can be found here: http://www.parallels.com/products/pcs/
Also beta version of Parallels Cloud Server can be downloaded there.
Changes in v10:
* Change the FSF address
* Replace format strings without % with ' "%s", string '
Dmitry Guryanov (9):
parallels: add driver skeleton
add function virCommandNewVAList
parallels: add functions to list domains and get info
parallels: implement functions for domain life cycle management
parallels: get info about serial ports
parallels: add support of VNC remote display
parallels: implement virDomainDefineXML operation for existing
domains
parallels: add storage driver
parallels: implement VM creation
configure.ac | 61 +-
docs/drvparallels.html.in | 28 +
include/libvirt/virterror.h | 1 +
libvirt.spec.in | 9 +-
mingw-libvirt.spec.in | 6 +
po/POTFILES.in | 3 +
src/Makefile.am | 15 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/driver.h | 1 +
src/libvirt.c | 9 +
src/parallels/parallels_driver.c | 1735 +++++++++++++++++++++++++++++++++++++
src/parallels/parallels_driver.h | 28 +
src/parallels/parallels_storage.c | 1390 +++++++++++++++++++++++++++++
src/parallels/parallels_utils.c | 149 ++++
src/parallels/parallels_utils.h | 66 ++
src/util/command.c | 22 +
src/util/command.h | 3 +
src/util/virterror.c | 3 +-
19 files changed, 3511 insertions(+), 22 deletions(-)
create mode 100644 docs/drvparallels.html.in
create mode 100644 src/parallels/parallels_driver.c
create mode 100644 src/parallels/parallels_driver.h
create mode 100644 src/parallels/parallels_storage.c
create mode 100644 src/parallels/parallels_utils.c
create mode 100644 src/parallels/parallels_utils.h
12 years, 3 months
[libvirt] [PATCH v2] qemu: Set reasonable RSS limit on domain startup
by Michal Privoznik
If there's a memory leak in qemu or qemu is exploited the host's
system will sooner or later start trashing instead of killing
the bad process. This however has impact on performance and other
guests as well. Therefore we should set a reasonable RSS limit
even when user hasn't set any. It's better to be secure by default.
---
diff to v1:
-the expression for reasonable limit adapted to VRAM + XBZRLE
(libvirt doesn't override migrate_cache_size yet, so the default
64MB should fit, and it did indeed during my testing)
src/qemu/qemu_cgroup.c | 76 +++++++++++++++++++++++++++--------------------
1 files changed, 44 insertions(+), 32 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index dee9de6..b11d28b 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -339,42 +339,54 @@ int qemuSetupCgroup(struct qemud_driver *driver,
}
}
- if (vm->def->mem.hard_limit != 0 ||
- vm->def->mem.soft_limit != 0 ||
- vm->def->mem.swap_hard_limit != 0) {
- if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_MEMORY)) {
- if (vm->def->mem.hard_limit != 0) {
- rc = virCgroupSetMemoryHardLimit(cgroup, vm->def->mem.hard_limit);
- if (rc != 0) {
- virReportSystemError(-rc,
- _("Unable to set memory hard limit for domain %s"),
- vm->def->name);
- goto cleanup;
- }
- }
- if (vm->def->mem.soft_limit != 0) {
- rc = virCgroupSetMemorySoftLimit(cgroup, vm->def->mem.soft_limit);
- if (rc != 0) {
- virReportSystemError(-rc,
- _("Unable to set memory soft limit for domain %s"),
- vm->def->name);
- goto cleanup;
- }
+ if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_MEMORY)) {
+ unsigned long long hard_limit = vm->def->mem.hard_limit;
+
+ if (!hard_limit) {
+ /* If there is no hard_limit set, set a reasonable
+ * one to avoid system trashing caused by exploited qemu.
+ * As 'reasonable limit' has been chosen:
+ * (1 + k) * (domain memory + total video memory) + F
+ * where k = 0.02 and F = 200MB. */
+ hard_limit = vm->def->mem.max_balloon;
+ for (i = 0; i < vm->def->nvideos; i++)
+ hard_limit += vm->def->videos[i]->vram;
+ hard_limit = hard_limit * 1.02 + 204800;
+ }
+
+ rc = virCgroupSetMemoryHardLimit(cgroup, hard_limit);
+ if (rc != 0) {
+ virReportSystemError(-rc,
+ _("Unable to set memory hard limit for domain %s"),
+ vm->def->name);
+ goto cleanup;
+ }
+ if (vm->def->mem.soft_limit != 0) {
+ rc = virCgroupSetMemorySoftLimit(cgroup, vm->def->mem.soft_limit);
+ if (rc != 0) {
+ virReportSystemError(-rc,
+ _("Unable to set memory soft limit for domain %s"),
+ vm->def->name);
+ goto cleanup;
}
+ }
- if (vm->def->mem.swap_hard_limit != 0) {
- rc = virCgroupSetMemSwapHardLimit(cgroup, vm->def->mem.swap_hard_limit);
- if (rc != 0) {
- virReportSystemError(-rc,
- _("Unable to set swap hard limit for domain %s"),
- vm->def->name);
- goto cleanup;
- }
+ if (vm->def->mem.swap_hard_limit != 0) {
+ rc = virCgroupSetMemSwapHardLimit(cgroup, vm->def->mem.swap_hard_limit);
+ if (rc != 0) {
+ virReportSystemError(-rc,
+ _("Unable to set swap hard limit for domain %s"),
+ vm->def->name);
+ goto cleanup;
}
- } else {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Memory cgroup is not available on this host"));
}
+ } else if (vm->def->mem.hard_limit != 0 ||
+ vm->def->mem.soft_limit != 0 ||
+ vm->def->mem.swap_hard_limit != 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Memory cgroup is not available on this host"));
+ } else {
+ VIR_WARN("Could not autoset a RSS limit for domain %s", vm->def->name);
}
if (vm->def->cputune.shares != 0) {
--
1.7.8.6
12 years, 3 months
[libvirt] [glib PATCH V1] Add bindings for virDomainSnapshotCreateFlags
by Jovanka Gulicoska
---
libvirt-gobject/libvirt-gobject-domain.c | 2 +-
libvirt-gobject/libvirt-gobject-domain.h | 25 +++++++++++++++++++++++++
libvirt-gobject/libvirt-gobject.sym | 1 +
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index 31aa61a..8820a54 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -1278,7 +1278,7 @@ GList *gvir_domain_get_devices(GVirDomain *domain,
* gvir_domain_create_snapshot:
* @dom: the domain
* @custom_conf: (allow-none): configuration of snapshot or NULL
- * @flags: the flags
+ * @flags: bitwise-OR of #GVirDomainSnapshotCreateFlags
* @err: (allow-none):Place-holder for error or NULL
*
* Returns: (transfer full): snapshot of domain. The returned object should be
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index d10fa8d..f3a36fc 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -130,6 +130,31 @@ typedef enum {
GVIR_DOMAIN_SHUTDOWN_GUEST_AGENT = VIR_DOMAIN_SHUTDOWN_GUEST_AGENT,
} GVirDomainShutdownFlags;
+/**
+ * GVirDomainSnapshotCreateFlags:
+ * @GVIR_DOMAIN_SNAPSHOT_NONE: No flags
+ * @GVIR_DOMAIN_SNAPSHOT_REDEFINE: Restore or alter metadata
+ * @GVIR_DOMAIN_SNAPSHOT_CURRENT: With redefine, make snapshot current
+ * @GVIR_DOMAIN_SNAPSHOT_NO_METADATA: Make snapshot without remembering it
+ * @GVIR_DOMAIN_SNAPSHOT_HALT: Stop running guest after snapshot
+ * @GVIR_DOMAIN_SNAPSHOT_DISK_ONLY: Disk snapshot, not system checkpoint
+ * @GVIR_DOMAIN_SNAPSHOT_REUSE_EXT: Reuse any existing external files
+ * @GVIR_DOMAIN_SNAPSHOT_QUIESCE: Use guest agent to quiesce all mounter
+ * file systems within the domain
+ * @GVIR_DOMAIN_SNAPSHOT_ATOMIC: Atomically avoid partial changes
+ */
+typedef enum {
+ GVIR_DOMAIN_SNAPSHOT_NONE = 0,
+ GVIR_DOMAIN_SNAPSHOT_REDEFINE = VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE,
+ GVIR_DOMAIN_SNAPSHOT_CURRENT = VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT,
+ GVIR_DOMAIN_SNAPSHOT_NO_METADATA = VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA,
+ GVIR_DOMAIN_SNAPSHOT_HALT = VIR_DOMAIN_SNAPSHOT_CREATE_HALT,
+ GVIR_DOMAIN_SNAPSHOT_DISK_ONLY = VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY,
+ GVIR_DOMAIN_SNAPSHOT_REUSE_EXT = VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT,
+ GVIR_DOMAIN_SNAPSHOT_QUIESCE = VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE,
+ GVIR_DOMAIN_SNAPSHOT_ATOMIC = VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC,
+} GVirDomainSnapshotCreateFlags;
+
typedef struct _GVirDomainInfo GVirDomainInfo;
struct _GVirDomainInfo
{
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 5d15e7a..4e2ef95 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -182,6 +182,7 @@ LIBVIRT_GOBJECT_0.0.9 {
LIBVIRT_GOBJECT_0.1.1 {
global:
gvir_domain_shutdown_flags_get_type;
+ gvir_domain_snapshot_create_flags_get_type;
gvir_domain_xml_flags_get_type;
gvir_domain_create_snapshot;
--
1.7.11.2
12 years, 3 months
[libvirt] [PATCH] build: fix "make rpm"
by Laine Stump
make rpm was failing with the following error:
Entering directory `/home/laine/devel/libvirt/tests'
make[2]: *** No rule to make target `viratomicdata.h',
needed by `distdir'. Stop.
viratomicdata.h is listed in tests/Makefile.am as a dependency of
viratomictest, but doesn't exist, is never referenced, and removing
that dependency permits make rpm to complete successfully.
I'm assuming this was a cut-paste error, or a half-finished idea, but
since I didn't know for sure, I didn't push this patch, even though it
fixes a broken build.
---
tests/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ac26bc5..2fdaace 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -531,7 +531,7 @@ virhashtest_SOURCES = \
virhashtest_LDADD = $(LDADDS)
viratomictest_SOURCES = \
- viratomictest.c viratomicdata.h testutils.h testutils.c
+ viratomictest.c testutils.h testutils.c
viratomictest_LDADD = $(LDADDS)
jsontest_SOURCES = \
--
1.7.11.2
12 years, 3 months
[libvirt] [PATCH] Fix typo s/AM_CLFAGS/AM_CFLAGS/ in sanlock link
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Pushed under trivial rule
---
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index d4c198e..49bcf50 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1455,7 +1455,7 @@ lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES = sanlock.la
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
-sanlock_la_CFLAGS = $(AM_CLFAGS)
+sanlock_la_CFLAGS = $(AM_CFLAGS)
sanlock_la_LDFLAGS = -module -avoid-version
sanlock_la_LIBADD = -lsanlock_client \
../gnulib/lib/libgnu.la
--
1.7.11.2
12 years, 3 months
[libvirt] [PATCH] Export virUUIDIsValid to libvirt internal code
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Pushed under trivial rule
---
src/libvirt_private.syms | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 75997fe..44b6652 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1210,6 +1210,7 @@ virGetHostUUID;
virSetHostUUIDStr;
virUUIDFormat;
virUUIDGenerate;
+virUUIDIsValid;
virUUIDParse;
--
1.7.11.2
12 years, 3 months
[libvirt] [PATCH] virsh: console: Avoid using stream after being freed.
by Peter Krempa
The stream object wasn't freed causing a double free attempt.
---
tools/console.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/console.c b/tools/console.c
index afece27..fee2ce3 100644
--- a/tools/console.c
+++ b/tools/console.c
@@ -101,6 +101,7 @@ virConsoleShutdown(virConsolePtr con)
virStreamEventRemoveCallback(con->st);
virStreamAbort(con->st);
virStreamFree(con->st);
+ con->st = NULL;
}
VIR_FREE(con->streamToTerminal.data);
VIR_FREE(con->terminalToStream.data);
--
1.7.8.6
12 years, 3 months
[libvirt] [PATCH libvirt-glib] gobject: add GVir.DomainShutdownFlags binding
by Marc-André Lureau
---
libvirt-gobject/libvirt-gobject-domain.c | 2 +-
libvirt-gobject/libvirt-gobject-domain.h | 13 +++++++++++++
libvirt-gobject/libvirt-gobject.sym | 1 +
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index ba8e12b..d12ac97 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -509,7 +509,7 @@ gboolean gvir_domain_delete(GVirDomain *dom,
/**
* gvir_domain_shutdown:
* @dom: the domain
- * @flags: the flags
+ * @flags: the %GVirDomainShutdownFlags flags
*/
gboolean gvir_domain_shutdown(GVirDomain *dom,
guint flags G_GNUC_UNUSED,
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index 70e7e37..c61a2f5 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -116,6 +116,19 @@ typedef enum {
GVIR_DOMAIN_XML_UPDATE_CPU = VIR_DOMAIN_XML_UPDATE_CPU,
} GVirDomainXMLFlags;
+/**
+ * GVirDomainShutdownFlags:
+ * @GVIR_DOMAIN_SHUTDOWN_NONE: No flags, hypervisor choice
+ * @GVIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN: Send ACPI event
+ * @GVIR_DOMAIN_SHUTDOWN_GUEST_AGENT: Use guest agent
+ *
+ */
+typedef enum {
+ GVIR_DOMAIN_SHUTDOWN_NONE = 0,
+ GVIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN = VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN,
+ GVIR_DOMAIN_SHUTDOWN_GUEST_AGENT = VIR_DOMAIN_SHUTDOWN_GUEST_AGENT,
+} GVirDomainShutdownFlags;
+
typedef struct _GVirDomainInfo GVirDomainInfo;
struct _GVirDomainInfo
{
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index cc602d3..fe3de97 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -177,6 +177,7 @@ LIBVIRT_GOBJECT_0.0.9 {
LIBVIRT_GOBJECT_0.1.1 {
global:
+ gvir_domain_shutdown_flags_get_type;
gvir_domain_xml_flags_get_type;
} LIBVIRT_GOBJECT_0.0.9;
--
1.7.10.4
12 years, 3 months