[libvirt] [PATCH] add <bootp server="...">
by Paolo Bonzini
This patch adds an optional attribute to the <bootp> tag, that
allows to specify a TFTP server address other than the address of
the DHCP server itself.
This can be used to forward the BOOTP settings of the host down to the
guest. This is something that configurations such as Xen's default
network achieve naturally, but must be done manually for NAT.
2009-10-22 Paolo Bonzini <pbonzini(a)redhat.com>
* docs/formatnetwork.html.in: Document new attribute.
* docs/schemas/network.rng: Add it to schema.
* src/conf/network_conf.h: Add it to struct.
* src/conf/network_conf.c: Add it to parser and pretty printer.
* src/network/bridge_driver.c: Put it in the dnsmasq command line.
* tests/networkxml2xmlin/netboot-proxy-network.xml: New.
* tests/networkxml2xmlout/netboot-proxy-network.xml: New.
* tests/networkxml2xmltest.c: Add the new test.
---
docs/formatnetwork.html.in | 15 ++++++++++-----
docs/schemas/network.rng | 3 +++
src/conf/network_conf.c | 9 ++++++++-
src/conf/network_conf.h | 1 +
src/network/bridge_driver.c | 9 +++++++--
tests/networkxml2xmlin/netboot-proxy-network.xml | 13 +++++++++++++
tests/networkxml2xmlout/netboot-proxy-network.xml | 13 +++++++++++++
tests/networkxml2xmltest.c | 1 +
8 files changed, 56 insertions(+), 8 deletions(-)
create mode 100644 tests/networkxml2xmlin/netboot-proxy-network.xml
create mode 100644 tests/networkxml2xmlout/netboot-proxy-network.xml
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index e471385..eb61f15 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -142,11 +142,16 @@
name to be given that host by the DHCP server (via the
<code>name</code> attribute). <span class="since">Since 0.4.5</span>
</dd><dt><code>bootp</code></dt><dd>The optional <code>bootp</code>
- element specifies BOOTP options to be provided by the DHCP server.
- Only one attribute is supported, <code>file</code>, giving the file
- to be used for the boot image). The BOOTP options currently have to
- be the same for all address ranges and statically assigned addresses.<span
- class="since">Since 0.7.1.</span>
+ element specifies BOOTP options to be provided by the DHCP server.
+ Two attributes are supported: <code>file</code> is mandatory and
+ gives the file to be used for the boot image; <code>server</code> is
+ optional and gives the address of the TFTP server from which the boot
+ image will be fetched. <code>server</code> defaults to the same host
+ that runs the DHCP server, as is the case when the <code>tftp</code>
+ element is used. The BOOTP options currently have to be the same
+ for all address ranges and statically assigned addresses.<span
+ class="since">Since 0.7.1 (<code>server</code> since 0.7.3).</span>
+ </dd>
</dl>
<h2><a name="examples">Example configuration</a></h2>
diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng
index 7a2d7d4..adef792 100644
--- a/docs/schemas/network.rng
+++ b/docs/schemas/network.rng
@@ -109,6 +109,9 @@
<optional>
<element name="bootp">
<attribute name="file"><text/></attribute>
+ <optional>
+ <attribute name="server"><text/></attribute>
+ </optional>
</element>
</optional>
</element>
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 40f5fdd..fd8efb0 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -117,6 +117,7 @@ void virNetworkDefFree(virNetworkDefPtr def)
VIR_FREE(def->tftproot);
VIR_FREE(def->bootfile);
+ VIR_FREE(def->bootserver);
VIR_FREE(def);
}
@@ -313,6 +314,7 @@ virNetworkDHCPRangeDefParseXML(virConnectPtr conn,
}
def->bootfile = (char *)file;
+ def->bootserver = (char *) xmlGetProp(cur, BAD_CAST "server");
}
cur = cur->next;
@@ -671,8 +673,13 @@ char *virNetworkDefFormat(virConnectPtr conn,
virBufferAddLit(&buf, "/>\n");
}
if (def->bootfile) {
- virBufferEscapeString(&buf, " <bootp file='%s' />\n",
+ virBufferEscapeString(&buf, " <bootp file='%s' ",
def->bootfile);
+ if (def->bootserver) {
+ virBufferEscapeString(&buf, "server='%s' ",
+ def->bootserver);
+ }
+ virBufferAddLit(&buf, "/>\n");
}
virBufferAddLit(&buf, " </dhcp>\n");
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index e983a01..6175b0f 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -81,6 +81,7 @@ struct _virNetworkDef {
char *tftproot;
char *bootfile;
+ char *bootserver;
};
typedef struct _virNetworkObj virNetworkObj;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 95bc810..bc241ef 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -402,7 +402,7 @@ networkBuildDnsmasqArgv(virConnectPtr conn,
(2 * network->def->nhosts) +
/* --enable-tftp --tftp-root /srv/tftp */
(network->def->tftproot ? 3 : 0) +
- /* --dhcp-boot pxeboot.img */
+ /* --dhcp-boot pxeboot.img[,,12.34.56.78] */
(network->def->bootfile ? 2 : 0) +
1; /* NULL */
@@ -488,8 +488,13 @@ networkBuildDnsmasqArgv(virConnectPtr conn,
APPEND_ARG(*argv, i++, network->def->tftproot);
}
if (network->def->bootfile) {
+ snprintf(buf, sizeof(buf), "%s%s%s",
+ network->def->bootfile,
+ network->def->bootserver ? ",," : "",
+ network->def->bootserver ? network->def->bootserver : "");
+
APPEND_ARG(*argv, i++, "--dhcp-boot");
- APPEND_ARG(*argv, i++, network->def->bootfile);
+ APPEND_ARG(*argv, i++, buf);
}
#undef APPEND_ARG
diff --git a/tests/networkxml2xmlin/netboot-proxy-network.xml b/tests/networkxml2xmlin/netboot-proxy-network.xml
new file mode 100644
index 0000000..ecb6738
--- /dev/null
+++ b/tests/networkxml2xmlin/netboot-proxy-network.xml
@@ -0,0 +1,13 @@
+<network>
+ <name>netboot</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <bridge name="virbr1" stp='off' delay='1'/>
+ <domain name="example.com"/>
+ <forward/>
+ <ip address="192.168.122.1" netmask="255.255.255.0">
+ <dhcp>
+ <range start="192.168.122.2" end="192.168.122.254" />
+ <bootp file="pxeboot.img" server="10.20.30.40" />
+ </dhcp>
+ </ip>
+</network>
diff --git a/tests/networkxml2xmlout/netboot-proxy-network.xml b/tests/networkxml2xmlout/netboot-proxy-network.xml
new file mode 100644
index 0000000..e11c50b
--- /dev/null
+++ b/tests/networkxml2xmlout/netboot-proxy-network.xml
@@ -0,0 +1,13 @@
+<network>
+ <name>netboot</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
+ <forward mode='nat'/>
+ <bridge name='virbr1' stp='off' delay='1' />
+ <domain name='example.com'/>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <range start='192.168.122.2' end='192.168.122.254' />
+ <bootp file='pxeboot.img' server='10.20.30.40' />
+ </dhcp>
+ </ip>
+</network>
diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c
index b02d735..957e64b 100644
--- a/tests/networkxml2xmltest.c
+++ b/tests/networkxml2xmltest.c
@@ -89,6 +89,7 @@ mymain(int argc, char **argv)
DO_TEST("routed-network");
DO_TEST("nat-network");
DO_TEST("netboot-network");
+ DO_TEST("netboot-proxy-network");
return (ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
--
1.6.2.5
15 years
[libvirt] [PATCH] Improve error reporting for virConnectGetHostname calls
by Cole Robinson
All drivers have copy + pasted inadequate error reporting which wraps
util.c:virGetHostname. Move all error reporting to this function, and improve
what we report.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
daemon/libvirtd.c | 3 +--
src/lxc/lxc_driver.c | 10 +---------
src/qemu/qemu_driver.c | 14 ++------------
src/test/test_driver.c | 10 +---------
src/uml/uml_driver.c | 10 +---------
src/util/util.c | 18 +++++++++++++++---
src/util/util.h | 2 +-
src/vbox/vbox_tmpl.c | 11 +----------
src/xen/xen_driver.c | 10 +---------
src/xen/xend_internal.c | 3 +--
tools/virsh.c | 2 +-
11 files changed, 26 insertions(+), 67 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 03d091a..058e684 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -939,9 +939,8 @@ static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
if (!mdns_name) {
char groupname[64], *localhost, *tmp;
/* Extract the host part of the potentially FQDN */
- localhost = virGetHostname();
+ localhost = virGetHostname(NULL);
if (localhost == NULL) {
- virReportOOMError(NULL);
goto cleanup;
}
if ((tmp = strchr(localhost, '.')))
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index ef97364..73f1c8e 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -2058,16 +2058,8 @@ cleanup:
static char *lxcGetHostname (virConnectPtr conn)
{
- char *result;
-
- result = virGetHostname();
- if (result == NULL) {
- virReportSystemError (conn, errno,
- "%s", _("failed to determine host name"));
- return NULL;
- }
/* Caller frees this string. */
- return result;
+ return virGetHostname(conn);
}
static int lxcFreezeContainer(lxc_driver_t *driver, virDomainObjPtr vm)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a3beedb..86546e5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2623,16 +2623,8 @@ cleanup:
static char *
qemudGetHostname (virConnectPtr conn)
{
- char *result;
-
- result = virGetHostname();
- if (result == NULL) {
- virReportSystemError (conn, errno,
- "%s", _("failed to determine host name"));
- return NULL;
- }
/* Caller frees this string. */
- return result;
+ return virGetHostname(conn);
}
static int qemudListDomains(virConnectPtr conn, int *ids, int nids) {
@@ -6283,9 +6275,7 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn,
if (port == QEMUD_MIGRATION_NUM_PORTS) port = 0;
/* Get hostname */
- if ((hostname = virGetHostname()) == NULL) {
- virReportSystemError (dconn, errno,
- "%s", _("failed to determine host name"));
+ if ((hostname = virGetHostname(dconn)) == NULL) {
goto cleanup;
}
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 36f8158..4a081be 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -994,16 +994,8 @@ static int testGetVersion(virConnectPtr conn ATTRIBUTE_UNUSED,
static char *testGetHostname (virConnectPtr conn)
{
- char *result;
-
- result = virGetHostname();
- if (result == NULL) {
- virReportSystemError(conn, errno,
- "%s", _("cannot lookup hostname"));
- return NULL;
- }
/* Caller frees this string. */
- return result;
+ return virGetHostname(conn);
}
static int testGetMaxVCPUs(virConnectPtr conn ATTRIBUTE_UNUSED,
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 9a7fe42..cd92a6b 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -1131,16 +1131,8 @@ cleanup:
static char *
umlGetHostname (virConnectPtr conn)
{
- char *result;
-
- result = virGetHostname();
- if (result == NULL) {
- virReportSystemError(conn, errno,
- "%s", _("cannot lookup hostname"));
- return NULL;
- }
/* Caller frees this string. */
- return result;
+ return virGetHostname(conn);
}
static int umlListDomains(virConnectPtr conn, int *ids, int nids) {
diff --git a/src/util/util.c b/src/util/util.c
index 98f8a14..49eac6d 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -1804,30 +1804,42 @@ int virDiskNameToIndex(const char *name) {
#define AI_CANONIDN 0
#endif
-char *virGetHostname(void)
+char *virGetHostname(virConnectPtr conn)
{
int r;
char hostname[HOST_NAME_MAX+1], *result;
struct addrinfo hints, *info;
r = gethostname (hostname, sizeof(hostname));
- if (r == -1)
+ if (r == -1) {
+ virReportSystemError (conn, errno,
+ "%s", _("failed to determine host name"));
return NULL;
+ }
NUL_TERMINATE(hostname);
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME|AI_CANONIDN;
hints.ai_family = AF_UNSPEC;
r = getaddrinfo(hostname, NULL, &hints, &info);
- if (r != 0)
+ if (r != 0) {
+ ReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("getaddrinfo failed for '%s': %s"),
+ hostname, gai_strerror(r));
return NULL;
+ }
if (info->ai_canonname == NULL) {
+ ReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("could not determine canonical host name"));
freeaddrinfo(info);
return NULL;
}
/* Caller frees this string. */
result = strdup (info->ai_canonname);
+ if (!result)
+ virReportOOMError(conn);
+
freeaddrinfo(info);
return result;
}
diff --git a/src/util/util.h b/src/util/util.h
index 8679636..85d5488 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -222,7 +222,7 @@ static inline int getuid (void) { return 0; }
static inline int getgid (void) { return 0; }
#endif
-char *virGetHostname(void);
+char *virGetHostname(virConnectPtr conn);
int virKillProcess(pid_t pid, int sig);
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 4f43901..2a17946 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -594,17 +594,8 @@ static int vboxGetVersion(virConnectPtr conn, unsigned long *version) {
}
static char *vboxGetHostname(virConnectPtr conn) {
- char *hostname;
-
/* the return string should be freed by caller */
- hostname = virGetHostname();
- if (hostname == NULL) {
- vboxError(conn, VIR_ERR_INTERNAL_ERROR,"%s",
- "failed to determine host name");
- return NULL;
- }
-
- return hostname;
+ return virGetHostname(conn);
}
static int vboxGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED) {
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index f2744b0..0818cd3 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -484,16 +484,8 @@ xenUnifiedGetVersion (virConnectPtr conn, unsigned long *hvVer)
static char *
xenUnifiedGetHostname (virConnectPtr conn)
{
- char *result;
-
- result = virGetHostname();
- if (result == NULL) {
- virReportSystemError(conn, errno,
- "%s", _("cannot lookup hostname"));
- return NULL;
- }
/* Caller frees this string. */
- return result;
+ return virGetHostname(conn);
}
static int
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index d3ab019..6d1d851 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -4347,9 +4347,8 @@ xenDaemonDomainMigratePrepare (virConnectPtr dconn,
* deallocates this string.
*/
if (uri_in == NULL) {
- *uri_out = virGetHostname();
+ *uri_out = virGetHostname(dconn);
if (*uri_out == NULL) {
- virReportOOMError(dconn);
return -1;
}
}
diff --git a/tools/virsh.c b/tools/virsh.c
index 6b93405..3c668da 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -524,7 +524,7 @@ cmdRunConsole(vshControl *ctl, virDomainPtr dom)
char *thatHost = NULL;
char *thisHost = NULL;
- if (!(thisHost = virGetHostname())) {
+ if (!(thisHost = virGetHostname(ctl->conn))) {
vshError(ctl, "%s", _("Failed to get local hostname"));
goto cleanup;
}
--
1.6.5.rc2
15 years
[libvirt] [PATCH] qemu: migrate: Error if we collide with an inactive domain
by Cole Robinson
Currently the check for a VM name/uuid collision on the migrate destination
only errors for active domains. Not sure why this wouldn't apply for non
running VMs as well, so drop the check.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/qemu/qemu_driver.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 86546e5..fb952d8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6341,13 +6341,10 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn,
if (!vm) vm = virDomainFindByName(&driver->domains, dname);
if (vm) {
- if (virDomainIsActive(vm)) {
- qemudReportError (dconn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("domain with the same name or UUID already exists as '%s'"),
- vm->def->name);
- goto cleanup;
- }
- virDomainObjUnlock(vm);
+ qemudReportError (dconn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
+ _("domain with the same name or UUID already exists as '%s'"),
+ vm->def->name);
+ goto cleanup;
}
if (!(vm = virDomainAssignDef(dconn,
--
1.6.5.rc2
15 years
[libvirt] [PATCH 0/2] Fix a couple problems encountered during virInterface testing
by Laine Stump
When testing all the different possibilities of interfaces with the
new netcf release + my latest libvirt patches (ACKed, but not yet
committed), I came across some problems, addressed by the following
two patches.
The first patch is for a bug that crept in due to a last minute change
suggested in danpb's review - I missed changing a couple places to
account for changing the initial value of "ret". It could alternately
be squashed into this patch, which hasn't yet been committed:
https://www.redhat.com/archives/libvir-list/2009-October/msg00689.html
The second patch loosens up the parsing of vlan, bond, and bridge
interface XML because the live config XML doesn't know how to get
those items yet. I believe the necessary items can be learned and
included by the time for the *next* libvirt release, but think that
the new functionality there already is too useful (and too needy of
more hands to test) to delay the entire set for that long.
15 years
[libvirt] Trouble starting a QEMU guest with IPv6 VNC address
by Kaitlin Rupert
Hello,
I am trying to start a QEMU guest with an IPv6 VNC address. I can
specify the address and start the guest, but the VNC port shows up under
the IPv4 list:
# virsh dumpxml domU1 | grep graphics
<graphics type='vnc' port='5900' autoport='no' listen='::1'
keymap='en-us'/>
# cat /proc/net/tcp | grep 170C
2: 00000000:170C 00000000:0000 0A 00000000:00000000 00:00000000
00000000 0 0 621103 1 ffff88007a043a80 299 0 0 2 -1
# cat /proc/net/tcp6 | grep 170C
#
# ps -ef | grep qemu
root 16451 1 43 04:17 ? 00:00:18
/usr/bin/qemu-system-x86_64 -S -M pc -m 128 -smp 1 -name domU1 -uuid
2aebe290-d1ed-11dd-90eb-001a64bc024c -monitor pty -pidfile
/var/run/libvirt/qemu//domU1.pid -no-acpi -boot c -drive
file=/tmp/default-kvm-dimage,if=ide,index=0,boot=on -net
nic,macaddr=11:22:33:aa:bb:cc,vlan=0 -net tap,fd=17,vlan=0 -serial none
-parallel none -usb -vnc ::1:0 -k en-us
I started the same guest manually, but I appended an ",ipv6' flag to the
vnc option (see below). With this change, the port shows up in the IPv6
list.
# /usr/bin/qemu-system-x86_64 -M pc -m 128 -smp 1 -name domU1 -uuid
2aebe290-d1ed-11dd-90eb-001a64bc024c -monitor pty -pidfile
/var/run/libvirt/qemu//domU1.pid -no-acpi -boot c -drive
file=/tmp/default-kvm-dimage,if=ide,index=0,boot=on -net
nic,macaddr=11:22:33:aa:bb:cc,vlan=0 -net tap,fd=17,vlan=0 -serial none
-parallel none -usb -vnc ::1:0,ipv6 -k en-us
# cat /proc/net/tcp6 | grep 170C
2: 00000000000000000000000000000000:170C
00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000
00000000 0 0 621485 1 ffff88007a30ad00 299 0 0 2 -1
# cat /proc/net/tcp | grep 170C
#
I'd like to fix the qemu driver so that it specifies this flag, but I am
unsure whether a guest XML change or some other change is appropriate
here. Would it be better to have the qemu driver code do some detection
on the address that is passed in?
Thanks!
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com
15 years
[libvirt] virsh: error: failed to disconnect from the hypervisor in F12/rawhide with Xen
by Pasi Kärkkäinen
Hello,
I have a testbox running current Fedora 12 (rawhide), with custom 2.6.31.4 Xen pv_ops dom0 kernel.
[root@f12test ~]# xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 1020 4 r----- 33.8
c54test 1024 1 0.0
[root@f12test ~]# virsh list
Id Name State
----------------------------------
0 Domain-0 running
virsh: error: failed to disconnect from the hypervisor
[root@f12test ~]# virsh --connect xen:/// version
Compiled against library: libvir 0.7.1
Using library: libvir 0.7.1
Using API: Xen 3.0.1
Running hypervisor: Xen 3.4.0
virsh: error: failed to disconnect from the hypervisor
*** glibc detected *** virsh: double free or corruption (fasttop): 0x0000000000936250 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3d9ec75dc6]
virsh[0x406d91]
virsh[0x406f29]
virsh[0x406de3]
virsh[0x414582]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3d9ec1eb4d]
virsh[0x405b59]
======= Memory map: ========
<snip, memory map removed>
[root@f12test ~]# rpm -qa | grep -i libvirt
libvirt-python-0.7.1-13.fc12.x86_64
libvirt-0.7.1-13.fc12.x86_64
libvirt-client-0.7.1-13.fc12.x86_64
[root@f12test ~]# rpm -qa | grep -i xen
kernel-2.6.31.4-1.2.73.xendom0.fc12.x86_64
xen-3.4.1-5.fc12.x86_64
xen-runtime-3.4.1-5.fc12.x86_64
kernel-devel-2.6.31.4-1.2.73.xendom0.fc12.x86_64
xen-libs-3.4.1-5.fc12.x86_64
xen-hypervisor-3.4.1-5.fc12.x86_64
Any ideas?
-- Pasi
15 years
[libvirt] [PATCH] Avoid segv if ncf_init fails
by Laine Stump
If ncf_init() fails, it takes responsibility to call ncf_close() when
appropriate. Having libvirt call it results in a double close, which
ends up segv'ing.
---
src/interface/netcf_driver.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/src/interface/netcf_driver.c b/src/interface/netcf_driver.c
index b5c3664..c44ba62 100644
--- a/src/interface/netcf_driver.c
+++ b/src/interface/netcf_driver.c
@@ -142,10 +142,6 @@ static virDrvOpenStatus interfaceOpenInterface(virConnectPtr conn,
return 0;
netcf_error:
- if (driverState->netcf)
- {
- ncf_close(driverState->netcf);
- }
virMutexDestroy (&driverState->lock);
mutex_error:
VIR_FREE(driverState);
--
1.6.5.15.gc274d
15 years
[libvirt] [PATCH 0/3] test: Support NodeDeviceCreate/Destroy
by Cole Robinson
The following small series provides the refactoring and implementation needed
to support NodeDeviceCreate/Destroy in the test driver, particularly with
respect to NPIV emulation.
Cole Robinson (3):
node device: Fix locking issue in virNodeDeviceDestroy
node device: Break out get_wwns and get_parent_node helpers
test: Support virNodeDeviceCreate and virNodeDeviceDestroy
src/conf/node_device_conf.c | 89 +++++++++++++++++++++++
src/conf/node_device_conf.h | 11 +++
src/libvirt_private.syms | 2 +
src/node_device/node_device_driver.c | 114 ++++--------------------------
src/test/test_driver.c | 129 +++++++++++++++++++++++++++++++++-
5 files changed, 244 insertions(+), 101 deletions(-)
15 years
[libvirt] [PATCH] Fix --with-init-script configure option
by Matthew Booth
The --with-init-script configure option was broken, and always defaulted based
on the existence of /etc/redhat-release. This was a systematic typo based on
mixed use of init-script and init-scripts.
---
configure.in | 14 +++++++-------
daemon/Makefile.am | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/configure.in b/configure.in
index 2f9db72..42ed29b 100644
--- a/configure.in
+++ b/configure.in
@@ -243,17 +243,17 @@ dnl init script flavor
dnl
AC_MSG_CHECKING([for init script flavor])
AC_ARG_WITH([init-script],
- [AC_HELP_STRING([--with-init-scripts=[redhat|auto|none]],
- [Style of init scripts to install (defaults to auto)])])
-if test "x$with_init_scripts" = "x" -o "x$with_init_scripts" = "xauto"; then
+ [AC_HELP_STRING([--with-init-script=[redhat|auto|none]],
+ [Style of init script to install (defaults to auto)])])
+if test "x$with_init_script" = "x" -o "x$with_init_script" = "xauto"; then
if test -f /etc/redhat-release ; then
- with_init_scripts=redhat
+ with_init_script=redhat
else
- with_init_scripts=none
+ with_init_script=none
fi
fi
-AM_CONDITIONAL([LIBVIRT_INIT_SCRIPTS_RED_HAT], test x$with_init_scripts = xredhat)
-AC_MSG_RESULT($with_init_scripts)
+AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_RED_HAT], test x$with_init_script = xredhat)
+AC_MSG_RESULT($with_init_script)
dnl RHEL-5 has a peculiar version of Xen, which requires some special casing
AC_ARG_WITH([rhel5-api],
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 84aab04..ab3f238 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -188,7 +188,7 @@ install-logrotate: libvirtd.logrotate
mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
$(INSTALL_DATA) $< $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
-if LIBVIRT_INIT_SCRIPTS_RED_HAT
+if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init: libvirtd.init
mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
$(INSTALL_SCRIPT) libvirtd.init \
@@ -222,7 +222,7 @@ install-init:
uninstall-init:
libvirtd.init:
-endif # DBUS_INIT_SCRIPTS_RED_HAT
+endif # LIBVIRT_INIT_SCRIPT_RED_HAT
# This must be added last, since functions it provides/replaces
# are used by nearly every other library.
--
1.6.2.5
15 years