[libvirt] [PATCHv6 0/5] Introduce API to query IP addresses for given domain
by Nehal J Wani
This feature has been requested for a very long time. Since qemu guest
agent gives us reliable results, now the wait is over.
The RFC was first proposed by Michal Privoznik:
http://www.redhat.com/archives/libvir-list/2012-February/msg00437.html
A patch was submitted, using structs:
https://www.redhat.com/archives/libvir-list/2012-June/msg00220.html
Another patch was submitted, using XML:
https://www.redhat.com/archives/libvir-list/2012-June/msg00904.html
Neither of the patches were accepted, probably due to lack of extensibility
and usability. Hence, we thought of using virTypedParameters for reporting
list of interfaces along with their MAC address and IP addresses. The RFC
can be found here:
https://www.redhat.com/archives/libvir-list/2013-July/msg00084.html
The idea of extensibility was rejected and rendered out of scope of
libvirt. Hence, we were back to structs.
This API is called virDomainInterfaceAddresses which returns a dynamically
allocated array of virDomainInterface struct. The great disadvantage is
once this gets released, it's written in stone and we cannot change
or add an item into it.
The API supports two methods:
* Return information (list of all associated interfaces with MAC address
and IP addresses) of all of the domain interfaces by default (if
no interface name is provided)
* Return information for the specified interface (if an interface name
is provided)
v6:
* Inclusion of flags, readonly check for guest agent connection
* Correction of memory leaks, other small nits.
v5:
* s/virDomainInterfacesAddresses/virDomainInterfaceAddresses.
* Case for IP aliasing handled using virHashTable.
* New test cases added, involving multiple and 0 IP addresse(s)
per interface.
* IP prefix changed from int to unsigned int.
* Changes to practice libvirt habits.
* https://www.redhat.com/archives/libvir-list/2013-September/msg00003.html
v4:
* Various style nits, indentation errors, memory leaks fixed.
* https://www.redhat.com/archives/libvir-list/2013-August/msg01265.html
v3:
* Upper bounds to number of interfaces and addresses per interface
introduced.
* Change from array of structs to array of pointers
* ifaces_count moved from function argument to return value
* Changes in variable names
* Test cases added for qemuAgentGetInterfaces.
* https://www.redhat.com/archives/libvir-list/2013-August/msg01215.html
v2:
* Logical errors, memory leaks and few other errors fixed.
* https://www.redhat.com/archives/libvir-list/2013-August/msg00631.html
v1:
* http://www.redhat.com/archives/libvir-list/2013-July/msg01553.html
Nehal J Wani (5):
domifaddr: Implement the public APIs
domifaddr: Implement the remote protocol
domifaddr: Implement the API for qemu
domifaddr: Add virsh support
domifaddr: Expose python binding
daemon/remote.c | 130 ++++++++++++++++++++++++++
examples/python/Makefile.am | 2 +-
examples/python/README | 1 +
examples/python/domipaddrs.py | 56 +++++++++++
include/libvirt/libvirt.h.in | 38 ++++++++
python/generator.py | 3 +
python/libvirt-override-api.xml | 8 +-
python/libvirt-override.c | 102 ++++++++++++++++++++
src/driver.h | 6 ++
src/libvirt.c | 135 +++++++++++++++++++++++++++
src/libvirt_public.syms | 6 ++
src/qemu/qemu_agent.c | 201 ++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 3 +
src/qemu/qemu_driver.c | 76 +++++++++++++++
src/remote/remote_driver.c | 99 ++++++++++++++++++++
src/remote/remote_protocol.x | 40 +++++++-
src/remote_protocol-structs | 24 +++++
tests/qemuagenttest.c | 188 +++++++++++++++++++++++++++++++++++++
tools/virsh-domain-monitor.c | 131 ++++++++++++++++++++++++++
tools/virsh.pod | 18 ++++
20 files changed, 1264 insertions(+), 3 deletions(-)
create mode 100755 examples/python/domipaddrs.py
--
1.7.11.7
11 years, 2 months
[libvirt] [v0.9.12-maint 08/11] Make sure regree is called close to it's usage
by Luca Tettamanti
This is a backport of 71da3b66a8455faf8019effe3cf504a31f91f54a.
---
src/storage/storage_backend_logical.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 9a91dd9..7abb17b 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -204,13 +204,16 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool,
if (err != 0) {
char error[100];
regerror(err, reg, error, sizeof(error));
+ regfree(reg);
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to compile regex %s"),
error);
goto cleanup;
}
- if (regexec(reg, groups[3], nvars, vars, 0) != 0) {
+ err = regexec(reg, groups[3], nvars, vars, 0);
+ regfree(reg);
+ if (err != 0) {
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed volume extent devices value"));
goto cleanup;
--
1.8.4.rc3
11 years, 2 months
[libvirt] Xen 4.1 misc issues
by Roberto Sassu
Hi everyone
I'm using Ubuntu 12.04.3 LTS with the Xen hypervisor
installed (package version: 4.1.2-2ubuntu2.10),
and Libvirt v0.10.2.2 (that interacts with Xen through
the libxl driver).
I performed some adjustments to have the required
features:
- Switch from Xend to libxl:
I created upstart jobs for xenstored and xenconsoled
so that necessary daemons are started earlier enough
and Libvirt can contact the hypervisor through libxl.
- Add support for Open vSwitch:
I added the script 'vif-openvswitch', taken from
the master branch of the GIT repository, to the
/etc/xen/scripts directory in order to plug network
interfaces to Open vSwitch switches.
I know that the support for libxl is experimental
in Xen 4.1, but I'm wondering if someone has a solution
to the following issues:
1) On domain destroy, the host configuration is not clean:
if the flag 'force' is set to 0 some entries in the
xenstored database are not removed (console, ...)
if the flag 'force' is set to 1 (as it is done
in Libvirt), the event 'online' associated to the
network interface is not triggered and, thus, the
vif is not removed from the Open vSwitch switch.
To fix this issue, I temporarily added a call
to vif-openvswitch into the xen-hotplug-cleanup script.
2) When a domain is started from Libvirt, the console
source path does not appear in the output of the
command 'virsh dumpxml instance-00000381'
3) Sometimes, a domU is not started at all. If I start
a virtual machine from Libvirt through virsh or directly
through xl, these tools report that the virtual machine
is running but I see no messages coming from the console
and the CPU time remains fixed.
I'm attaching some files that may be useful to understand
the problem:
- libvirt.xml: domain specifications (Libvirt format)
- domain.xl: domain specifications (Xen format)
- libvirt_virsh_dumpxml.log: output of the command
'virsh dumpxml instance-00000381'
- xl_create.log: output of the command 'xl create -d domain.xl'
- xl_info.log: output of the command 'xl info'
- qemu-dm-instance-00000381.log: qemu-dm log
- syslog_vif6_0.log: vif attach/detach logs from /var/log/syslog
- xenstore-db-not-clean.log: xenstore db entries not removed
after 'xl destroy'
- libvirt_libxl.log: log from /var/log/libvirt/libxl.log
after the execution of the command 'virsh create libvirt.xml'
Lastly, I want to add that the image I'm using for the tests
is Ubuntu Precise 12.04.3 LTS, taken from the URL:
http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-am...
and the kernel is taken from the URL:
http://cloud-images.ubuntu.com/precise/current/unpacked/precise-server-cl...
Thanks
Roberto Sassu
11 years, 2 months
[libvirt] [PATCH] Fix virsystemdtest for previous commit
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The change to query org.freedesktop.DBus.ListActivatableNames
to detect systemd broke the test suite, since we did not have
stubs to respond to this dbus call.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
tests/virsystemdmock.c | 54 +++++++++++++++++++++++++++++++++-----------------
tests/virsystemdtest.c | 4 ++++
2 files changed, 40 insertions(+), 18 deletions(-)
Pushed under build break rule.
diff --git a/tests/virsystemdmock.c b/tests/virsystemdmock.c
index 5dbd33f..59b312d 100644
--- a/tests/virsystemdmock.c
+++ b/tests/virsystemdmock.c
@@ -65,29 +65,47 @@ dbus_bool_t dbus_message_set_reply_serial(DBusMessage *message ATTRIBUTE_UNUSED,
}
DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connection ATTRIBUTE_UNUSED,
- DBusMessage *message ATTRIBUTE_UNUSED,
+ DBusMessage *message,
int timeout_milliseconds ATTRIBUTE_UNUSED,
- DBusError *error)
+ DBusError *error ATTRIBUTE_UNUSED)
{
DBusMessage *reply = NULL;
+ const char *service = dbus_message_get_destination(message);
- if (getenv("FAIL_BAD_SERVICE")) {
- DBusMessageIter iter;
- const char *error_message = "Something went wrong creating the machine";
- if (!(reply = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR)))
- return NULL;
- dbus_message_set_error_name(reply, "org.freedesktop.systemd.badthing");
- dbus_message_iter_init_append(reply, &iter);
- if (!dbus_message_iter_append_basic(&iter,
- DBUS_TYPE_STRING,
- &error_message)) {
- dbus_message_unref(reply);
- return NULL;
+ if (STREQ(service, "org.freedesktop.machine1")) {
+ if (getenv("FAIL_BAD_SERVICE")) {
+ DBusMessageIter iter;
+ const char *error_message = "Something went wrong creating the machine";
+ if (!(reply = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR)))
+ return NULL;
+ dbus_message_set_error_name(reply, "org.freedesktop.systemd.badthing");
+ dbus_message_iter_init_append(reply, &iter);
+ if (!dbus_message_iter_append_basic(&iter,
+ DBUS_TYPE_STRING,
+ &error_message)) {
+ dbus_message_unref(reply);
+ return NULL;
+ }
+ } else {
+ reply = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
}
- } else if (getenv("FAIL_NO_SERVICE")) {
- dbus_set_error(error,
- "org.freedesktop.DBus.Error.ServiceUnknown",
- "%s", "The name org.freedesktop.machine1 was not provided by any .service files");
+ } else if (STREQ(service, "org.freedesktop.DBus")) {
+ const char *svc1 = "org.foo.bar.wizz";
+ const char *svc2 = "org.freedesktop.machine1";
+ DBusMessageIter iter, sub;
+ reply = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
+ dbus_message_iter_init_append(reply, &iter);
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+ "s", &sub);
+
+ dbus_message_iter_append_basic(&sub,
+ DBUS_TYPE_STRING,
+ &svc1);
+ if (!getenv("FAIL_NO_SERVICE"))
+ dbus_message_iter_append_basic(&sub,
+ DBUS_TYPE_STRING,
+ &svc2);
+ dbus_message_iter_close_container(&iter, &sub);
} else {
reply = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN);
}
diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c
index a9c6d32..7dc7520 100644
--- a/tests/virsystemdtest.c
+++ b/tests/virsystemdtest.c
@@ -94,9 +94,11 @@ static int testCreateNoSystemd(const void *opaque ATTRIBUTE_UNUSED)
123,
false,
NULL)) == 0) {
+ unsetenv("FAIL_NO_SERVICE");
fprintf(stderr, "%s", "Unexpected create machine success\n");
return -1;
}
+ unsetenv("FAIL_NO_SERVICE");
if (rv != -2) {
fprintf(stderr, "%s", "Unexpected create machine error\n");
@@ -126,9 +128,11 @@ static int testCreateBadSystemd(const void *opaque ATTRIBUTE_UNUSED)
123,
false,
NULL)) == 0) {
+ unsetenv("FAIL_BAD_SERVICE");
fprintf(stderr, "%s", "Unexpected create machine success\n");
return -1;
}
+ unsetenv("FAIL_BAD_SERVICE");
if (rv != -1) {
fprintf(stderr, "%s", "Unexpected create machine error\n");
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH 0/4] Pre-create storage on live migration
by Michal Privoznik
Currently users are required to pre-create storage on their own upon migration.
This patch set implements the feature for RAW, QCOW and QCOW2 images. While for
the RAW fallocate() is used (so we are guaranteed subsequent write() won't fail
with ENOSPC, for the latter two we have no other option than using qemu-img,
which uses ftruncate(). On the other hand, this is not such big deal. If the
spare runs out as a domain is migrating, the migration is aborted, and
pre-created storage unlink()-ed. There's no difference to what will happen if
user will pre-create storage by hand.
https://bugzilla.redhat.com/show_bug.cgi?id=927252
Michal Privoznik (4):
qemu: Expose file opening functions
qemu_domain: Introduce qemuDomainGetDiskBlockInfo
qemu_migration: Check size prerequisites
qemu_migration: Unlink pre-created storage on error
src/qemu/qemu_domain.c | 299 ++++++++++++++++++++++++++++++++++++++++++++-
src/qemu/qemu_domain.h | 16 +++
src/qemu/qemu_driver.c | 276 ++---------------------------------------
src/qemu/qemu_migration.c | 304 +++++++++++++++++++++++++++++++++++++++++++++-
src/qemu/qemu_process.c | 8 ++
5 files changed, 627 insertions(+), 276 deletions(-)
--
1.8.1.5
11 years, 2 months
[libvirt] [PATCH] virsh domjobinfo: Do not return 1 if job is NONE
by Jiri Denemark
Commit 38ab1225 changed the default value of ret from true to false but
forgot to set ret = true when job is NONE. Thus, virsh domjobinfo
returned 1 when there was no job running for a domain but it used to
(and should) return 0 in this case.
---
tools/virsh-domain.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 74feca1..3479a1c 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -5018,6 +5018,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
case VIR_DOMAIN_JOB_NONE:
default:
vshPrint(ctl, "%-12s\n", _("None"));
+ ret = true;
goto cleanup;
}
--
1.8.3.2
11 years, 2 months
[libvirt] [PATCHv2 RESEND] Add forwarders attribute to <dns /> element.
by Diego Woitasen
Useful to set custom forwarders instead of using the contents of
/etc/resolv.conf. It helps me to setup dnsmasq as local nameserver to resolv VM
domain names from domain 0, when domain option is used.
Signed-off-by: Diego Woitasen <diego.woitasen(a)vhgroup.net>
---
docs/formatnetwork.html.in | 8 ++++
docs/schemas/network.rng | 5 +++
src/conf/network_conf.c | 43 ++++++++++++++++++++--
src/conf/network_conf.h | 2 +
src/network/bridge_driver.c | 8 ++++
.../nat-network-dns-forwarders.conf | 16 ++++++++
.../nat-network-dns-forwarders.xml | 12 ++++++
tests/networkxml2conftest.c | 1 +
8 files changed, 92 insertions(+), 3 deletions(-)
create mode 100644 tests/networkxml2confdata/nat-network-dns-forwarders.conf
create mode 100644 tests/networkxml2confdata/nat-network-dns-forwarders.xml
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index e1482db..4dd809a 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -631,6 +631,8 @@
<domain name="example.com"/>
<dns>
<txt name="example" value="example value" />
+ <forwarders addr="8.8.8.8" />
+ <forwarders addr="8.8.4.4" />
<srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/>
<host ip='192.168.122.2'>
<hostname>myhost</hostname>
@@ -685,6 +687,12 @@
Currently supported sub-elements of <code><dns></code> are:
<dl>
+ <dt><code>forwarders</code></dt>
+ <dd>A <code>dns</code> element can have 0 or more <code>forwarders</code> elements.
+ Each forwarders element defines an IP address to be used as forwarder
+ in DNS server configuration. The addr attribute is required and defines the
+ IP address of every forwarder. <span class="since">Since N/A</span>
+ </dd>
<dt><code>txt</code></dt>
<dd>A <code>dns</code> element can have 0 or more <code>txt</code> elements.
Each txt element defines a DNS TXT record and has two attributes, both
diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng
index ab183f1..e0c2b51 100644
--- a/docs/schemas/network.rng
+++ b/docs/schemas/network.rng
@@ -217,6 +217,11 @@
</attribute>
</optional>
<zeroOrMore>
+ <element name="forwarders">
+ <attribute name="addr"><ref name="ipAddr"/></attribute>
+ </element>
+ </zeroOrMore>
+ <zeroOrMore>
<element name="txt">
<attribute name="name"><ref name="dnsName"/></attribute>
<attribute name="value"><text/></attribute>
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index d54f2aa..1c1aa64 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -175,6 +175,11 @@ virNetworkDNSSrvDefClear(virNetworkDNSSrvDefPtr def)
static void
virNetworkDNSDefClear(virNetworkDNSDefPtr def)
{
+ if (def->forwarders) {
+ while (def->nfwds)
+ VIR_FREE(def->forwarders[--def->nfwds]);
+ VIR_FREE(def->forwarders);
+ }
if (def->txts) {
while (def->ntxts)
virNetworkDNSTxtDefClear(&def->txts[--def->ntxts]);
@@ -1037,8 +1042,9 @@ virNetworkDNSDefParseXML(const char *networkName,
xmlNodePtr *hostNodes = NULL;
xmlNodePtr *srvNodes = NULL;
xmlNodePtr *txtNodes = NULL;
+ xmlNodePtr *fwdNodes = NULL;
char *forwardPlainNames = NULL;
- int nhosts, nsrvs, ntxts;
+ int nfwds, nhosts, nsrvs, ntxts;
size_t i;
int ret = -1;
xmlNodePtr save = ctxt->node;
@@ -1058,6 +1064,30 @@ virNetworkDNSDefParseXML(const char *networkName,
}
}
+ nfwds = virXPathNodeSet("./forwarders", ctxt, &fwdNodes);
+ if (nfwds < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("invalid <forwarders> element found in <dns> of network %s"),
+ networkName);
+ goto cleanup;
+ }
+ if (nfwds > 0) {
+ if (VIR_ALLOC_N(def->forwarders, nfwds) < 0)
+ goto cleanup;
+
+ for (i = 0; i < nfwds; i++) {
+ def->forwarders[i] = virXMLPropString(fwdNodes[i], "addr");
+ if (virSocketAddrParse(NULL, def->forwarders[i], AF_UNSPEC) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("Invalid forwarder IP address '%s' "
+ "in network '%s'"),
+ def->forwarders[i], networkName);
+ goto cleanup;
+ }
+ def->nfwds++;
+ }
+ }
+
nhosts = virXPathNodeSet("./host", ctxt, &hostNodes);
if (nhosts < 0) {
virReportError(VIR_ERR_XML_ERROR,
@@ -1121,6 +1151,7 @@ virNetworkDNSDefParseXML(const char *networkName,
ret = 0;
cleanup:
VIR_FREE(forwardPlainNames);
+ VIR_FREE(fwdNodes);
VIR_FREE(hostNodes);
VIR_FREE(srvNodes);
VIR_FREE(txtNodes);
@@ -2267,13 +2298,14 @@ virNetworkDNSDefFormat(virBufferPtr buf,
int result = 0;
size_t i, j;
- if (!(def->forwardPlainNames || def->nhosts || def->nsrvs || def->ntxts))
+ if (!(def->forwardPlainNames || def->forwarders || def->nhosts ||
+ def->nsrvs || def->ntxts))
goto out;
virBufferAddLit(buf, "<dns");
if (def->forwardPlainNames) {
virBufferAddLit(buf, " forwardPlainNames='yes'");
- if (!(def->nhosts || def->nsrvs || def->ntxts)) {
+ if (!(def->forwarders || def->nhosts || def->nsrvs || def->ntxts)) {
virBufferAddLit(buf, "/>\n");
goto out;
}
@@ -2282,6 +2314,11 @@ virNetworkDNSDefFormat(virBufferPtr buf,
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
+ for (i = 0; i < def->nfwds; i++) {
+ virBufferAsprintf(buf, "<forwarders addr='%s' />\n",
+ def->forwarders[i]);
+ }
+
for (i = 0; i < def->ntxts; i++) {
virBufferAsprintf(buf, "<txt name='%s' value='%s'/>\n",
def->txts[i].name,
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index c28bfae..b425986 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -122,6 +122,8 @@ struct _virNetworkDNSDef {
virNetworkDNSHostDefPtr hosts;
size_t nsrvs;
virNetworkDNSSrvDefPtr srvs;
+ size_t nfwds;
+ char **forwarders;
};
typedef struct _virNetworkIpDef virNetworkIpDef;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 3a8be90..a2cfb35 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -708,6 +708,14 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
if (!network->def->dns.forwardPlainNames)
virBufferAddLit(&configbuf, "domain-needed\n");
+ if (network->def->dns.forwarders) {
+ virBufferAddLit(&configbuf, "no-resolv\n");
+ for (i=0; i < network->def->dns.nfwds; i++) {
+ virBufferAsprintf(&configbuf, "server=%s\n",
+ network->def->dns.forwarders[i]);
+ }
+ }
+
if (network->def->domain) {
virBufferAsprintf(&configbuf,
"domain=%s\n"
diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.conf b/tests/networkxml2confdata/nat-network-dns-forwarders.conf
new file mode 100644
index 0000000..ebca289
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-forwarders.conf
@@ -0,0 +1,16 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+domain-needed
+no-resolv
+server=8.8.8.8
+server=8.8.4.4
+local=//
+except-interface=lo
+bind-dynamic
+interface=virbr0
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.xml b/tests/networkxml2confdata/nat-network-dns-forwarders.xml
new file mode 100644
index 0000000..9cd2667
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-forwarders.xml
@@ -0,0 +1,12 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid>
+ <forward dev='eth0' mode='nat'/>
+ <bridge name='virbr0' stp='on' delay='0' />
+ <dns>
+ <forwarders addr='8.8.8.8' />
+ <forwarders addr='8.8.4.4' />
+ </dns>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ </ip>
+</network>
diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c
index 5825af3..ad50e88 100644
--- a/tests/networkxml2conftest.c
+++ b/tests/networkxml2conftest.c
@@ -145,6 +145,7 @@ mymain(void)
DO_TEST("nat-network-dns-srv-record", full);
DO_TEST("nat-network-dns-hosts", full);
DO_TEST("nat-network-dns-forward-plain", full);
+ DO_TEST("nat-network-dns-forwarders", full);
DO_TEST("dhcp6-network", dhcpv6);
DO_TEST("dhcp6-nat-network", dhcpv6);
DO_TEST("dhcp6host-routed-network", dhcpv6);
--
1.8.1.2
11 years, 2 months
[libvirt] [PATCH] rbd: Use different formatter to display disk format
by Wido den Hollander
RBD images are always in RAW format and should be displayed that way
Signed-off-by: Wido den Hollander <wido(a)widodh.nl>
---
src/conf/storage_conf.c | 3 ++-
src/storage/storage_backend_rbd.c | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 002663f..e54fc64 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -230,7 +230,8 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
},
.volOptions = {
.defaultFormat = VIR_STORAGE_FILE_RAW,
- .formatToString = virStoragePoolFormatDiskTypeToString,
+ .formatFromString = virStorageVolumeFormatFromString,
+ .formatToString = virStorageFileFormatTypeToString,
}
},
{.poolType = VIR_STORAGE_POOL_SHEEPDOG,
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index e5d720e..c435636 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -32,6 +32,7 @@
#include "base64.h"
#include "viruuid.h"
#include "virstring.h"
+#include "virstoragefile.h"
#include "rados/librados.h"
#include "rbd/librbd.h"
@@ -271,6 +272,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
vol->capacity = info.size;
vol->allocation = info.obj_size * info.num_objs;
vol->type = VIR_STORAGE_VOL_NETWORK;
+ vol->target.format = VIR_STORAGE_FILE_RAW;
VIR_FREE(vol->target.path);
if (virAsprintf(&vol->target.path, "%s/%s",
--
1.7.9.5
11 years, 2 months
Re: [libvirt] [fedora-virt] Sanlock + libvirt
by Cole Robinson
cc-ing libvir-list
On 09/09/2013 08:20 AM, Ján ONDREJ (SAL) wrote:
> Hello,
>
> in sanlock docs (https://fedorahosted.org/sanlock/) there is described,
> how to use it. There is no mention about NFS. Can I use sanlock with LVM
> (without NFS) with livbirt? It this feature implemented in libvirt for
> Fedora or RHEL?
>
> For libvirt I need to define lease dir as:
> disk_lease_dir = "/var/lib/libvirt/sanlock"
> but this have to be a directory. How to configure it to use sanlock on LVM?
>
11 years, 2 months