[libvirt] vhost-net on ethernet interface type
by Raja Sivaramakrishnan
Hello,
I would like to enable vhost-net on an interface of ethernet type. However,
this doesn't work, probably due to the following code in libvirt.
if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
/* Attempt to use vhost-net mode for these types of
network device */
Can VIR_DOMAIN_NET_TYPE_ETHERNET also be included in the check
above? Or is there some reason to disable vhost-net for this type?
Thanks,
Raja
12 years, 4 months
[libvirt] [PATCH 0/8] Dump domain's IP addresses
by Michal Privoznik
It's been a while since I tried get this in. I've reworked the
patches, the exposed API, and start new round of reviews.
Moreover, during work I've come to point, where extending qemu
guest agent seemed wise:
http://lists.nongnu.org/archive/html/qemu-devel/2012-12/msg03264.html
Therefore I am introducing 'flags' field, which can contain some
boolean values we don't have yet, e.g. IFF_UP, IFF_PROMISC, etc.
Re: 'dstaddr' field in struct _virDomainInterfaceIPAddress;
It's basically a join of:
union {
char *dstaddr; /* for IFF_POINTOPOINT interface */
char *broadaddr; /* for IFF_BROADCAST interface */
}
Since an interface cannot has both flags set (see man 3
getifaddrs) I've joined both into one 'char *dstaddr'. I know it
is not mnemonic as the union, so I left it for discussion. I can
change it if you want to.
Michal Privoznik (8):
Introduce virDomainInterfacesAddresses API
Introduce virDomainInterfaceFree API
qemu_agent: Implement 'guest-network-get-interfaces' command handling
qemu: Implement qemuDomainInterfacesAddresses
virsh: Expose virDomainInterfacesAddresses
remote: Implement virDomainInterfacesAddresses
python: Expose virDomainInterfacesAddresses
python: create example for dumping domain IP addresses
daemon/remote.c | 138 +++++++++++++++++++++++++++++++++
examples/python/Makefile.am | 2 +-
examples/python/README | 1 +
examples/python/domipaddrs.py | 50 ++++++++++++
include/libvirt/libvirt.h.in | 52 +++++++++++++
python/generator.py | 3 +
python/libvirt-override-api.xml | 7 ++
python/libvirt-override.c | 120 +++++++++++++++++++++++++++++
src/driver.h | 6 ++
src/libvirt.c | 102 +++++++++++++++++++++++++
src/libvirt_public.syms | 7 ++
src/qemu/qemu_agent.c | 164 ++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 2 +
src/qemu/qemu_driver.c | 68 +++++++++++++++++
src/remote/remote_driver.c | 86 +++++++++++++++++++++
src/remote/remote_protocol.x | 27 ++++++-
src/remote_protocol-structs | 27 +++++++
tools/virsh-domain.c | 102 +++++++++++++++++++++++++
18 files changed, 962 insertions(+), 2 deletions(-)
create mode 100755 examples/python/domipaddrs.py
--
1.8.0.2
12 years, 4 months
[libvirt] [PATCH 0/6] BUG fix for PowerPC.
by Li Zhang
From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
This patch series is to fix bugs on PowerPC we found when testing
libvirt.
Li Zhang (6):
Set std VGA model as default model for ppc64.
Use -machine option for PPC64
Remove QEMU_CAPS_NO_ACPI capability for non-x86 platform
Support all backend serial devices for pSeries guest
Set the default machine as pseries for PPC64
Use help string "-device driver," when getting additional caps.
src/conf/capabilities.c | 6 ++++
src/conf/domain_conf.c | 2 ++
src/qemu/qemu_capabilities.c | 12 ++++++--
src/qemu/qemu_command.c | 31 +++++++++++---------
.../qemuxml2argv-machine-core-off.args | 2 +-
.../qemuxml2argv-machine-core-on.args | 2 +-
.../qemuxml2argv-pseries-basic.args | 2 +-
.../qemuxml2argv-pseries-vio-user-assigned.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 2 +-
9 files changed, 39 insertions(+), 22 deletions(-)
--
1.7.10.1
12 years, 4 months
[libvirt] [PATCH v2 0/28] Rename files in src/util to have a 'vir' prefix
by Daniel P. Berrange
Currently the files in src/util are 50/50 split between those
having a 'vir' prefix and those which don't. Finish the job
by remaining all remaining files to have a 'vir' prefix too,
guaranteeing that they can't clash with system headers[1].
The only case which was not a plain rename, was merging
processinfo.{c,h} into the virprocess.{c,h} since the
functionality logically belongs together.
At the end src/Makefile.am is updated to sort util files
alphabetically.
Left as further work - make sure all functions in these
files also have a 'vir' prefix. eg dnsmasq, ebtables,
iptables, usb and pci files are violators in this regard.
Also left, much of virutil.c should move into virfile.c
Changes in v2:
- Rebased to latest GIT
- Turned on rename detection to make review easier
Daniel
[1] Not a theoretical problem - we already hit a clsah
on 'usb.h' before forcing us to use 'hostusb.h'
and 'memory.h' clashes with a system header but we
never noticed so far.
In-Reply-To:
12 years, 4 months
[libvirt] [test-API][PATCH] managedsave: change the checking method about bypass cache
by hongming
Check whether the O_DIRECT flag is in use on the managed save file
during the duration of the managed save, since that is the real effect
of the current implementation of the --bypass-cache flag.
---
repos/managedsave/managedsave.py | 66 +++++++++++++++++++------------------
1 files changed, 34 insertions(+), 32 deletions(-)
diff --git a/repos/managedsave/managedsave.py b/repos/managedsave/managedsave.py
index 4a92151..b898876 100644
--- a/repos/managedsave/managedsave.py
+++ b/repos/managedsave/managedsave.py
@@ -2,6 +2,8 @@
import os
import math
+import thread
+import time
import libvirt
from libvirt import libvirtError
@@ -39,39 +41,42 @@ def check_savefile_create(*args):
logger.info("managed save file exists")
return True
-def compare_cachedfile(cachebefore, cacheafter):
- """Compare cached value before managed save and its value after
- managed save """
-
- diff = cacheafter - cachebefore
- logger.info("diff is %s " % diff)
- percent = math.fabs(diff)/cachebefore
- logger.info("diff percent is %s " % percent)
- if percent < 0.05:
- return True
- else:
- return False
-
-def get_cachevalue():
- """Get the file system cached value """
-
- cmds = "head -n4 /proc/meminfo|grep Cached|awk '{print $2}'"
- (status, output) = utils.exec_cmd(cmds, shell=True)
- if status != 0:
- logger.error("Fail to run cmd line to get cache")
- return 1
+def get_fileflags():
+ """Get the file flags of managed save file"""
+ cmds = "cat /proc/$(lsof -w /var/lib/libvirt/qemu/save/"+guestname+".save"\
+ "|awk '/libvirt_i/{print $2}')/fdinfo/1|grep flags|awk '{print $NF}'"
+ global fileflags
+ while True:
+ (status, output) = utils.exec_cmd(cmds, shell=True)
+ if status == 0:
+ for i in range(len(output)):
+ logger.info("The flags of saved file %s" % output[i])
+ fileflags = output[i][-5]
+ else:
+ logger.error("Fail to get the flags of saved file")
+ return 1
+
+ thread.exit_thread()
+
+def check_fileflag(fileflags):
+ """Check the file flags of managed save file if include O_DIRECT"""
+ if int(fileflags) == 4:
+ logger.info("file flags include O_DIRECT")
+ return True
else:
- logger.debug(output[0])
- cachevalue= int(output[0])
- return cachevalue
+ logger.error("file flags doesn't include O_DIRECT")
+ return False
def managedsave(params):
"""Managed save a running domain"""
global logger
logger = params['logger']
+ global guestname
guestname = params['guestname']
flags = params ['flags']
+ global fileflags
+ fileflags = ''
#Save given flags to sharedmod.data
sharedmod.data['flagsave'] = flags
@@ -122,17 +127,14 @@ def managedsave(params):
#If given flags include bypass-cache,check if bypass file system cache
if flagn % 2 == 1:
- logger.info("Given flags include --bypass-cache")
- os.system('echo 3 > /proc/sys/vm/drop_caches')
- cache_before = get_cachevalue()
- logger.info("Cached value before managedsave is %s" % cache_before)
+ logger.info("Given flags include --bypass-cache")
+ thread.start_new_thread(get_fileflags,())
+ # Guarantee get_fileflags shell has run before managed save
+ time.sleep(5)
domobj.managedSave(flagn)
- cache_after = get_cachevalue()
- logger.info("Cached value after managedsave is %s" % cache_after)
-
- if compare_cachedfile(cache_before, cache_after):
+ if check_fileflag(fileflags):
logger.info("Bypass file system cache successfully")
else:
logger.error("Bypass file system cache failed")
--
1.7.7.6
12 years, 4 months
[libvirt] [PATCH 0/2] account for change in netlink kernel ABI
by Laine Stump
The first of these two patches changes libvirt to account for a change
in netlink's kernel ABI that happened upstream several months ago. The
second patch adds in error logs to the functions that failed after the
kernel change.
Laine Stump (2):
util: fix functions that retrieve SRIOV VF info
util: add missing error log messages when failing to get netlink
VFINFO
src/util/virnetdev.c | 87 +++++++++++++++++++++++++++++-----------------------
1 file changed, 49 insertions(+), 38 deletions(-)
--
1.7.11.7
12 years, 4 months
[libvirt] [PATCH 1/1] Add sysinfo data and enable virSysinfoRead test case for POWER
by Li Zhang
From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
This patch is to enable virSysinfoRead test case for POWER,
and provide sysinfo data on POWER.
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
Reviewed-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
tests/sysinfodata/ppccpuinfo.data | 85 ++++++++++++++++++++++++++++++++++
tests/sysinfodata/ppcsysinfo.expect | 87 +++++++++++++++++++++++++++++++++++
tests/sysinfotest.c | 25 ----------
3 files changed, 172 insertions(+), 25 deletions(-)
create mode 100644 tests/sysinfodata/ppccpuinfo.data
create mode 100644 tests/sysinfodata/ppcsysinfo.expect
diff --git a/tests/sysinfodata/ppccpuinfo.data b/tests/sysinfodata/ppccpuinfo.data
new file mode 100644
index 0000000..bf4433c
--- /dev/null
+++ b/tests/sysinfodata/ppccpuinfo.data
@@ -0,0 +1,85 @@
+processor : 0
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 4
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 8
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 12
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 16
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 20
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 24
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 28
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 32
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 36
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 40
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 44
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 48
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 52
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 56
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+processor : 60
+cpu : POWER7 (raw), altivec supported
+clock : 8.388608MHz
+revision : 2.3 (pvr 003f 0203)
+
+timebase : 512000000
+platform : PowerNV
+model : 8246-L2C
+machine : PowerNV 8246-L2C
+firmware : OPAL v2
diff --git a/tests/sysinfodata/ppcsysinfo.expect b/tests/sysinfodata/ppcsysinfo.expect
new file mode 100644
index 0000000..32407e0
--- /dev/null
+++ b/tests/sysinfodata/ppcsysinfo.expect
@@ -0,0 +1,87 @@
+<sysinfo type='smbios'>
+ <system>
+ <entry name='version'>PowerNV 8246-L2C</entry>
+ <entry name='serial'>8246-L2C</entry>
+ <entry name='family'>PowerNV</entry>
+ </system>
+ <processor>
+ <entry name='socket_destination'>0</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>4</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>8</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>12</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>16</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>20</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>24</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>28</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>32</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>36</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>40</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>44</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>48</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>52</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>56</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+ <processor>
+ <entry name='socket_destination'>60</entry>
+ <entry name='type'>POWER7 (raw), altivec supported</entry>
+ <entry name='version'>2.3 (pvr 003f 0203)</entry>
+ </processor>
+</sysinfo>
diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c
index 79ee128..353bc76 100644
--- a/tests/sysinfotest.c
+++ b/tests/sysinfotest.c
@@ -50,27 +50,6 @@ struct testSysinfoData {
char *expected; /* (required) file containing output of virSysinfoFormat */
};
-# if defined(__powerpc__) || defined(__powerpc64__)
-/* TODO ppc: remove the if defined() branch
- to enable the real test run after providing test data, see below.
- */
-static int
-testSysinfo(const void *data ATTRIBUTE_UNUSED)
-{
- return EXIT_AM_SKIP;
-}
-
-static int
-sysinfotest_run(const char *test ATTRIBUTE_UNUSED,
- const char *decoder ATTRIBUTE_UNUSED,
- const char *sysinfo ATTRIBUTE_UNUSED,
- const char *cpuinfo ATTRIBUTE_UNUSED,
- const char *expected ATTRIBUTE_UNUSED)
-{
- return testSysinfo(NULL);
-}
-# else
-
static int
testSysinfo(const void *data)
{
@@ -143,7 +122,6 @@ error:
VIR_FREE(testdata.expected);
return ret;
}
-# endif /* defined(__powerpc__) ... */
# if defined(__s390__) || defined(__s390x__)
static int
@@ -158,9 +136,6 @@ test_s390(void)
VIRT_TEST_MAIN(test_s390)
# elif defined(__powerpc__) || defined(__powerpc64__)
-/* TODO for PPC owner: provide test data
- and enable the real sysinfotest_run above
-*/
static int
test_ppc(void)
{
--
1.7.10.1
12 years, 4 months
[libvirt] [PATCH] security: fix #endif comment in security_stack.h
by Ján Tomko
---
Pushed under the trivial rule.
---
src/security/security_stack.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/security/security_stack.h b/src/security/security_stack.h
index 4ba55f7..b38f9a9 100644
--- a/src/security/security_stack.h
+++ b/src/security/security_stack.h
@@ -35,4 +35,4 @@ virSecurityStackGetPrimary(virSecurityManagerPtr mgr);
virSecurityManagerPtr*
virSecurityStackGetNested(virSecurityManagerPtr mgr);
-#endif /* __VIR_SECURITY_DAC */
+#endif /* __VIR_SECURITY_STACK */
--
1.7.8.6
12 years, 4 months
[libvirt] [PATCH 0/5] Miscellaneous cleanups
by Martin Kletzander
My cleanup branch got up to 5 commits so in order to get rid of it,
I'm sending it. Some of them could be most probably pushed as
trivial, but since some are older (even though the commit date is
new), I'm sending it in the pack together.
Martin Kletzander (5):
fix typo in the word affinities
conf: minor indentation cleanups
conf: Don't format cputune element when not needed
conf: eliminate redundant use of VIR_ALLOC
docs: aesthetical cleanups
docs/hacking.html.in | 12 ++++----
src/conf/domain_conf.c | 80 ++++++++++++++++++++++--------------------------
src/libxl/libxl_driver.c | 4 +--
src/qemu/qemu_process.c | 8 ++---
4 files changed, 48 insertions(+), 56 deletions(-)
--
1.8.0.2
12 years, 4 months
[libvirt] [PATCH] conf: cpu: Fix to escape cpu model, vendor_id and vendor
by Ken ICHIKAWA
This patch fixes a problem that encoded xml special charas
of cpu model, vendor_id and vendor are saved as decoded xml
special charas.
If I define model name including encoded xml special charas
in domain XML like below:
<domain>
<cpu mode='custom' match='exact'>
<model fallback='allow'>><</model>
</cpu>
</domain>
domain xml definition file is saved as
<domain>
<cpu mode='custom' match='exact'>
<model fallback='allow'>><</model>
</cpu>
</domain>
After that, if libvirtd is restarted, dumpxml command, edit
command and etc. are disabled with below error until I stop
libvirtd and fix the xml file manually.
2012-12-20 04:56:54.371+0000: 11893: error : catchXMLError:691 :
/etc/libvirt/qemu/f17.xml:25: StartTag: invalid element name
<model fallback='allow'>><</model>
------------------------------^
Also vendor_id and vendor have same problem.
Signed-off-by: Ken ICHIKAWA <ichikawa.ken(a)jp.fujitsu.com>
---
src/conf/cpu_conf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 3973c83..e9f9431 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -609,17 +609,17 @@ virCPUDefFormatBuf(virBufferPtr buf,
}
virBufferAsprintf(buf, " fallback='%s'", fallback);
if (def->vendor_id)
- virBufferAsprintf(buf, " vendor_id='%s'", def->vendor_id);
+ virBufferEscapeString(buf, " vendor_id='%s'", def->vendor_id);
}
if (formatModel && def->model) {
- virBufferAsprintf(buf, ">%s</model>\n", def->model);
+ virBufferEscapeString(buf, ">%s</model>\n", def->model);
} else {
virBufferAddLit(buf, "/>\n");
}
}
if (formatModel && def->vendor)
- virBufferAsprintf(buf, "<vendor>%s</vendor>\n", def->vendor);
+ virBufferEscapeString(buf, "<vendor>%s</vendor>\n", def->vendor);
if (def->sockets && def->cores && def->threads) {
virBufferAddLit(buf, "<topology");
--
1.7.11.7
12 years, 4 months