[libvirt] [glib] Add filesys xml file to distribution
by Cédric Bosdonnat
Tests can't succeed from the distribution tarball: the new
gconfig-domain-device-filesys.xml file wasn't included.
---
tests/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 63865e8..c8bb4c7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST += \
xml/gconfig-domain-device-channel.xml \
xml/gconfig-domain-device-console.xml \
xml/gconfig-domain-device-disk.xml \
+ xml/gconfig-domain-device-filesys.xml \
xml/gconfig-domain-device-graphics.xml \
xml/gconfig-domain-device-input.xml \
xml/gconfig-domain-device-network.xml \
--
2.1.4
9 years, 9 months
[libvirt] [PATCH v2 0/1] vz: assign static IPs and default gateways for network adapter
by Mikhail Feoktistov
fix "avoid_if_before_free" warnings for VIR_FREE calls
fix "found diagnostic without %" warnings for virReportError calls
use virAsprintf instead of virBufferAsprintf
set default gateway only if static ip is present
write inet family to log in case of unsupported gateway
Mikhail Feoktistov (1):
vz: assign static IPs and default gateways for network adapter
9 years, 9 months
[libvirt] [PATCH RESEND] Added support for portable-rpcgen from portablexdr library
by Pavel Fedin
This patch allows to build libvirt natively under MinGW/MSYS using portablexdr library.
An updated version of portablexdr with fixed bugs is available as part of MSYS2 project.
Signed-off-by: Pavel Fedin <p.fedin(a)samsung.com>
---
configure.ac | 2 +-
src/lxc/lxc_monitor_protocol.x | 2 +-
src/rpc/genprotocol.pl | 5 ++++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index aed0934..547a405 100644
--- a/configure.ac
+++ b/configure.ac
@@ -397,7 +397,7 @@ AM_CONDITIONAL([HAVE_LIBTASN1], [test "x$ac_cv_header_libtasn1_h" = "xyes"])
AC_CHECK_LIB([intl],[gettext],[])
dnl Do we have rpcgen?
-AC_PATH_PROG([RPCGEN], [rpcgen], [no])
+AC_PATH_PROGS([RPCGEN], [rpcgen portable-rpcgen], [no])
AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"])
dnl Is this GLIBC's buggy rpcgen?
AM_CONDITIONAL([HAVE_GLIBC_RPCGEN],
diff --git a/src/lxc/lxc_monitor_protocol.x b/src/lxc/lxc_monitor_protocol.x
index 3b66af5..205d7c2 100644
--- a/src/lxc/lxc_monitor_protocol.x
+++ b/src/lxc/lxc_monitor_protocol.x
@@ -30,7 +30,7 @@ enum virLXCMonitorExitStatus {
};
struct virLXCMonitorExitEventMsg {
- enum virLXCMonitorExitStatus status;
+ virLXCMonitorExitStatus status;
};
struct virLXCMonitorInitEventMsg {
diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl
index 6e6d6d4..1ac2507 100755
--- a/src/rpc/genprotocol.pl
+++ b/src/rpc/genprotocol.pl
@@ -38,7 +38,10 @@ my $target = shift;
unlink $target;
-open RPCGEN, "-|", $rpcgen, $mode, $xdrdef
+if ($rpcgen =~ /portable-rpcgen/) {
+ $rpcgen = "$rpcgen -o -";
+}
+open RPCGEN, "-|", "$rpcgen $mode $xdrdef"
or die "cannot run $rpcgen $mode $xdrdef: $!";
open TARGET, ">$target"
or die "cannot create $target: $!";
--
1.9.5.msysgit.0
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
9 years, 9 months
[libvirt] [PATCH] vz: assign static IPs and default gateways for network adapter
by Mikhail Feoktistov
We support only one IPv4 and one IPv6 default gateway.
If static IPs are not present in instance config,
then we switch on DHCP for this adapter.
PrlVmDevNet_SetAutoApply to makes necessary settings within guest OS
In linux case it creates network startup scripts
/etc/sysconfig/network-scripts/ifcfg-ethN and fills it with necessary
parameters.
---
src/vz/vz_sdk.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 120 insertions(+), 0 deletions(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index f27098c..7d318f8 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2788,8 +2788,13 @@ static int prlsdkAddNet(PRL_HANDLE sdkdom,
PRL_HANDLE sdknet = PRL_INVALID_HANDLE;
PRL_HANDLE vnet = PRL_INVALID_HANDLE;
PRL_HANDLE job = PRL_INVALID_HANDLE;
+ PRL_HANDLE addrlist = PRL_INVALID_HANDLE;
+ size_t i;
int ret = -1;
char macstr[PRL_MAC_STRING_BUFNAME];
+ char *addrstr = NULL;
+ bool ipv6present = false;
+ bool ipv4present = false;
if (prlsdkCheckNetUnsupportedParams(net) < 0)
return -1;
@@ -2814,6 +2819,118 @@ static int prlsdkAddNet(PRL_HANDLE sdkdom,
pret = PrlVmDevNet_SetMacAddress(sdknet, macstr);
prlsdkCheckRetGoto(pret, cleanup);
+ pret = PrlApi_CreateStringsList(&addrlist);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ for (i = 0; i < net->nips; i++) {
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ char *tmpstr;
+
+ if (AF_INET == VIR_SOCKET_ADDR_FAMILY(&net->ips[i]->address))
+ ipv4present = true;
+ else if (AF_INET6 == VIR_SOCKET_ADDR_FAMILY(&net->ips[i]->address))
+ ipv6present = true;
+ else
+ continue;
+
+ if (!(tmpstr = virSocketAddrFormat(&net->ips[i]->address)))
+ goto cleanup;
+
+ virBufferAsprintf(&buf, "%s/%d", tmpstr, net->ips[i]->prefix);
+ VIR_FREE(tmpstr);
+ if (!(addrstr = virBufferContentAndReset(&buf)))
+ goto cleanup;
+
+ pret = PrlStrList_AddItem(addrlist, addrstr);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ VIR_FREE(addrstr);
+ addrstr = NULL;
+ }
+
+ if (ipv4present || ipv6present) {
+ pret = PrlVmDevNet_SetNetAddresses(sdknet, addrlist);
+ prlsdkCheckRetGoto(pret, cleanup);
+ }
+
+ pret = PrlVmDevNet_SetConfigureWithDhcp(sdknet, !ipv4present);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ pret = PrlVmDevNet_SetConfigureWithDhcpIPv6(sdknet, !ipv6present);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ pret = PrlVmDevNet_SetAutoApply(sdknet, true);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ if (net->nroutes) {
+ bool alreadySetIPv4Gateway = false;
+ bool alreadySetIPv6Gateway = false;
+
+ for (i = 0; i < net->nroutes; i++) {
+ virSocketAddrPtr addrdst, gateway;
+ virSocketAddr zero;
+
+ addrdst = virNetworkRouteDefGetAddress(net->routes[i]);
+ gateway = virNetworkRouteDefGetGateway(net->routes[i]);
+
+ ignore_value(virSocketAddrParse(&zero,
+ (VIR_SOCKET_ADDR_IS_FAMILY(addrdst, AF_INET)
+ ? VIR_SOCKET_ADDR_IPV4_ALL
+ : VIR_SOCKET_ADDR_IPV6_ALL),
+ VIR_SOCKET_ADDR_FAMILY(addrdst)));
+
+ if (!virSocketAddrEqual(addrdst, &zero)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Support only default gateway"));
+ goto cleanup;
+ }
+
+ switch (VIR_SOCKET_ADDR_FAMILY(gateway)) {
+ case AF_INET:
+ if (alreadySetIPv4Gateway) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Support only one IPv4 default gateway"));
+ goto cleanup;
+ }
+
+ if (!(addrstr = virSocketAddrFormat(gateway)))
+ goto cleanup;
+
+ pret = PrlVmDevNet_SetDefaultGateway(sdknet, addrstr);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ alreadySetIPv4Gateway = true;
+ break;
+
+ case AF_INET6:
+ if (alreadySetIPv6Gateway) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Support only one IPv6 default gateway"));
+ goto cleanup;
+ }
+
+ if (!(addrstr = virSocketAddrFormat(gateway)))
+ goto cleanup;
+
+ pret = PrlVmDevNet_SetDefaultGatewayIPv6(sdknet, addrstr);
+ prlsdkCheckRetGoto(pret, cleanup);
+
+ alreadySetIPv6Gateway = true;
+ break;
+
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Support only IPv4 and IPv6 default gateways"));
+ goto cleanup;
+ }
+
+ if (addrstr) {
+ VIR_FREE(addrstr);
+ addrstr = NULL;
+ }
+ }
+ }
+
if (isCt) {
if (net->model)
VIR_WARN("Setting network adapter for containers is not "
@@ -2879,6 +2996,9 @@ static int prlsdkAddNet(PRL_HANDLE sdkdom,
ret = 0;
cleanup:
+ if (addrstr)
+ VIR_FREE(addrstr);
+ PrlHandle_Free(addrlist);
PrlHandle_Free(vnet);
PrlHandle_Free(sdknet);
return ret;
--
1.7.1
9 years, 9 months
[libvirt] [PATCH v2] vz: fix building capabilities
by Dmitry Guryanov
There should be at least one domain for each guest
in cababilities. And in current code we don't add
domain for this guest for example.
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
VIR_ARCH_X86_64,
"vz",
NULL, 0, NULL)) == NULL)
Anyway, with two virt types it looks a litte messy, so let's
move adding guest and domain to a separate function.
Signed-off-by: Dmitry Guryanov <dguryanov(a)parallels.com>
---
src/vz/vz_driver.c | 92 ++++++++++++++++++++++--------------------------------
1 file changed, 38 insertions(+), 54 deletions(-)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 47c5023..8c3c818 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -78,14 +78,45 @@ vzDriverUnlock(vzConnPtr driver)
virMutexUnlock(&driver->lock);
}
+static int
+vzCapsAddGuestDomain(virCapsPtr caps,
+ virDomainOSType ostype,
+ virArch arch,
+ const char * emulator,
+ virDomainVirtType virt_type)
+{
+ virCapsGuestPtr guest;
+
+ if ((guest = virCapabilitiesAddGuest(caps, ostype, arch, emulator,
+ NULL, 0, NULL)) == NULL)
+ return -1;
+
+
+ if (virCapabilitiesAddGuestDomain(guest, virt_type,
+ NULL, NULL, 0, NULL) == NULL)
+ return -1;
+
+ return 0;
+}
+
static virCapsPtr
vzBuildCapabilities(void)
{
virCapsPtr caps = NULL;
virCPUDefPtr cpu = NULL;
virCPUDataPtr data = NULL;
- virCapsGuestPtr guest;
virNodeInfo nodeinfo;
+ virDomainOSType ostypes[] = {
+ VIR_DOMAIN_OSTYPE_HVM,
+ VIR_DOMAIN_OSTYPE_EXE
+ };
+ virArch archs[] = { VIR_ARCH_I686, VIR_ARCH_X86_64 };
+ const char *const emulators[] = { "parallels", "vz" };
+ virDomainVirtType virt_types[] = {
+ VIR_DOMAIN_VIRT_PARALLELS,
+ VIR_DOMAIN_VIRT_VZ
+ };
+ size_t i, j, k;
if ((caps = virCapabilitiesNew(virArchFromHost(),
false, false)) == NULL)
@@ -94,59 +125,12 @@ vzBuildCapabilities(void)
if (nodeCapsInitNUMA(caps) < 0)
goto error;
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_X86_64,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_I686,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
- VIR_ARCH_X86_64,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_X86_64,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_I686,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VZ,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
- VIR_ARCH_X86_64,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VZ,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 2; j++)
+ for (k = 0; k < 2; k++)
+ if (vzCapsAddGuestDomain(caps, ostypes[i], archs[j],
+ emulators[k], virt_types[k]) < 0)
+ goto error;
if (nodeGetInfo(&nodeinfo))
goto error;
--
2.4.3
9 years, 9 months
[libvirt] [PATCH v2 0/2] Allow PCI virtio on ARM "virt" machine
by Pavel Fedin
Virt machine in qemu since v2.3.0 has PCI generic host controller, and can use
PCI devices. This provides performance improvement as well as vhost-net with
irqfd support for virtio-net. However libvirt still insists on virtio devices
attached to virt machine to have MMIO bindings. This patch allows to use both.
If the user doesn't specify <address type='virtio-mmio'>, PCI will be used by
default.
Changes since v1:
- Added capability based on qemu version number
- Recognize also "virt-" prefix
Pavel Fedin (2):
Introduce QEMU_CAPS_ARM_VIRT_PCI
Allow PCI virtio on ARM "virt" machine
src/qemu/qemu_capabilities.c | 5 +++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 15 ++++++++++++---
3 files changed, 18 insertions(+), 3 deletions(-)
--
1.9.5.msysgit.0
9 years, 9 months
[libvirt] [PATCH] vz: fix building capabilities
by Dmitry Guryanov
There should be at least one domain for each guest
in cababilities. And in current code we don't add
domain for this guest for example.
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
VIR_ARCH_X86_64,
"vz",
NULL, 0, NULL)) == NULL)
Anyway, with two virt types it looks a litte messy, so let's
move adding guest and domain to a separate function.
---
src/vz/vz_driver.c | 92 +++++++++++++++++++++------------------------------
1 files changed, 38 insertions(+), 54 deletions(-)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 47c5023..a86ae28 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -78,14 +78,45 @@ vzDriverUnlock(vzConnPtr driver)
virMutexUnlock(&driver->lock);
}
+static int
+vzCapsAddGuestDomain(virCapsPtr caps,
+ virDomainOSType ostype,
+ virArch arch,
+ const char * emulator,
+ virDomainVirtType virt_type)
+{
+ virCapsGuestPtr guest;
+
+ if ((guest = virCapabilitiesAddGuest(caps, ostype, arch, emulator,
+ NULL, 0, NULL)) == NULL)
+ return -1;
+
+
+ if (virCapabilitiesAddGuestDomain(guest, virt_type,
+ NULL, NULL, 0, NULL) == NULL)
+ return -1;
+
+ return 0;
+}
+
static virCapsPtr
vzBuildCapabilities(void)
{
virCapsPtr caps = NULL;
virCPUDefPtr cpu = NULL;
virCPUDataPtr data = NULL;
- virCapsGuestPtr guest;
virNodeInfo nodeinfo;
+ virDomainOSType ostypes[] = {
+ VIR_DOMAIN_OSTYPE_HVM,
+ VIR_DOMAIN_OSTYPE_EXE
+ };
+ virArch archs[] = { VIR_ARCH_I686, VIR_ARCH_X86_64 };
+ const char *const emulators[] = { "parallels", "vz" };
+ virDomainVirtType virt_types[] = {
+ VIR_DOMAIN_VIRT_PARALLELS,
+ VIR_DOMAIN_VIRT_VZ
+ };
+ size_t i, j, k;
if ((caps = virCapabilitiesNew(virArchFromHost(),
false, false)) == NULL)
@@ -94,59 +125,12 @@ vzBuildCapabilities(void)
if (nodeCapsInitNUMA(caps) < 0)
goto error;
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_X86_64,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_I686,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
- VIR_ARCH_X86_64,
- "parallels",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_X86_64,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
- VIR_ARCH_I686,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VZ,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
-
- if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
- VIR_ARCH_X86_64,
- "vz",
- NULL, 0, NULL)) == NULL)
- goto error;
-
- if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VZ,
- NULL, NULL, 0, NULL) == NULL)
- goto error;
+ for (i = 0; i < 1; i++)
+ for (j = 0; j < 1; j++)
+ for (k = 0; k < 1; k++)
+ if (vzCapsAddGuestDomain(caps, ostypes[i], archs[j],
+ emulators[k], virt_types[k]) < 0)
+ goto error;
if (nodeGetInfo(&nodeinfo))
goto error;
--
1.7.1
9 years, 9 months
[libvirt] [libvirt-glib] gobject: Remove redundant virtual functions
by Zeeshan Ali (Khattak)
These virtual functions were most likely a result of copy&paste error.
---
libvirt-gobject/libvirt-gobject-network.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-network.h b/libvirt-gobject/libvirt-gobject-network.h
index 5617ed6..8c31af4 100644
--- a/libvirt-gobject/libvirt-gobject-network.h
+++ b/libvirt-gobject/libvirt-gobject-network.h
@@ -55,10 +55,7 @@ struct _GVirNetworkClass
{
GObjectClass parent_class;
- void (*started)(GVirNetwork *net);
- void (*stopped)(GVirNetwork *net);
-
- gpointer padding[20];
+ gpointer padding[22];
};
--
2.4.3
9 years, 9 months
[libvirt] [PATCH 0/2] [V3] Libvirt : Storage fixes
by Prerna Saxena
Here is V3 of storage fixes, which addresses review comments of v2.
Summary:
Prerna Saxena (2):
Storage: Introduce shadow vol for refresh while the main vol builds.
Storage : Fix cloning of raw, sparse volumes
src/storage/storage_backend.c | 23 ++++++++++-------------
src/storage/storage_driver.c | 19 ++++++++++++-------
2 files changed, 22 insertions(+), 20 deletions(-)
V2 :
http://www.redhat.com/archives/libvir-list/2015-June/msg01052.html
Changelog:
Modified patches 1,2 per review comments.
--
1.8.3.1
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
9 years, 9 months