[libvirt] [PATCH] docs: Add additional indentation to level 3 menu items
by Matthias Bolte
formatnetwork.html has a menu item at level 3. libvirt.css
doesn't have a explicit rule for level 3 and level 3 and
level 2 items end up at the same indentation level.
Add an additional 1em indentation to level 3 menu items.
---
docs/libvirt.css | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/docs/libvirt.css b/docs/libvirt.css
index dfc93c6..049e332 100644
--- a/docs/libvirt.css
+++ b/docs/libvirt.css
@@ -106,6 +106,11 @@ h2, h3, h4, h5, h6 {
border-left: 8px solid #c5dbd8;
}
+#menu ul.l3 li .inactive,
+#menu ul.l3 li .active {
+ padding-left: 3em;
+}
+
#headerLogo {
position: absolute;
--
1.7.0.4
14 years, 2 months
[libvirt] [PATCH] node_device: udev driver does not handle SR-IOV devices
by Chris Wright
The udev driver does not update a PCI device with its SR-IOV capabilities,
when applicable, the way the hal driver does. As a result, dumping the
device's XML will not include the relevant physical or virtual function
information.
With this patch, the XML is correct:
# virsh nodedev-dumpxml pci_0000_09_00_0
<device>
<name>pci_0000_09_00_0</name>
<parent>pci_0000_00_1c_0</parent>
<driver>
<name>vxge</name>
</driver>
<capability type='pci'>
<domain>0</domain>
<bus>9</bus>
<slot>0</slot>
<function>0</function>
<product id='0x5833'>X3100 Series 10 Gigabit Ethernet PCIe</product>
<vendor id='0x17d5'>Neterion Inc.</vendor>
<capability type='virt_functions'>
<address domain='0x0000' bus='0x0a' slot='0x00' function='0x1'/>
<address domain='0x0000' bus='0x0a' slot='0x00' function='0x2'/>
<address domain='0x0000' bus='0x0a' slot='0x00' function='0x3'/>
</capability>
</capability>
</device>
# virsh nodedev-dumpxml pci_0000_0a_00_1
<device>
<name>pci_0000_0a_00_1</name>
<parent>pci_0000_00_1c_0</parent>
<driver>
<name>vxge</name>
</driver>
<capability type='pci'>
<domain>0</domain>
<bus>10</bus>
<slot>0</slot>
<function>1</function>
<product id='0x5833'>X3100 Series 10 Gigabit Ethernet PCIe</product>
<vendor id='0x17d5'>Neterion Inc.</vendor>
<capability type='phys_function'>
<address domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
</capability>
</capability>
</device>
Cc: Dave Allan <dallan(a)redhat.com>
Signed-off-by: Chris Wright <chrisw(a)redhat.com>
---
src/node_device/node_device_udev.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 02e44a1..379af86 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -419,11 +419,11 @@ out:
static int udevProcessPCI(struct udev_device *device,
virNodeDeviceDefPtr def)
{
- const char *devpath = NULL;
+ const char *syspath = NULL;
union _virNodeDevCapData *data = &def->caps->data;
int ret = -1;
- devpath = udev_device_get_devpath(device);
+ syspath = udev_device_get_syspath(device);
if (udevGetUintProperty(device,
"PCI_CLASS",
@@ -432,7 +432,7 @@ static int udevProcessPCI(struct udev_device *device,
goto out;
}
- char *p = strrchr(devpath, '/');
+ char *p = strrchr(syspath, '/');
if ((p == NULL) || (udevStrToLong_ui(p+1,
&p,
@@ -487,6 +487,9 @@ static int udevProcessPCI(struct udev_device *device,
goto out;
}
+ get_physical_function(syspath, data);
+ get_virtual_functions(syspath, data);
+
ret = 0;
out:
14 years, 2 months
[libvirt] [PATCH] virExec: fix logic bug
by Eric Blake
As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=659855#c9,
commit c3568ec2 introduced a regression where we no longer close any
fd's beyond FD_SETSIZE.
* src/util/util.c (__virExec): Continue to close fd's beyond
keepfd range.
Reported by Stefan Praszalowicz.
---
src/util/util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/util/util.c b/src/util/util.c
index d6fa81b..197c571 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -570,7 +570,7 @@ __virExec(const char *const*argv,
i != null &&
i != childout &&
i != childerr &&
- (!keepfd || (i < FD_SETSIZE && !FD_ISSET(i, keepfd)))) {
+ (!keepfd || i >= FD_SETSIZE || !FD_ISSET(i, keepfd))) {
tmpfd = i;
VIR_FORCE_CLOSE(tmpfd);
}
--
1.7.3.4
14 years, 2 months
[libvirt] [PATCH 1/3] Virtual network cleanup/bugfixes
by Laine Stump
The first two patches remedy a bug found by Stefan Berger in the new
brAddInetInterface() function that resulted in the broadcast address
not being properly set. This is a regression from previous releases,
so it should be pushed prior to the upcoming release.
The third patch improves the API for a couple of functions that were
recently added, but does not change any behavior. I'd be happy pushing
it now or after the release.
14 years, 2 months
[libvirt] [PATCHv2 00/13] IPv6 support for virtual networks using bridge driver
by Laine Stump
This is a resend of
https://www.redhat.com/archives/libvir-list/2010-December/msg00765.html
incorporating changes due to comments from Eric Blake and Paweł Krześniak.
changes from v1 to v2 are noted in each individual mail
-----
Most of this patchset is setup for patch 09/13, which updates the
network XML parser to support IPv6, and 12/13, which turns on IPv6 in
the bridge driver.
In order to have each patch individually pass make check and
(otherwise function properly in case someone is doing a bisect), there
is a bit of extra code churn (lines that are changed in one patch,
only to be changed again in a later patch); I tried to minimize this
as much as possible.
For for IPv6 to work correctly, target *and build* systems will
now need to have ip6tables and radvd available. The way I added
ip6tables into autoconfigure.ac is identical to existing iptables, and
the way I added radvd is identical to dnsmasq. Unfortunately this
doesn't communicate the requirement downstream in a programmatic
fashion, so I guess we need to make sure that this is adequately
reported in the next set of release notes.
14 years, 2 months
[libvirt] potential bug in qemu snapshots
by Eric Blake
Right now, we create qemu snapshots to a file by using an exec: monitor
command that passes 'compressor | { dd && dd; }' with stdout connected
to the target file. However, since dd is using a larger bs= than
PIPE_MAX, it is conceivable that under heavy machine load, that dd will
get a short read from the pipe, and unless we use the GNU extension of
iflag=fullblock, that short read will be padded out to the output block
size and result in data corruption in the destination file.
The possibility of corruption due to short reads when dd is fed input
through a pipe but produces output through a large block size has
occurred several times on the coreutils mailing list:
http://lists.gnu.org/archive/html/bug-coreutils/2010-11/msg00092.html
Coreutils currently obeys the (non-intuitive) POSIX requirements for
this short read behavior, and while it is being considered to make dd
when POSIXLY_CORRECT is unset be more sensible, you can't rely on that
being a default.
Should we refuse to make snapshots if we don't detect the GNU extension
of 'dd iflag=fullblock'? Probably safe to do on GNU/Linux machines, but
I'm wondering if it will have negative effects on BSD machines where GNU
coreutils is not installed.
Is there a way to make monitor commands use fd: style migration, where
we can avoid dd altogether by just passing an already open fd that has
already positioned correctly via lseek()? Then again, it seems like fd:
migration requires passing an open fd, which only seems possible on the
command line at startup rather than something you can do on the fly with
monitor commands.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
14 years, 2 months
[libvirt] libvirt-java thoughts
by Stefan Majer
Hi,
we use libvirt-java in our kvm based virtualization infrastructure a
lot. Thanks therefor. Sometimes we see crashes of the libvirtd and i
was thinking of the right way to handle such a situation from the java
side.
My first aproach was to use the ErrorCallback:
Connect.setErrorCallback(new VirErrorCallback() {
@Override
public void errorCallback(Pointer arg0, virError error) {
// Do something usefull (reconnect for example)
}
}
);
} catch (LibvirtException e) {
LOG.error("Exception occurred. Stacktrace: ", e);
}
}
But this give me a jvm crash on shutdown of my application. No Idea why.
The next idea was to Intercept all calls to org.libvirt.Connect and
check if the connection is still working (isConnected) and reconnect
on false.
But the current API design makes this difficult and ugly, as Connect
is a concrete Class without an Interface.
Do you have any other Ideas ?
If no, do you probably accept patches which will resolve this issue ?
We can share Ideas what the best strategie could be.
Greetings
--
Stefan Majer
14 years, 2 months
[libvirt] [PATCH] esx: Fix "occurence" typo (again)
by Matthias Bolte
Also include some whitespace changes. No functional change included.
---
I pushed this one under the trivial rule.
Matthias
src/esx/esx_driver.c | 10 ++++++++++
src/esx/esx_vi.c | 25 ++++++++++++++-----------
src/esx/esx_vi.h | 8 ++++----
3 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 55847bc..2241532 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -2475,6 +2475,7 @@ esxDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
}
+
static int
esxDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
{
@@ -2482,6 +2483,7 @@ esxDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
}
+
static int
esxDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
{
@@ -2540,6 +2542,8 @@ esxDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
return priv->maxVcpus;
}
+
+
static int
esxDomainGetMaxVcpus(virDomainPtr domain)
{
@@ -2547,6 +2551,8 @@ esxDomainGetMaxVcpus(virDomainPtr domain)
VIR_DOMAIN_VCPU_MAXIMUM));
}
+
+
static char *
esxDomainDumpXML(virDomainPtr domain, int flags)
{
@@ -3809,12 +3815,16 @@ esxDomainIsPersistent(virDomainPtr domain ATTRIBUTE_UNUSED)
return 1;
}
+
+
static int
esxDomainIsUpdated(virDomainPtr domain ATTRIBUTE_UNUSED)
{
return 0;
}
+
+
static virDomainSnapshotPtr
esxDomainSnapshotCreateXML(virDomainPtr domain, const char *xmlDesc,
unsigned int flags)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 76be5a4..5dbf744 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -1812,7 +1812,7 @@ esxVI_GetVirtualMachineQuestionInfo
int
esxVI_GetBoolean(esxVI_ObjectContent *objectContent, const char *propertyName,
- esxVI_Boolean *value, esxVI_Occurrence occurence)
+ esxVI_Boolean *value, esxVI_Occurrence occurrence)
{
esxVI_DynamicProperty *dynamicProperty;
@@ -1835,7 +1835,7 @@ esxVI_GetBoolean(esxVI_ObjectContent *objectContent, const char *propertyName,
}
if (*value == esxVI_Boolean_Undefined &&
- occurence == esxVI_Occurrence_RequiredItem) {
+ occurrence == esxVI_Occurrence_RequiredItem) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Missing '%s' property"), propertyName);
return -1;
@@ -1844,9 +1844,11 @@ esxVI_GetBoolean(esxVI_ObjectContent *objectContent, const char *propertyName,
return 0;
}
+
+
int
esxVI_GetLong(esxVI_ObjectContent *objectContent, const char *propertyName,
- esxVI_Long **value, esxVI_Occurrence occurence)
+ esxVI_Long **value, esxVI_Occurrence occurrence)
{
esxVI_DynamicProperty *dynamicProperty;
@@ -1866,7 +1868,7 @@ esxVI_GetLong(esxVI_ObjectContent *objectContent, const char *propertyName,
}
}
- if (*value == NULL && occurence == esxVI_Occurrence_RequiredItem) {
+ if (*value == NULL && occurrence == esxVI_Occurrence_RequiredItem) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Missing '%s' property"), propertyName);
return -1;
@@ -1880,7 +1882,7 @@ esxVI_GetLong(esxVI_ObjectContent *objectContent, const char *propertyName,
int
esxVI_GetStringValue(esxVI_ObjectContent *objectContent,
const char *propertyName,
- char **value, esxVI_Occurrence occurence)
+ char **value, esxVI_Occurrence occurrence)
{
esxVI_DynamicProperty *dynamicProperty;
@@ -1902,7 +1904,7 @@ esxVI_GetStringValue(esxVI_ObjectContent *objectContent,
}
}
- if (*value == NULL && occurence == esxVI_Occurrence_RequiredItem) {
+ if (*value == NULL && occurrence == esxVI_Occurrence_RequiredItem) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Missing '%s' property"), propertyName);
return -1;
@@ -1917,7 +1919,7 @@ int
esxVI_GetManagedObjectReference(esxVI_ObjectContent *objectContent,
const char *propertyName,
esxVI_ManagedObjectReference **value,
- esxVI_Occurrence occurence)
+ esxVI_Occurrence occurrence)
{
esxVI_DynamicProperty *dynamicProperty;
@@ -1938,7 +1940,7 @@ esxVI_GetManagedObjectReference(esxVI_ObjectContent *objectContent,
}
}
- if (*value == NULL && occurence == esxVI_Occurrence_RequiredItem) {
+ if (*value == NULL && occurrence == esxVI_Occurrence_RequiredItem) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Missing '%s' property"), propertyName);
return -1;
@@ -2265,9 +2267,10 @@ esxVI_GetSnapshotTreeBySnapshot
-int esxVI_LookupHostSystemProperties(esxVI_Context *ctx,
- esxVI_String *propertyNameList,
- esxVI_ObjectContent **hostSystem)
+int
+esxVI_LookupHostSystemProperties(esxVI_Context *ctx,
+ esxVI_String *propertyNameList,
+ esxVI_ObjectContent **hostSystem)
{
return esxVI_LookupObjectContentByType(ctx, ctx->hostSystem->_reference,
"HostSystem", propertyNameList,
diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h
index d512add..553967b 100644
--- a/src/esx/esx_vi.h
+++ b/src/esx/esx_vi.h
@@ -300,19 +300,19 @@ int esxVI_GetVirtualMachineQuestionInfo
int esxVI_GetBoolean(esxVI_ObjectContent *objectContent,
const char *propertyName,
- esxVI_Boolean *value, esxVI_Occurrence occurence);
+ esxVI_Boolean *value, esxVI_Occurrence occurrence);
int esxVI_GetLong(esxVI_ObjectContent *objectContent, const char *propertyName,
- esxVI_Long **value, esxVI_Occurrence occurence);
+ esxVI_Long **value, esxVI_Occurrence occurrence);
int esxVI_GetStringValue(esxVI_ObjectContent *objectContent,
const char *propertyName,
- char **value, esxVI_Occurrence occurence);
+ char **value, esxVI_Occurrence occurrence);
int esxVI_GetManagedObjectReference(esxVI_ObjectContent *objectContent,
const char *propertyName,
esxVI_ManagedObjectReference **value,
- esxVI_Occurrence occurence);
+ esxVI_Occurrence occurrence);
int esxVI_LookupNumberOfDomainsByPowerState
(esxVI_Context *ctx, esxVI_VirtualMachinePowerState powerState,
--
1.7.0.4
14 years, 2 months
[libvirt] [TCK] [PATCH] Test cases for network ipv6 support
by Stefan Berger
This patch adds a couple of test cases for the recently added network
ipv6 support.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
---
scripts/networks/networkxml2hostout/tck-testnet-3.dat | 31
+++++++++++++
scripts/networks/networkxml2hostout/tck-testnet-3.post.dat | 12 +++++
scripts/networks/networkxml2xmlin/tck-testnet-3.xml | 22
+++++++++
3 files changed, 65 insertions(+)
Index: libvirt-tck/scripts/networks/networkxml2xmlin/tck-testnet-3.xml
===================================================================
--- /dev/null
+++ libvirt-tck/scripts/networks/networkxml2xmlin/tck-testnet-3.xml
@@ -0,0 +1,22 @@
+<network>
+ <name>tck-testnet</name>
+ <uuid>aadc8920-502a-4774-ac2b-cd382a204d06</uuid>
+ <bridge name="tck-testbr" />
+ <forward mode="nat" />
+ <ip address="10.1.2.1" netmask="255.255.255.0">
+ <dhcp>
+ <range start="10.1.2.2" end="10.1.2.254" />
+ <host mac="00:16:3e:77:e2:ed" name="a.example.com" ip="10.1.2.10" />
+ <host mac="00:16:3e:3e:a9:1a" name="b.example.com" ip="10.1.2.11" />
+ </dhcp>
+ </ip>
+ <ip family="ipv4" address="192.168.123.1" netmask="255.255.255.0">
+ </ip>
+ <ip family="ipv6" address="2001:db8:ac10:fe01::1" prefix="64">
+ </ip>
+ <ip family="ipv6" address="2001:db8:ac10:fd01::1" prefix="64">
+ </ip>
+ <ip family="ipv4" address="10.24.10.1">
+ </ip>
+</network>
+
Index: libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.dat
===================================================================
--- /dev/null
+++ libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.dat
@@ -0,0 +1,31 @@
+#iptables -t nat -L -n | grep ' 10\.1\.2\.'
+MASQUERADE tcp -- 10.1.2.0/24 !10.1.2.0/24 masq
ports: 1024-65535
+MASQUERADE udp -- 10.1.2.0/24 !10.1.2.0/24 masq
ports: 1024-65535
+MASQUERADE all -- 10.1.2.0/24 !10.1.2.0/24
+#iptables -n -L FORWARD | grep ' 10\.1\.2\.'
+ACCEPT all -- 0.0.0.0/0 10.1.2.0/24 state
RELATED,ESTABLISHED
+ACCEPT all -- 10.1.2.0/24 0.0.0.0/0
+#ip6tables -n -L FORWARD | grep ' 2001:db8:ac10'
+ACCEPT all ::/0 2001:db8:ac10:fd01::/64
+ACCEPT all 2001:db8:ac10:fd01::/64 ::/0
+ACCEPT all ::/0 2001:db8:ac10:fe01::/64
+ACCEPT all 2001:db8:ac10:fe01::/64 ::/0
+#ps aux | sed -n '/dnsmasq .*10\.1\.2\./ s|.*\(dnsmasq [[:print:]*]\)|\1|p'
+dnsmasq --strict-order --bind-interfaces
--pid-file=/var/run/libvirt/network/tck-testnet.pid --conf-file=
--listen-address 10.1.2.1 --except-interface lo --dhcp-range
10.1.2.2,10.1.2.254 --dhcp-lease-max=253 --dhcp-no-override
+#ps aux | sed -n '/radvd .*tck\-testnet\-/ s|.*\(radvd [[:print:]*]\)|\1|p'
+radvd --debug 1 --config /var/lib/libvirt/radvd/tck-testnet-radvd.conf
--pidfile /var/run/libvirt/network/tck-testnet-radvd.pid-bin
+#route -n | grep '10\.1\.2\.'
+10.1.2.0 0.0.0.0 255.255.255.0 U 0 0 0
tck-testbr
+#route -n | grep '192\.168\.123\.'
+192.168.123.0 0.0.0.0 255.255.255.0 U 0 0 0
tck-testbr
+#route -n | grep '10\.0\.0\.0'
+10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0
tck-testbr
+#brctl show | grep tck-testbr
+tck-testbr 8000.000000000000 yes
+#ifconfig tck-testbr | grep ':10\.1\.2\.'
+ inet addr:10.1.2.1 Bcast:10.1.2.255 Mask:255.255.255.0
+#ifconfig tck-testbr | grep 'inet6 addr: 2001'
+ inet6 addr: 2001:db8:ac10:fd01::1/64 Scope:Global
+ inet6 addr: 2001:db8:ac10:fe01::1/64 Scope:Global
+#virsh net-list | grep tck-testnet
+tck-testnet active no
Index:
libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat
===================================================================
--- /dev/null
+++ libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat
@@ -0,0 +1,12 @@
+#iptables -t nat -L -n | grep ' 10\.1\.2\.'
+#iptables -n -L FORWARD | grep ' 10\.1\.2\.'
+#ip6tables -n -L FORWARD | grep ' 2001:db8:ac10'
+#ps aux | sed -n '/dnsmasq .*10\.1\.2\./ s|.*\(dnsmasq [[:print:]*]\)|\1|p'
+#ps aux | sed -n '/radvd .*tck\-testnet\-/ s|.*\(radvd [[:print:]*]\)|\1|p'
+#route -n | grep '10\.1\.2\.'
+#route -n | grep '192\.168\.123\.'
+#route -n | grep '10\.0\.0\.0'
+#brctl show | grep tck-testbr
+#ifconfig tck-testbr 2>/dev/null | grep ':10\.1\.2\.'
+#ifconfig tck-testbr 2>/dev/null | grep 'inet6 addr: 2001'
+#virsh net-list | grep tck-testnet
14 years, 2 months