[libvirt] (no subject)
by Wido den Hollander
The current code of libvirt-java does not build with Java 7.
This patch updates the build.properties and INSTALL that we
require Java 8 to build libvirt-java.
9 years, 3 months
[libvirt] [PATCH] target-i386: Enable "check" mode by default
by Eduardo Habkost
Current default behavior of QEMU is to silently disable features that
are not supported by the host when a CPU model is requested in the
command-line. This means that in addition to risking breaking guest ABI
by default, we are silent about it.
I would like to enable "enforce" by default, but this can easily break
existing production systems because of the way libvirt makes assumptions
about CPU models today (this will change in the future, once QEMU
provide a proper interface for checking if a CPU model is runnable).
But there's no reason we should be silent about it. So, change
target-i386 to enable "check" mode by default so at least we have some
warning printed to stderr (and hopefully logged somewhere) when QEMU
disables a feature that is not supported by the host system.
Signed-off-by: Eduardo Habkost <ehabkost(a)redhat.com>
---
target-i386/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index cfb8aa7..32fee00 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -3121,7 +3121,7 @@ static Property x86_cpu_properties[] = {
DEFINE_PROP_BOOL("hv-relaxed", X86CPU, hyperv_relaxed_timing, false),
DEFINE_PROP_BOOL("hv-vapic", X86CPU, hyperv_vapic, false),
DEFINE_PROP_BOOL("hv-time", X86CPU, hyperv_time, false),
- DEFINE_PROP_BOOL("check", X86CPU, check_cpuid, false),
+ DEFINE_PROP_BOOL("check", X86CPU, check_cpuid, true),
DEFINE_PROP_BOOL("enforce", X86CPU, enforce_cpuid, false),
DEFINE_PROP_BOOL("kvm", X86CPU, expose_kvm, true),
DEFINE_PROP_UINT32("level", X86CPU, env.cpuid_level, 0),
--
2.1.0
9 years, 3 months
[libvirt] [sandbox PATCH v4 00/21] *** virt-sandbox-image v4 ***
by Eren Yagdiran
Hi,
Running sandbox now has its own disk layer.
virt-sandbox now using GHashMap to store key value pairs for environment variables
and some minor changes.
Daniel P Berrange (1):
Add virt-sandbox-image
Eren Yagdiran (20):
Fix virt-sandbox-image
Image: Add Hooking Mechanism
Image: virt-sandbox-image default dir constants
Image: Discard caching bytecode
Image: Add check_writable and runtime resolver
Image: Add download function
Image: Refactor create function
Image: Add delete function
Image: Add get_command function to Source
Image: Add run args
Image: Add check_connect function
Image: Add get_disk function to Source
Image: Add run function
Image: Add network support
Image: Add Volume Support
Image: man file for virt-sandbox-image
Add config for environment variables
Add environment parameter to virt-sandbox
init-common: Exporting custom environment variables
Image: Add custom environment support
.gitignore | 1 +
bin/Makefile.am | 21 +-
bin/virt-sandbox-image.in | 3 +
bin/virt-sandbox-image.pod | 172 +++++++++++
bin/virt-sandbox.c | 14 +
configure.ac | 2 +
libvirt-sandbox/libvirt-sandbox-config.c | 171 ++++++++++-
libvirt-sandbox/libvirt-sandbox-config.h | 13 +
libvirt-sandbox/libvirt-sandbox-init-common.c | 18 ++
libvirt-sandbox/libvirt-sandbox.sym | 6 +
libvirt-sandbox/tests/test-config.c | 10 +
po/POTFILES.in | 1 +
virt-sandbox-image/Makefile.am | 14 +
virt-sandbox-image/sources/DockerSource.py | 419 ++++++++++++++++++++++++++
virt-sandbox-image/sources/Source.py | 55 ++++
virt-sandbox-image/sources/__init__.py | 26 ++
virt-sandbox-image/virt-sandbox-image.py | 306 +++++++++++++++++++
17 files changed, 1247 insertions(+), 5 deletions(-)
create mode 100644 bin/virt-sandbox-image.in
create mode 100644 bin/virt-sandbox-image.pod
create mode 100644 virt-sandbox-image/Makefile.am
create mode 100644 virt-sandbox-image/sources/DockerSource.py
create mode 100644 virt-sandbox-image/sources/Source.py
create mode 100644 virt-sandbox-image/sources/__init__.py
create mode 100755 virt-sandbox-image/virt-sandbox-image.py
--
2.1.0
9 years, 3 months
[libvirt] [PATCH] docs: Drop unused rule for internals/%.html.tmp target
by Guido Günther
We're using the %.html.tmp for all html files now so drop the unused one
and rather make sure the needed directory exists.
This fixes build failures as described in
https://www.redhat.com/archives/libvir-list/2015-August/msg00603.html
---
configure.ac | 1 +
docs/Makefile.am | 9 ---------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9066ed6..749dbb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2774,6 +2774,7 @@ AC_DEFINE_UNQUOTED([isbase64],[libvirt_gl_isbase64],[Hack to avoid symbol clash]
AC_DEFINE_UNQUOTED([base64_encode],[libvirt_gl_base64_encode],[Hack to avoid symbol clash])
AC_DEFINE_UNQUOTED([base64_encode_alloc],[libvirt_gl_base64_encode_alloc],[Hack to avoid symbol clash])
+AC_CONFIG_COMMANDS([mkdir], [$MKDIR_P docs/internals])
AC_CONFIG_FILES([run],
[chmod +x,-w run])
AC_CONFIG_FILES([\
diff --git a/docs/Makefile.am b/docs/Makefile.am
index daf37b6..563baca 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -218,15 +218,6 @@ $(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \
%.png: %.fig
convert -rotate 90 $< $@
-internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
- @if [ -x $(XSLTPROC) ] ; then \
- echo "Generating $@"; \
- $(MKDIR_P) internals; \
- name=`echo $@ | sed -e 's/.tmp//'`; \
- $(XSLTPROC) --stringparam pagename $$name --nonet \
- $(top_srcdir)/docs/subsite.xsl $< > $@ \
- || { rm $@ && exit 1; }; fi
-
%.html.tmp: %.html.in site.xsl page.xsl sitemap.html.in $(acl_generated)
@if [ -x $(XSLTPROC) ] ; then \
echo "Generating $@"; \
--
2.1.4
9 years, 3 months
[libvirt] [PATCHv3 0/2] Added waiting for DAD to finish for bridge address.
by Maxim Perevedentsev
This is a fix for commit db488c79173b240459c7754f38c3c6af9b432970
dnsmasq main process which is relied on when waiting for DAD to complete
exits without actually waiting for DAD. This is dnsmasq daemon's task.
It seems to be a race that DAD finished before dnsmasq main process exited.
The above commit needs the execution to block until DAD finishes
for bridge IPv6 address because then it closes dummy tap device.
Thus we need to ensure this ourselves.
So we periodically poll the kernel using netlink and
check whether there are any IPv6 addresses assigned to bridge
which have 'tentative' state. After DAD is finished, execution continues.
I guess that is what dnsmasq was assumed to do.
We use netlink to dump information about existing IPv6 addresses. Netlink's
response is a multi-part message. Unfortunately, the current implementation
of virNetlink treats such messages as faulty and throws an error. So the patch 2/2
adds multi-part nelink response support.
Update v2: fixed syntax.
Update v3: moved to virnetdev.
Maxim Perevedentsev (2):
network: added waiting for DAD to finish for bridge address.
Add support for multi-part netlink messages.
src/libvirt_private.syms | 1 +
src/network/bridge_driver.c | 35 +++++++++-
src/util/virnetdev.c | 160 ++++++++++++++++++++++++++++++++++++++++++++
src/util/virnetdev.h | 2 +
src/util/virnetlink.c | 4 +-
5 files changed, 200 insertions(+), 2 deletions(-)
--
Sincerely,
Maxim Perevedentsev
9 years, 3 months
[libvirt] [PATCH libvirt master] interface type: add udp socket support
by Jonathan Toppins
Adds a new interface type using UDP sockets, this seems only applicable
to QEMU but have edited tree-wide to support the new interface type.
The interface type required the addition of a "destaddr" (destination
address), this then maps into the following xml and qemu call.
<interface type='udp'>
<mac address='52:54:00:5c:67:56'/>
<source address='127.0.0.1' port='11112'/>
<model type='virtio'/>
<dest address="127.0.0.1' port='22222'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
...
QEMU call:
-netdev socket,udp=127.0.0.1:22222,localaddr=127.0.0.1:11112
Notice the xml "source" entry becomes the "localaddr" for the qemu call.
reference:
http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg00629.html
Signed-off-by: Jonathan Toppins <jtoppins(a)cumulusnetworks.com>
---
docs/formatdomain.html.in | 17 ++++++++++++
src/conf/domain_conf.c | 56 +++++++++++++++++++++++++++++++++++++---
src/conf/domain_conf.h | 3 +++
src/conf/netdev_bandwidth_conf.h | 1 +
src/libxl/libxl_conf.c | 1 +
src/lxc/lxc_controller.c | 1 +
src/lxc/lxc_process.c | 1 +
src/qemu/qemu_command.c | 12 +++++++++
src/qemu/qemu_hotplug.c | 1 +
src/qemu/qemu_interface.c | 2 ++
src/uml/uml_conf.c | 5 ++++
src/xenconfig/xen_sxpr.c | 1 +
tools/virsh-domain.c | 1 +
13 files changed, 99 insertions(+), 3 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index c0a265a..95f7f5d 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4165,6 +4165,23 @@
</devices>
...</pre>
+ <h5><a name="elementsNICSUDP">UDP unicast tunnel</a></h5>
+
+ <p>
+ A UDP unicast architecture provides a virtual network which enables
+ connections between Qemu instances using Qemu's UDP infrastructure.</p>
+
+<pre>
+ ...
+ <devices>
+ <interface type='udp'>
+ <mac address='52:54:00:22:c9:42'/>
+ <source address='127.0.0.1' port='11115'/>
+ <dest address='127.0.0.1' port='11116'/>
+ </interface>
+ </devices>
+ ...</pre>
+
<h5><a name="elementsNICSModel">Setting the NIC model</a></h5>
<pre>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e4114f8..11961ea 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -385,7 +385,8 @@ VIR_ENUM_IMPL(virDomainNet, VIR_DOMAIN_NET_TYPE_LAST,
"bridge",
"internal",
"direct",
- "hostdev")
+ "hostdev",
+ "udp")
VIR_ENUM_IMPL(virDomainNetBackend, VIR_DOMAIN_NET_BACKEND_TYPE_LAST,
"default",
@@ -1629,7 +1630,9 @@ void virDomainNetDefFree(virDomainNetDefPtr def)
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
VIR_FREE(def->data.socket.address);
+ VIR_FREE(def->data.socket.destaddr);
break;
case VIR_DOMAIN_NET_TYPE_NETWORK:
@@ -8398,6 +8401,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
char *script = NULL;
char *address = NULL;
char *port = NULL;
+ char *destaddr = NULL;
+ char *destport = NULL;
char *model = NULL;
char *backend = NULL;
char *txmode = NULL;
@@ -8510,10 +8515,15 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
} else if (!address &&
(def->type == VIR_DOMAIN_NET_TYPE_SERVER ||
def->type == VIR_DOMAIN_NET_TYPE_CLIENT ||
- def->type == VIR_DOMAIN_NET_TYPE_MCAST) &&
+ def->type == VIR_DOMAIN_NET_TYPE_MCAST ||
+ def->type == VIR_DOMAIN_NET_TYPE_UDP) &&
xmlStrEqual(cur->name, BAD_CAST "source")) {
address = virXMLPropString(cur, "address");
port = virXMLPropString(cur, "port");
+ } else if (!destaddr && def->type == VIR_DOMAIN_NET_TYPE_UDP &&
+ xmlStrEqual(cur->name, BAD_CAST "dest")) {
+ destaddr = virXMLPropString(cur, "address");
+ destport = virXMLPropString(cur, "port");
} else if (xmlStrEqual(cur->name, BAD_CAST "ip")) {
virDomainNetIpDefPtr ip = NULL;
@@ -8751,6 +8761,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
if (port == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("No <source> 'port' attribute "
@@ -8766,7 +8777,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
if (address == NULL) {
if (def->type == VIR_DOMAIN_NET_TYPE_CLIENT ||
- def->type == VIR_DOMAIN_NET_TYPE_MCAST) {
+ def->type == VIR_DOMAIN_NET_TYPE_MCAST ||
+ def->type == VIR_DOMAIN_NET_TYPE_UDP) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("No <source> 'address' attribute "
"specified with socket interface"));
@@ -8776,6 +8788,32 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
def->data.socket.address = address;
address = NULL;
}
+
+ if (def->type != VIR_DOMAIN_NET_TYPE_UDP)
+ break;
+
+ if (destport == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No <dest> 'port' attribute "
+ "specified with socket interface"));
+ goto error;
+ }
+ if (virStrToLong_i(destport, NULL, 10, &def->data.socket.destport) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot parse <dest> 'port' attribute "
+ "with socket interface"));
+ goto error;
+ }
+
+ if (destport == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No <dest> 'address' attribute "
+ "specified with socket interface"));
+ goto error;
+ } else {
+ def->data.socket.destaddr = destaddr;
+ address = NULL;
+ }
break;
case VIR_DOMAIN_NET_TYPE_INTERNAL:
@@ -19732,6 +19770,7 @@ virDomainNetDefFormat(virBufferPtr buf,
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
if (def->data.socket.address) {
virBufferAsprintf(buf, "<source address='%s' port='%d'/>\n",
def->data.socket.address, def->data.socket.port);
@@ -19739,6 +19778,17 @@ virDomainNetDefFormat(virBufferPtr buf,
virBufferAsprintf(buf, "<source port='%d'/>\n",
def->data.socket.port);
}
+
+ if (def->type != VIR_DOMAIN_NET_TYPE_UDP)
+ break;
+
+ if (def->data.socket.destaddr) {
+ virBufferAsprintf(buf, "<dest address='%s' port='%d'/>\n",
+ def->data.socket.destaddr, def->data.socket.destport);
+ } else {
+ virBufferAsprintf(buf, "<dest port='%d'/>\n",
+ def->data.socket.destport);
+ }
break;
case VIR_DOMAIN_NET_TYPE_INTERNAL:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 698a4d2..e96fece 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -889,6 +889,7 @@ typedef enum {
VIR_DOMAIN_NET_TYPE_INTERNAL,
VIR_DOMAIN_NET_TYPE_DIRECT,
VIR_DOMAIN_NET_TYPE_HOSTDEV,
+ VIR_DOMAIN_NET_TYPE_UDP,
VIR_DOMAIN_NET_TYPE_LAST
} virDomainNetType;
@@ -991,6 +992,8 @@ struct _virDomainNetDef {
struct {
char *address;
int port;
+ char *destaddr;
+ int destport;
} socket; /* any of NET_CLIENT or NET_SERVER or NET_MCAST */
struct {
char *name;
diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_conf.h
index 6cbf4ae..cdeac09 100644
--- a/src/conf/netdev_bandwidth_conf.h
+++ b/src/conf/netdev_bandwidth_conf.h
@@ -53,6 +53,7 @@ static inline bool virNetDevSupportBandwidth(virDomainNetType type)
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_LAST:
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index e845759..a76ad5a 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1177,6 +1177,7 @@ libxlMakeNic(virDomainDefPtr def,
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_DIRECT:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 110a556..03d6311 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -382,6 +382,7 @@ static int virLXCControllerGetNICIndexes(virLXCControllerPtr ctrl)
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_DIRECT:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index e99b039..04fbb0a 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -429,6 +429,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_LAST:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index eb00f0f..2dac923 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5354,6 +5354,17 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
type_sep = ',';
break;
+ case VIR_DOMAIN_NET_TYPE_UDP:
+ virBufferAsprintf(&buf, "socket%cudp=%s:%d%clocaladdr=%s:%d",
+ type_sep,
+ net->data.socket.destaddr,
+ net->data.socket.destport,
+ type_sep,
+ net->data.socket.address,
+ net->data.socket.port);
+ type_sep = ',';
+ break;
+
case VIR_DOMAIN_NET_TYPE_USER:
default:
virBufferAddLit(&buf, "user");
@@ -8416,6 +8427,7 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_LAST:
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 1ea397f..e6c20e9 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2394,6 +2394,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
if (STRNEQ_NULLABLE(olddev->data.socket.address,
newdev->data.socket.address) ||
olddev->data.socket.port != newdev->data.socket.port) {
diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
index 01226ac..4d55e4d 100644
--- a/src/qemu/qemu_interface.c
+++ b/src/qemu/qemu_interface.c
@@ -100,6 +100,7 @@ qemuInterfaceStartDevice(virDomainNetDefPtr net)
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_LAST:
@@ -187,6 +188,7 @@ qemuInterfaceStopDevice(virDomainNetDefPtr net)
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_LAST:
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 90deb2a..afc0375 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -195,6 +195,11 @@ umlBuildCommandLineNet(virConnectPtr conn,
_("TCP client networking type not supported"));
goto error;
+ case VIR_DOMAIN_NET_TYPE_UDP:
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("UDP networking type not supported"));
+ goto error;
+
case VIR_DOMAIN_NET_TYPE_MCAST:
/* ethNNN=tuntap,macaddr,ipaddr,port */
virBufferAddLit(&buf, "mcast");
diff --git a/src/xenconfig/xen_sxpr.c b/src/xenconfig/xen_sxpr.c
index 05e938a..1d43ec1 100644
--- a/src/xenconfig/xen_sxpr.c
+++ b/src/xenconfig/xen_sxpr.c
@@ -1962,6 +1962,7 @@ xenFormatSxprNet(virConnectPtr conn,
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_DIRECT:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 4988ba2..fc23ee1 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -993,6 +993,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
+ case VIR_DOMAIN_NET_TYPE_UDP:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
case VIR_DOMAIN_NET_TYPE_LAST:
--
1.9.1
9 years, 3 months
[libvirt] [sandbox PATCH v3 00/22] *** Virt-sandbox-image ***
by Eren Yagdiran
V3 Changes:
* License syntax fixed
* Source abstract method get_env fixed
* Discarding byte code generation now resides into a new commit
* Template_dir and storage_dir refactored and runtime resolver is added for
checking permissions
* -f,--format parameter is refactored. Default is qcow2.
* Ssl warning is now using stderr
* get_disk method in Source now adds another layer with a randomized name
Daniel P Berrange (1):
Add virt-sandbox-image
Eren Yagdiran (21):
Fix virt-sandbox-image
Image: Add Hooking Mechanism
Image: virt-sandbox-image default dir constants
Image: Discard caching bytecode
Image: Add check_writable and runtime resolver
Image: Add download function
Image: Refactor create function
Image: Add delete function
Image: Add get_command function to Source
Image: Add run args
Image: Add check_connect function
Image: Add get_disk function to Source
Image: Add run function
Image: Add network support
Image: Add Volume Support
Image: man file for virt-sandbox-image
Add configuration object for environment variables
Add environment parameter to virt-sandbox
Common-init: Exporting custom environment variables
Add testcase for custom environment variables
Image: Add custom environment support
.gitignore | 1 +
bin/Makefile.am | 21 +-
bin/virt-sandbox-image.in | 3 +
bin/virt-sandbox-image.pod | 172 +++++++++++
bin/virt-sandbox.c | 14 +
configure.ac | 2 +
libvirt-sandbox/Makefile.am | 2 +
libvirt-sandbox/libvirt-sandbox-config-all.h | 1 +
libvirt-sandbox/libvirt-sandbox-config-env.c | 199 ++++++++++++
libvirt-sandbox/libvirt-sandbox-config-env.h | 78 +++++
libvirt-sandbox/libvirt-sandbox-config.c | 187 +++++++++++-
libvirt-sandbox/libvirt-sandbox-config.h | 12 +
libvirt-sandbox/libvirt-sandbox-init-common.c | 30 ++
libvirt-sandbox/libvirt-sandbox.h | 1 +
libvirt-sandbox/libvirt-sandbox.sym | 6 +
libvirt-sandbox/tests/test-config.c | 10 +
po/POTFILES.in | 1 +
virt-sandbox-image/Makefile.am | 14 +
virt-sandbox-image/sources/DockerSource.py | 421 ++++++++++++++++++++++++++
virt-sandbox-image/sources/Source.py | 55 ++++
virt-sandbox-image/sources/__init__.py | 26 ++
virt-sandbox-image/virt-sandbox-image.py | 299 ++++++++++++++++++
22 files changed, 1550 insertions(+), 5 deletions(-)
create mode 100644 bin/virt-sandbox-image.in
create mode 100644 bin/virt-sandbox-image.pod
create mode 100644 libvirt-sandbox/libvirt-sandbox-config-env.c
create mode 100644 libvirt-sandbox/libvirt-sandbox-config-env.h
create mode 100644 virt-sandbox-image/Makefile.am
create mode 100644 virt-sandbox-image/sources/DockerSource.py
create mode 100644 virt-sandbox-image/sources/Source.py
create mode 100644 virt-sandbox-image/sources/__init__.py
create mode 100755 virt-sandbox-image/virt-sandbox-image.py
--
2.1.0
9 years, 3 months
[libvirt] [RFC PATCH 0/3] Implement mockup capabilities cache in QEMU tests
by Pavel Fedin
Since commit e8d55172544c1fafe31a9e09346bdebca4f0d6f9 qemu driver checks
emulator capabilities during domain XML post-parse. However, test suite
does not initialize it, therefore a condition to skip all checks if there
is no cache supplied was added. This is actually a hack, whose sole
purpose is to make existing test suite working. Additionally, it prevents
from writing new tests for this particular functionality.
This series attempts to solve this problem by implementing proper cache
mockup in test suite. The main idea is to create a cache in standard way
and put there a pre-defined capabilities set (which tests already have).
The main problem here is to know emulator binary name, which is contained
in the source XML. However, we have to create our cache before reading the
XML. The simplest way to resolve this is to assume particular binary name
from test name. Currently tests which assume cross-architecture binary are
all prefixed with the architecture name (with one exception of "keywrap"
tests which all assume /usr/bin/qemu-system-s390x and do not have "s390-"
prefix in their name).
This scheme works fine, unless we use "native" emulator binary. Here we
have a mess. Most newer tests use /usr/bin/qemu, however there is a large
number of tests which use /usr/libexec/qemu-kvm or /usr/bin/kvm (i guess
these are leftovers from the epoch when qemu-kvm was a separate fork of
qemu). This is currently not handled in any way, and these tests may
report errors due to missing binaries (because virQEMUCapsCacheLookup()
attempts to populate the cache automatically by querying the binary if
not already known).
There are several possible ways to resolve this:
a) Add all possible names as aliases for /usr/bin/qemu
b) Forbid to use oldstyle names at all in these tests
c) Declare some prefix like "kvm-" for those tests who want to use
/usr/libexec/qemu-kvm. Again, this would ban /usr/bin/kvm and
/usr/bin/qemu-kvm (if not using aliases like in (b)
d) Hardcode (optional) emulator name per test. IMHO a bad idea because
number of tests is huge.
e) Do some preparsing of the XML and extract binary name from it. Again,
i disliked it for not being simple enough.
I also thought about an alternate implementation which would patch
postParseCallback and insert own function there which builds a cache. At
this point binary name is already known from the XML. However, such a
design looks like an ugly hack by itself, so i stopped going in this
direction.
Comments and opinions are welcome.
Pavel Fedin (3):
Implement virQEMUCapsCache mockup
Use mockup cache
Removed unneeded check
src/qemu/qemu_capabilities.c | 10 +---------
src/qemu/qemu_capspriv.h | 36 +++++++++++++++++++++++++++++++++++
src/qemu/qemu_domain.c | 5 +----
tests/qemuagenttest.c | 9 ++++++++-
tests/qemuargv2xmltest.c | 5 +++++
tests/qemuhotplugtest.c | 23 ++++++++++++++--------
tests/qemuxml2argvtest.c | 5 +++++
tests/qemuxml2xmltest.c | 6 ++++++
tests/qemuxmlnstest.c | 5 +++++
tests/testutilsqemu.c | 45 ++++++++++++++++++++++++++++++++++++++++++++
tests/testutilsqemu.h | 3 +++
11 files changed, 130 insertions(+), 22 deletions(-)
create mode 100644 src/qemu/qemu_capspriv.h
mode change 100644 => 100755 tests/qemuagenttest.c
mode change 100644 => 100755 tests/qemuhotplugtest.c
mode change 100644 => 100755 tests/qemuxml2xmltest.c
mode change 100644 => 100755 tests/testutilsqemu.c
--
2.1.4
9 years, 3 months
[libvirt] [PATCH] domain-conf: escape string for socket attribute
by Pavel Hrdina
Commit d091518b tried to escape all strings in produced XML, but missed
this one.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/conf/domain_conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c5e9653..56f9460 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -21060,8 +21060,8 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
if (def->data.vnc.socket) {
if (def->data.vnc.socket)
- virBufferAsprintf(buf, " socket='%s'",
- def->data.vnc.socket);
+ virBufferEscapeString(buf, " socket='%s'",
+ def->data.vnc.socket);
} else {
if (def->data.vnc.port &&
(!def->data.vnc.autoport || !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)))
--
2.5.0
9 years, 3 months
[libvirt] [PATCH] virsh: Enhance the detailed output of domblklist for networked source
by Lin Ma
Format & Output more detailed information about networked source
e.g: The output without the patch:
$ virsh domblklist $DOMAIN --details
Type Device Target Source
------------------------------------------------
network disk vda test-pool/image
network disk vdb iqn.2015-08.org.example:sn01/0
network disk vdc /image.raw
network disk vdd -
network disk vde -
network disk vdf image1
network disk vdg test-volume/image.raw
The output with the patch:
$ virsh domblklist $DOMAIN --details
Type Device Target Source
------------------------------------------------
network disk vda rbd://monitor1.example.org:6321/test-pool/image
network disk vdb iscsi://192.168.124.200:3260/iqn.2015-08.org.example:sn01/0
network disk vdc http://192.168.124.200:80/image.raw
network disk vdd nbd+unix:///var/run/nbdsock
network disk vde nbd://192.168.124.200:12345
network disk vdf sheepdog://192.168.124.200:6000/image1
network disk vdg gluster://192.168.124.200/test-volume/image.raw
Signed-off-by: Lin Ma <lma(a)suse.com>
---
tools/virsh-domain-monitor.c | 60 ++++++++++++++++++++++++++++++++++++++++----
1 file changed, 55 insertions(+), 5 deletions(-)
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 340a8e2..9188b42 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -518,6 +518,12 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd)
for (i = 0; i < ndisks; i++) {
char *type = NULL;
char *device = NULL;
+ char *protocol = NULL;
+ char *transport = NULL;
+ char *host_name = NULL;
+ char *host_port = NULL;
+ char *socket = NULL;
+ char *name = NULL;
char *target;
char *source;
@@ -541,11 +547,55 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd)
VIR_FREE(device);
goto cleanup;
}
- source = virXPathString("string(./source/@file"
- "|./source/@dev"
- "|./source/@dir"
- "|./source/@name"
- "|./source/@volume)", ctxt);
+ if (type && STREQ(type, "network")) {
+ protocol = virXPathString("string(./source/@protocol)", ctxt);
+ name = virXPathString("string(./source/@name)", ctxt);
+ transport = virXPathString("string(./source/host/@transport)", ctxt);
+ socket = virXPathString("string(./source/host/@socket)", ctxt);
+ host_name = virXPathString("string(./source/host/@name)", ctxt);
+ host_port = virXPathString("string(./source/host/@port)", ctxt);
+ if (VIR_STRDUP(source, protocol) < 0)
+ goto cleanup;
+ VIR_FREE(protocol);
+ if(transport) {
+ if(virAsprintf(&source, "%s+%s", source, transport) < 0)
+ goto cleanup;
+ VIR_FREE(transport);
+ }
+ if(virAsprintf(&source, "%s://", source) < 0)
+ goto cleanup;
+ if(host_name) {
+ if(virAsprintf(&source, "%s%s", source, host_name) < 0)
+ goto cleanup;
+ VIR_FREE(host_name);
+ if(host_port) {
+ if(virAsprintf(&source, "%s:%s", source, host_port) < 0)
+ goto cleanup;
+ VIR_FREE(host_port);
+ }
+ }
+ if(name) {
+ if(!STRPREFIX(name, "/"))
+ if(virAsprintf(&source, "%s/", source) < 0)
+ goto cleanup;
+ if(virAsprintf(&source, "%s%s", source, name) < 0)
+ goto cleanup;
+ VIR_FREE(name);
+ } else if(socket) {
+ if(!STRPREFIX(socket, "/"))
+ if(virAsprintf(&source, "%s/", source) < 0)
+ goto cleanup;
+ if(virAsprintf(&source, "%s%s", source, socket) < 0)
+ goto cleanup;
+ VIR_FREE(socket);
+ }
+ } else {
+ source = virXPathString("string(./source/@file"
+ "|./source/@dev"
+ "|./source/@dir"
+ "|./source/@name"
+ "|./source/@volume)", ctxt);
+ }
if (details) {
vshPrint(ctl, "%-10s %-10s %-10s %s\n", type, device,
target, source ? source : "-");
--
2.1.4
9 years, 3 months