[libvirt] [PATCH] Fixed dumxml of <iotune> parameters
by Martin Kletzander
The output of dumpxml for <iotune> settings was misformatted, this
patch just adds missing newlines.
---
src/conf/domain_conf.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d474551..f84e76d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10079,12 +10079,12 @@ virDomainDiskDefFormat(virBufferPtr buf,
}
if (def->blkdeviotune.read_iops_sec) {
- virBufferAsprintf(buf, " <read_iops_sec>%llu</read_iops_sec>",
+ virBufferAsprintf(buf, " <read_iops_sec>%llu</read_iops_sec>\n",
def->blkdeviotune.read_iops_sec);
}
if (def->blkdeviotune.write_iops_sec) {
- virBufferAsprintf(buf, " <write_iops_sec>%llu</write_iops_sec>",
+ virBufferAsprintf(buf, " <write_iops_sec>%llu</write_iops_sec>\n",
def->blkdeviotune.write_iops_sec);
}
--
1.7.3.4
12 years, 10 months
[libvirt] [PATCH] Remove dmidecode dependancy outside PC arches
by Daniel Veillard
The new dependancy is only available on ix86, x86_64 and ia64
diff --git a/libvirt.spec.in b/libvirt.spec.in
index d06c067..a5bd173 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -346,8 +346,10 @@ Requires: device-mapper
%if %{with_cgconfig}
Requires: libcgroup
%endif
+%ifarch i386 i586 i686 x86_64 ia64
# For virConnectGetSysinfo
Requires: dmidecode
+%endif
# For service management
%if %{with_systemd}
Requires(post): systemd-units
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
12 years, 10 months
[libvirt] [PATCH v3] Add new attribute wrpolicy to <driver> element
by Deepak C Shetty
This introduces new attribute wrpolicy with only supported
value as immediate. This will be an optional
attribute with no defaults. This helps specify whether
to skip the host page cache.
When wrpolicy is specified, meaning when wrpolicy=immediate
a writeback is explicitly initiated for the dirty pages in
the host page cache as part of the guest file write operation.
Usage:
<filesystem type='mount' accessmode='passthrough'>
<driver type='path' wrpolicy='immediate'/>
<source dir='/export/to/guest'/>
<target dir='mount_tag'/>
</filesystem>
Currently this only works with type='mount' for the QEMU/KVM driver.
Signed-off-by: Deepak C Shetty <deepakcs(a)linux.vnet.ibm.com>
---
v2:
- added writeout as a qemu cap
- cosmetic changes in comments
- moved to using VIR_ERR_CONFIG_UNSUPPORTED
- corrected doc
v3:
- changed attr name from writeout to wrpolicy
- moved attr to be part of driver xml element
docs/formatdomain.html.in | 12 ++++++++++--
docs/schemas/domaincommon.rng | 7 +++++++
src/conf/domain_conf.c | 27 ++++++++++++++++++++++++++-
src/conf/domain_conf.h | 10 ++++++++++
src/qemu/qemu_capabilities.c | 3 +++
src/qemu/qemu_capabilities.h | 5 +++--
src/qemu/qemu_command.c | 14 ++++++++++++++
7 files changed, 73 insertions(+), 5 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 18b7e22..fb2bcbc 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1310,7 +1310,7 @@
<target dir='/'/>
</filesystem>
<filesystem type='mount' accessmode='passthrough'>
- <driver type='path'/>
+ <driver type='path' wrpolicy='immediate'/>
<source dir='/export/to/guest'/>
<target dir='/import/from/host'/>
<readonly/>
@@ -1337,7 +1337,15 @@
sub-element <code>driver</code>, with an
attribute <code>type='path'</code>
or <code>type='handle'</code> <span class="since">(since
- 0.9.7)</span>.
+ 0.9.7). The driver block has an optional attribute
+ <code>wrpolicy</code> with the only supported value
+ as <code>immediate</code>. It helps specify whether to skip
+ the host page cache. When wrpolicy is specified, meaning when
+ wrpolicy=immediate a writeback is explicitly initiated for the
+ dirty pages in the host page cache as part of the guest file
+ write operation. When this attribute is not specified, there
+ are no defaults, meaning explicit writeback won't be initiated
+ </span>.
</dd>
<dt><code>type='template'</code></dt>
<dd>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 353faea..810b634 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1142,6 +1142,13 @@
<value>handle</value>
</choice>
</attribute>
+ <optional>
+ <attribute name="wrpolicy">
+ <choice>
+ <value>immediate</value>
+ </choice>
+ </attribute>
+ </optional>
<empty/>
</element>
</optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 0190a81..98e5866 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -257,6 +257,9 @@ VIR_ENUM_IMPL(virDomainFSAccessMode, VIR_DOMAIN_FS_ACCESSMODE_LAST,
"mapped",
"squash")
+VIR_ENUM_IMPL(virDomainFSWrpolicy, VIR_DOMAIN_FS_WRPOLICY_LAST,
+ "default",
+ "immediate")
VIR_ENUM_IMPL(virDomainNet, VIR_DOMAIN_NET_TYPE_LAST,
"user",
@@ -3468,6 +3471,7 @@ virDomainFSDefParseXML(xmlNodePtr node,
char *source = NULL;
char *target = NULL;
char *accessmode = NULL;
+ char *wrpolicy = NULL;
if (VIR_ALLOC(def) < 0) {
virReportOOMError();
@@ -3517,6 +3521,7 @@ virDomainFSDefParseXML(xmlNodePtr node,
def->readonly = 1;
} else if ((fsdriver == NULL) && (xmlStrEqual(cur->name, BAD_CAST "driver"))) {
fsdriver = virXMLPropString(cur, "type");
+ wrpolicy = virXMLPropString(cur, "wrpolicy");
}
}
cur = cur->next;
@@ -3530,6 +3535,16 @@ virDomainFSDefParseXML(xmlNodePtr node,
}
}
+ if (wrpolicy) {
+ if ((def->wrpolicy = virDomainFSWrpolicyTypeFromString(wrpolicy)) < 0) {
+ virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown filesystem write policy '%s'"), wrpolicy);
+ goto error;
+ }
+ } else {
+ def->wrpolicy = VIR_DOMAIN_FS_WRPOLICY_DEFAULT;
+ }
+
if (source == NULL) {
virDomainReportError(VIR_ERR_NO_SOURCE,
target ? "%s" : NULL, target);
@@ -3556,6 +3571,7 @@ cleanup:
VIR_FREE(target);
VIR_FREE(source);
VIR_FREE(accessmode);
+ VIR_FREE(wrpolicy);
return def;
@@ -10163,6 +10179,7 @@ virDomainFSDefFormat(virBufferPtr buf,
const char *type = virDomainFSTypeToString(def->type);
const char *accessmode = virDomainFSAccessModeTypeToString(def->accessmode);
const char *fsdriver = virDomainFSDriverTypeTypeToString(def->fsdriver);
+ const char *wrpolicy = virDomainFSWrpolicyTypeToString(def->wrpolicy);
if (!type) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
@@ -10182,7 +10199,15 @@ virDomainFSDefFormat(virBufferPtr buf,
type, accessmode);
if (def->fsdriver) {
- virBufferAsprintf(buf, " <driver type='%s'/>\n", fsdriver);
+ virBufferAsprintf(buf, " <driver type='%s'", fsdriver);
+
+ /* Don't generate anything if wrpolicy is set to default */
+ if (def->wrpolicy) {
+ virBufferAsprintf(buf, " wrpolicy='%s'", wrpolicy);
+ }
+
+ virBufferAddLit(buf,"/>\n");
+
}
if (def->src) {
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 03aa5b6..7541fbc 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -479,12 +479,21 @@ enum virDomainFSAccessMode {
VIR_DOMAIN_FS_ACCESSMODE_LAST
};
+/* Filesystem Write policy */
+enum virDomainFSWrpolicy {
+ VIR_DOMAIN_FS_WRPOLICY_DEFAULT = 0,
+ VIR_DOMAIN_FS_WRPOLICY_IMMEDIATE,
+
+ VIR_DOMAIN_FS_WRPOLICY_LAST
+};
+
typedef struct _virDomainFSDef virDomainFSDef;
typedef virDomainFSDef *virDomainFSDefPtr;
struct _virDomainFSDef {
int type;
int fsdriver;
int accessmode;
+ int wrpolicy;
char *src;
char *dst;
unsigned int readonly : 1;
@@ -1974,6 +1983,7 @@ VIR_ENUM_DECL(virDomainControllerModelUSB)
VIR_ENUM_DECL(virDomainFS)
VIR_ENUM_DECL(virDomainFSDriverType)
VIR_ENUM_DECL(virDomainFSAccessMode)
+VIR_ENUM_DECL(virDomainFSWrpolicy)
VIR_ENUM_DECL(virDomainNet)
VIR_ENUM_DECL(virDomainNetBackend)
VIR_ENUM_DECL(virDomainNetVirtioTxMode)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 43c7578..2af16f3 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -144,6 +144,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"ich9-ahci",
"no-acpi",
"fsdev-readonly",
+ "fsdev-writeout",
);
struct qemu_feature_flags {
@@ -1083,6 +1084,8 @@ qemuCapsComputeCmdFlags(const char *help,
qemuCapsSet(flags, QEMU_CAPS_FSDEV);
if (strstr(fsdev, "readonly"))
qemuCapsSet(flags, QEMU_CAPS_FSDEV_READONLY);
+ if (strstr(fsdev, "writeout"))
+ qemuCapsSet(flags, QEMU_CAPS_FSDEV_WRITEOUT);
}
if (strstr(help, "-smbios type"))
qemuCapsSet(flags, QEMU_CAPS_SMBIOS_TYPE);
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index c759baf..5b2f932 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -113,10 +113,11 @@ enum qemuCapsFlags {
QEMU_CAPS_NO_SHUTDOWN = 74, /* usable -no-shutdown */
QEMU_CAPS_DRIVE_CACHE_UNSAFE = 75, /* Is cache=unsafe supported? */
- QEMU_CAPS_PCI_ROMBAR = 76, /* -device rombar=0|1 */
+ QEMU_CAPS_PCI_ROMBAR = 76, /* -device rombar=0|1 */
QEMU_CAPS_ICH9_AHCI = 77, /* -device ich9-ahci */
QEMU_CAPS_NO_ACPI = 78, /* -no-acpi */
- QEMU_CAPS_FSDEV_READONLY =79, /* -fsdev readonly supported */
+ QEMU_CAPS_FSDEV_READONLY = 79, /* -fsdev readonly supported */
+ QEMU_CAPS_FSDEV_WRITEOUT = 80, /* -fsdev writeout supported */
QEMU_CAPS_LAST, /* this must always be the last item */
};
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 73f673f..ba0353e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -108,6 +108,10 @@ VIR_ENUM_IMPL(qemuDomainFSDriver, VIR_DOMAIN_FS_DRIVER_TYPE_LAST,
"local",
"handle");
+VIR_ENUM_DECL(qemuDomainFSWrpolicy)
+VIR_ENUM_IMPL(qemuDomainFSWrpolicy, VIR_DOMAIN_FS_WRPOLICY_LAST,
+ "default",
+ "immediate");
static void
uname_normalize (struct utsname *ut)
@@ -2086,6 +2090,7 @@ char *qemuBuildFSStr(virDomainFSDefPtr fs,
{
virBuffer opt = VIR_BUFFER_INITIALIZER;
const char *driver = qemuDomainFSDriverTypeToString(fs->fsdriver);
+ const char *wrpolicy = qemuDomainFSWrpolicyTypeToString(fs->wrpolicy);
if (fs->type != VIR_DOMAIN_FS_TYPE_MOUNT) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -2119,6 +2124,15 @@ char *qemuBuildFSStr(virDomainFSDefPtr fs,
}
}
+ if (fs->wrpolicy != VIR_DOMAIN_FS_WRPOLICY_DEFAULT) {
+ if (qemuCapsGet(qemuCaps, QEMU_CAPS_FSDEV_WRITEOUT)) {
+ virBufferAsprintf(&opt, ",writeout=%s", wrpolicy);
+ } else {
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("filesystem writeout not supported"));
+ }
+ }
+
virBufferAsprintf(&opt, ",id=%s%s", QEMU_FSDEV_HOST_PREFIX, fs->info.alias);
virBufferAsprintf(&opt, ",path=%s", fs->src);
12 years, 10 months
[libvirt] [PATCH v2 0/6] Enhancements in CPU selection
by Jiri Denemark
The main goal of this series is to provide an easy way to say that a guest CPU
should match host. Details can be found in individual patches.
Jiri Denemark (6):
tests: Print XML file name in verbose CPU test
cpu: Optionally forbid fallback CPU models
Add support for cpu mode attribute
cpu: Update guest CPU in host-* mode
Taint domains configured with cpu mode=host-passthrough
qemu: Add support for host CPU modes
docs/formatdomain.html.in | 63 +++++-
docs/schemas/domaincommon.rng | 37 +++-
src/conf/capabilities.c | 2 +-
src/conf/cpu_conf.c | 264 +++++++++++++++-----
src/conf/cpu_conf.h | 38 +++-
src/conf/domain_conf.c | 5 +-
src/conf/domain_conf.h | 1 +
src/cpu/cpu.c | 2 +-
src/cpu/cpu_x86.c | 47 ++++-
src/libvirt_private.syms | 3 +
src/qemu/qemu_capabilities.c | 6 +-
src/qemu/qemu_capabilities.h | 9 +-
src/qemu/qemu_command.c | 96 +++++---
src/qemu/qemu_domain.c | 15 +-
tests/cputest.c | 22 ++-
tests/cputestdata/x86-baseline-1-result.xml | 4 +-
tests/cputestdata/x86-baseline-2-result.xml | 4 +-
.../cputestdata/x86-baseline-no-vendor-result.xml | 4 +-
.../x86-baseline-some-vendors-result.xml | 4 +-
tests/cputestdata/x86-guest-nofallback.xml | 18 ++
.../cputestdata/x86-host+guest,model486-result.xml | 4 +-
.../x86-host+guest,models,Penryn-result.xml | 4 +-
.../x86-host+guest,models,qemu64-result.xml | 4 +-
tests/cputestdata/x86-host+guest,models-result.xml | 4 +-
tests/cputestdata/x86-host+guest-result.xml | 4 +-
tests/cputestdata/x86-host+guest.xml | 4 +-
...6-host+host+host-model,models,Penryn-result.xml | 19 ++
.../cputestdata/x86-host+host-model-nofallback.xml | 19 ++
tests/cputestdata/x86-host+host-model.xml | 18 ++
tests/cputestdata/x86-host+host-passthrough.xml | 18 ++
tests/cputestdata/x86-host+min.xml | 4 +-
.../cputestdata/x86-host+nehalem-force-result.xml | 4 +-
tests/cputestdata/x86-host+pentium3.xml | 4 +-
.../x86-host+strict-force-extra-result.xml | 4 +-
.../x86-host-better+pentium3,core2duo-result.xml | 4 +-
.../x86-host-better+pentium3,pentium3-result.xml | 4 +-
.../x86-host-better+pentium3-result.xml | 4 +-
tests/cputestdata/x86-host-model-nofallback.xml | 4 +
tests/cputestdata/x86-host-model.xml | 1 +
tests/cputestdata/x86-host-passthrough.xml | 1 +
tests/cputestdata/x86-host-worse+guest-result.xml | 4 +-
tests/qemuhelptest.c | 21 +-
tests/qemuxml2argvdata/qemu-lib.sh | 50 ++++
tests/qemuxml2argvdata/qemu-supported-cpus.sh | 15 ++
tests/qemuxml2argvdata/qemu.sh | 51 +----
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml | 2 +-
.../qemuxml2argv-cpu-exact2-nofallback.args | 4 +
.../qemuxml2argv-cpu-exact2-nofallback.xml | 35 +++
.../qemuxml2argv-cpu-fallback.args | 19 ++
.../qemuxml2argvdata/qemuxml2argv-cpu-fallback.xml | 25 ++
.../qemuxml2argv-cpu-host-model-fallback.args | 19 ++
.../qemuxml2argv-cpu-host-model-fallback.xml | 19 ++
.../qemuxml2argv-cpu-host-model-nofallback.xml | 21 ++
.../qemuxml2argv-cpu-host-model.args | 19 ++
.../qemuxml2argv-cpu-host-model.xml | 19 ++
.../qemuxml2argv-cpu-host-passthrough.args | 19 ++
.../qemuxml2argv-cpu-host-passthrough.xml | 19 ++
.../qemuxml2argv-cpu-nofallback.xml | 25 ++
.../qemuxml2argv-cpu-qemu-host-passthrough.xml | 19 ++
tests/qemuxml2argvtest.c | 91 +++++---
.../qemuxml2xmlout-graphics-spice-timeout.xml | 86 +++++++
tests/qemuxml2xmltest.c | 2 +-
tests/testutilsqemu.c | 2 +
63 files changed, 1112 insertions(+), 250 deletions(-)
create mode 100644 tests/cputestdata/x86-guest-nofallback.xml
create mode 100644 tests/cputestdata/x86-host+host+host-model,models,Penryn-result.xml
create mode 100644 tests/cputestdata/x86-host+host-model-nofallback.xml
create mode 100644 tests/cputestdata/x86-host+host-model.xml
create mode 100644 tests/cputestdata/x86-host+host-passthrough.xml
create mode 100644 tests/cputestdata/x86-host-model-nofallback.xml
create mode 100644 tests/cputestdata/x86-host-model.xml
create mode 100644 tests/cputestdata/x86-host-passthrough.xml
create mode 100644 tests/qemuxml2argvdata/qemu-lib.sh
create mode 100755 tests/qemuxml2argvdata/qemu-supported-cpus.sh
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-nofallback.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-nofallback.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-qemu-host-passthrough.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml
--
1.7.8.3
12 years, 10 months
[libvirt] [RFC PATCH 0/6] New API to normalize the device XML
by Osier Yang
The initial purpose was to fix a regression for detaching device,
(introduced by commit ea7182c29). There was a patch posted to
resolve the problem:
https://www.redhat.com/archives/libvir-list/2011-December/msg00818.html
But as Eric suggested, it's not the ideal way to go, we never known
how many stuffs like <address> will be involved in future. So new API
to invoke the internal parsing functions might be a right way then.
However, things are not that simple (an API without internal driver
support, invoking the parsing functions directly). As the domain conf
is a neccessary argument to parse the device XML. (e.g. for an Input
device). Although we can bypass that by modification on
virDomainDeviceDefParse, it could be trap as we will parse the device
XML in another way which is different with the real parsing. So finally
I choosed to implement the driver support for the new API. There might
be something I didn't take into consideration, (e.g. Do we need some
flags for the XML parsing and formating?). But it can demo the thought
good enough.
On the other hand, I'm wondering if it's deserved to introduce such
an API, comparing it's usage, is it two heavy if we need the internal
drivers support for such an API?
Any thoughts and feedback is welcomed.
[PATCH 1/6] normalize_xml: Define the new API
[PATCH 2/6] normalize_xml: Implement the new API
[PATCH 3/6] normalize_xml: Wire up the remote protocol
[PATCH 4/6] normalize_xml: New internal API to format device XML
[PATCH 5/6] normalize_xml: Implement qemu driver support
[PATCH 6/6] normalize_xml: New virsh command to normalize device XML
Regards,
Osier
12 years, 10 months
[libvirt] [PATCH] Clarify semantics of virDomainMigrate{,ToURI}2
by Jiri Denemark
Commit 5d784bd6d7b19314b0908aec6b46bfe377aeba42 was a nice attempt to
clarify the semantics by requiring domain name from dxml to either match
original name or dname. However, setting dxml domain name to dname
doesn't really work since destination host needs to know the original
domain name to be able to use it in migration cookies. This patch
requires domain name in dxml to match the original domain name. The
change should be safe and backward compatible since migration would fail
just a bit later in the process.
---
src/libvirt.c | 4 ++--
src/qemu/qemu_migration.c | 6 ++----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index a540424..7b8adf7 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -5188,8 +5188,8 @@ error:
* if @dxml would cause any guest-visible changes. Pass NULL
* if no changes are needed to the XML between source and destination.
* @dxml cannot be used to rename the domain during migration (use
- * @dname for that purpose). Domain name in @dxml must either match the
- * original domain name or @dname if it was specified.
+ * @dname for that purpose). Domain name in @dxml must match the
+ * original domain name.
*
* Returns the new domain object if the migration was successful,
* or NULL in case of error. Note that the new domain object
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 92d6008..8453a47 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1046,11 +1046,9 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
- if (STRNEQ(def->name, vm->def->name) &&
- STRNEQ_NULLABLE(def->name, dname)) {
+ if (STRNEQ(def->name, vm->def->name)) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
- _("target domain name doesn't match source name"
- " nor destination name"));
+ _("target domain name doesn't match source name"));
goto cleanup;
}
--
1.7.8.3
12 years, 10 months
[libvirt] [libvirt-glib] Make use of G_PARAM_STATIC_STRINGS everywhere
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
---
libvirt-gobject/libvirt-gobject-connection.c | 28 +++++++++------------
libvirt-gobject/libvirt-gobject-domain-snapshot.c | 4 +--
libvirt-gobject/libvirt-gobject-domain.c | 8 +----
libvirt-gobject/libvirt-gobject-interface.c | 4 +--
libvirt-gobject/libvirt-gobject-network-filter.c | 4 +--
libvirt-gobject/libvirt-gobject-network.c | 4 +--
libvirt-gobject/libvirt-gobject-node-device.c | 4 +--
libvirt-gobject/libvirt-gobject-secret.c | 4 +--
libvirt-gobject/libvirt-gobject-storage-pool.c | 5 +--
libvirt-gobject/libvirt-gobject-storage-vol.c | 4 +--
libvirt-gobject/libvirt-gobject-stream.c | 4 +--
11 files changed, 24 insertions(+), 49 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-connection.c b/libvirt-gobject/libvirt-gobject-connection.c
index f0c9ff6..a90581a 100644
--- a/libvirt-gobject/libvirt-gobject-connection.c
+++ b/libvirt-gobject/libvirt-gobject-connection.c
@@ -163,9 +163,18 @@ static void gvir_connection_class_init(GVirConnectionClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property(object_class,
+ PROP_HANDLE,
+ g_param_spec_boxed("handle",
+ "Handle",
+ "The connection handle",
+ GVIR_TYPE_CONNECTION_HANDLE,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
signals[VIR_CONNECTION_OPENED] = g_signal_new("connection-opened",
G_OBJECT_CLASS_TYPE(object_class),
@@ -205,19 +214,6 @@ static void gvir_connection_class_init(GVirConnectionClass *klass)
1,
GVIR_TYPE_DOMAIN);
- g_object_class_install_property(object_class,
- PROP_HANDLE,
- g_param_spec_boxed("handle",
- "Handle",
- "The connection handle",
- GVIR_TYPE_CONNECTION_HANDLE,
- G_PARAM_READABLE |
- G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
-
g_type_class_add_private(klass, sizeof(GVirConnectionPrivate));
}
diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
index e68321d..950555a 100644
--- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c
+++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
@@ -126,9 +126,7 @@ static void gvir_domain_snapshot_class_init(GVirDomainSnapshotClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(GVirDomainSnapshotPrivate));
}
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index 2974bb8..2bc12d9 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -157,9 +157,7 @@ static void gvir_domain_class_init(GVirDomainClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
PROP_PERSISTENT,
@@ -168,9 +166,7 @@ static void gvir_domain_class_init(GVirDomainClass *klass)
"If domain is persistent",
TRUE,
G_PARAM_READABLE |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
signals[VIR_STARTED] = g_signal_new("started",
G_OBJECT_CLASS_TYPE(object_class),
diff --git a/libvirt-gobject/libvirt-gobject-interface.c b/libvirt-gobject/libvirt-gobject-interface.c
index 7e6e9b0..c9950f7 100644
--- a/libvirt-gobject/libvirt-gobject-interface.c
+++ b/libvirt-gobject/libvirt-gobject-interface.c
@@ -125,9 +125,7 @@ static void gvir_interface_class_init(GVirInterfaceClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(GVirInterfacePrivate));
}
diff --git a/libvirt-gobject/libvirt-gobject-network-filter.c b/libvirt-gobject/libvirt-gobject-network-filter.c
index f0fd024..fe1a042 100644
--- a/libvirt-gobject/libvirt-gobject-network-filter.c
+++ b/libvirt-gobject/libvirt-gobject-network-filter.c
@@ -142,9 +142,7 @@ static void gvir_network_filter_class_init(GVirNetworkFilterClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(GVirNetworkFilterPrivate));
}
diff --git a/libvirt-gobject/libvirt-gobject-network.c b/libvirt-gobject/libvirt-gobject-network.c
index 847c236..75e010d 100644
--- a/libvirt-gobject/libvirt-gobject-network.c
+++ b/libvirt-gobject/libvirt-gobject-network.c
@@ -140,9 +140,7 @@ static void gvir_network_class_init(GVirNetworkClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(GVirNetworkPrivate));
}
diff --git a/libvirt-gobject/libvirt-gobject-node-device.c b/libvirt-gobject/libvirt-gobject-node-device.c
index 59fe84b..f8d536e 100644
--- a/libvirt-gobject/libvirt-gobject-node-device.c
+++ b/libvirt-gobject/libvirt-gobject-node-device.c
@@ -126,9 +126,7 @@ static void gvir_node_device_class_init(GVirNodeDeviceClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(GVirNodeDevicePrivate));
}
diff --git a/libvirt-gobject/libvirt-gobject-secret.c b/libvirt-gobject/libvirt-gobject-secret.c
index 0c81921..bc5ee3b 100644
--- a/libvirt-gobject/libvirt-gobject-secret.c
+++ b/libvirt-gobject/libvirt-gobject-secret.c
@@ -142,9 +142,7 @@ static void gvir_secret_class_init(GVirSecretClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(GVirSecretPrivate));
}
diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c b/libvirt-gobject/libvirt-gobject-storage-pool.c
index 4eb8eec..5bd3f0a 100644
--- a/libvirt-gobject/libvirt-gobject-storage-pool.c
+++ b/libvirt-gobject/libvirt-gobject-storage-pool.c
@@ -152,9 +152,8 @@ static void gvir_storage_pool_class_init(GVirStoragePoolClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
+
g_type_class_add_private(klass, sizeof(GVirStoragePoolPrivate));
}
diff --git a/libvirt-gobject/libvirt-gobject-storage-vol.c b/libvirt-gobject/libvirt-gobject-storage-vol.c
index 4f62732..5b18877 100644
--- a/libvirt-gobject/libvirt-gobject-storage-vol.c
+++ b/libvirt-gobject/libvirt-gobject-storage-vol.c
@@ -126,9 +126,7 @@ static void gvir_storage_vol_class_init(GVirStorageVolClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(GVirStorageVolPrivate));
}
diff --git a/libvirt-gobject/libvirt-gobject-stream.c b/libvirt-gobject/libvirt-gobject-stream.c
index 6b75819..a1039b1 100644
--- a/libvirt-gobject/libvirt-gobject-stream.c
+++ b/libvirt-gobject/libvirt-gobject-stream.c
@@ -247,9 +247,7 @@ static void gvir_stream_class_init(GVirStreamClass *klass)
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB));
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(GVirStreamPrivate));
}
--
1.7.7.5
12 years, 10 months
[libvirt] [PATCH v2] docs: Add missed RNG schema for interface
by Osier Yang
We support <interface> of type "mcast", "server", and "client",
but the RNG schema for them are missed. Attribute "address" is
optional for "server" type. And these 3 types support
<mac address='MAC'/>, too.
---
docs/formatdomain.html.in | 3 +
docs/schemas/domaincommon.rng | 53 ++++++++++++++++++++
.../qemuxml2argvdata/qemuxml2argv-net-client.args | 5 ++
tests/qemuxml2argvdata/qemuxml2argv-net-client.xml | 29 +++++++++++
tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args | 5 ++
tests/qemuxml2argvdata/qemuxml2argv-net-mcast.xml | 29 +++++++++++
.../qemuxml2argvdata/qemuxml2argv-net-server.args | 5 ++
tests/qemuxml2argvdata/qemuxml2argv-net-server.xml | 29 +++++++++++
tests/qemuxml2argvtest.c | 3 +
9 files changed, 161 insertions(+), 0 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-client.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-client.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-mcast.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-server.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-server.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index faf42df..6b06723 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2189,6 +2189,7 @@
<pre>
...
<devices>
+ <mac address='52:54:00:6d:90:01'>
<interface type='mcast'>
<source address='230.0.0.1' port='5558'/>
</interface>
@@ -2210,10 +2211,12 @@
...
<devices>
<interface type='server'>
+ <mac address='52:54:00:22:c9:42'>
<source address='192.168.0.1' port='5558'/>
</interface>
...
<interface type='client'>
+ <mac address='52:54:00:8b:c9:51'>
<source address='192.168.0.1' port='5558'/>
</interface>
</devices>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 6d265f3..7a23525 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1308,6 +1308,59 @@
<ref name="interface-options"/>
</interleave>
</group>
+ <group>
+ <attribute name="type">
+ <choice>
+ <value>mcast</value>
+ <value>client</value>
+ </choice>
+ </attribute>
+ <interleave>
+ <element name="source">
+ <attribute name="address">
+ <ref name="ipv4Addr"/>
+ </attribute>
+ <attribute name="port">
+ <ref name="PortNumber"/>
+ </attribute>
+ <empty/>
+ </element>
+ <optional>
+ <element name="mac">
+ <attribute name="address">
+ <ref name="macAddr"/>
+ </attribute>
+ <empty/>
+ </element>
+ </optional>
+ </interleave>
+ </group>
+ <group>
+ <attribute name="type">
+ <value>server</value>
+ </attribute>
+ <interleave>
+ <element name="source">
+ <optional>
+ <attribute name="address">
+ <ref name="ipv4Addr"/>
+ </attribute>
+ </optional>
+ <attribute name="port">
+ <ref name="PortNumber"/>
+ </attribute>
+ <empty/>
+ </element>
+ <optional>
+ <element name="mac">
+ <attribute name="address">
+ <ref name="macAddr"/>
+ </attribute>
+ <empty/>
+ </element>
+ </optional>
+ </interleave>
+ </group>
</choice>
</element>
</define>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-client.args b/tests/qemuxml2argvdata/qemuxml2argv-net-client.args
new file mode 100644
index 0000000..f8853ac
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-client.args
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,\
+macaddr=52:54:00:8c:b9:05,vlan=0 -net socket,connect=192.168.0.1:5558,vlan=0 \
+-serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-client.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-client.xml
new file mode 100644
index 0000000..b4cca6e
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-client.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <interface type='client'>
+ <mac address='52:54:00:8c:b9:05'/>
+ <source address='192.168.0.1' port='5558'/>
+ </interface>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args b/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args
new file mode 100644
index 0000000..bb4a042
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,\
+macaddr=52:54:00:8c:b9:05,vlan=0 -net socket,mcast=192.0.0.1:5558,vlan=0 \
+-serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.xml
new file mode 100644
index 0000000..a3929a5
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <interface type='mcast'>
+ <mac address='52:54:00:8c:b9:05'/>
+ <source address='192.0.0.1' port='5558'/>
+ </interface>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-server.args b/tests/qemuxml2argvdata/qemuxml2argv-net-server.args
new file mode 100644
index 0000000..1451e32
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-server.args
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,\
+macaddr=52:54:00:8c:b9:05,vlan=0 -net socket,listen=192.168.0.1:5558,vlan=0 \
+-serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-server.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-server.xml
new file mode 100644
index 0000000..eca440d
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-server.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <interface type='server'>
+ <mac address='52:54:00:8c:b9:05'/>
+ <source address='192.168.0.1' port='5558'/>
+ </interface>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 7beaa4b..fd3c9bb 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -519,6 +519,9 @@ mymain(void)
DO_TEST("net-eth", false, NONE);
DO_TEST("net-eth-ifname", false, NONE);
DO_TEST("net-eth-names", false, QEMU_CAPS_NET_NAME);
+ DO_TEST("net-client", false, NONE);
+ DO_TEST("net-server", false, NONE);
+ DO_TEST("net-mcast", false, NONE);
DO_TEST("serial-vc", false, NONE);
DO_TEST("serial-pty", false, NONE);
--
1.7.7.3
12 years, 10 months
[libvirt] [PATCH] virNetServer: Don't fail if we can't initialize avahi
by Guido Günther
since libvird won't start otherwise without avahi running.
Having avahi compiled in shouldn't force us to have avahi running.
---
src/rpc/virnetserver.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index f761e6b..ab6d112 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -695,9 +695,8 @@ void virNetServerRun(virNetServerPtr srv)
virNetServerLock(srv);
#if HAVE_AVAHI
- if (srv->mdns &&
- virNetServerMDNSStart(srv->mdns) < 0)
- goto cleanup;
+ if (srv->mdns)
+ virNetServerMDNSStart(srv->mdns);
#endif
if (srv->autoShutdownTimeout &&
--
1.7.7.3
12 years, 10 months
[libvirt] [PATCH 0/4] add virsh domxml-formats
by Eric Blake
I previously proposed this here:
https://www.redhat.com/archives/libvir-list/2011-December/msg00899.html
although it's been on my wish list a lot longer than that.
Questions: I had the new API take nformats as an int, and return the
number of populated slots; should I switch this to take *nformats as
a pointer (being both input and output) with a return value of 0, so
as to be more consistent with things like virDomainGetMemoryParameters?
I'm not very familiar with writing python bindings, at least not without
the benefit of copy-and-paste, and I didn't see a good example to copy
from. Ultimately, I envision that the python API will be something like
virConnect.domainNativeFormats(self, flags), with a return being
a python list of strings (where the underlying code calls
virConnectDomainNativeFormats twice, once to determine the list
size, and once to determine the list contents), but I'm not sure how
to go about doing that (I don't know if generator.py can do it, or
if it needs an override, or what). So I left the python bindings
undone, and would appreciate if someone else can step in and help.
Eric Blake (4):
native: add virConnectNativeFormats API
native: add virsh command domxml-formats
native: implement rpc handling of new API
native: add driver support
daemon/remote.c | 56 ++++++++++++++++++++++++++++++++++++
include/libvirt/libvirt.h.in | 4 ++
python/generator.py | 3 ++
src/driver.h | 6 ++++
src/esx/esx_driver.c | 20 ++++++++++++-
src/libvirt.c | 59 ++++++++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 5 +++
src/libxl/libxl_driver.c | 22 +++++++++++++-
src/qemu/qemu_driver.c | 17 +++++++++++
src/remote/remote_driver.c | 64 +++++++++++++++++++++++++++++++++++++++++-
src/remote/remote_protocol.x | 17 ++++++++++-
src/remote_protocol-structs | 12 ++++++++
src/xen/xen_driver.c | 27 +++++++++++++++++-
tools/virsh.c | 48 +++++++++++++++++++++++++++++++
tools/virsh.pod | 11 ++++++-
15 files changed, 362 insertions(+), 9 deletions(-)
--
1.7.7.5
12 years, 10 months