[libvirt] [PATCH] tests: stop linking virt tests to secondary drivers
by Daniel P. Berrangé
The hard dependancy between the virt drivers and the network
or storage drivers was removed quite a while back now, so
the tests no longer need to link to these drivers.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
tests/Makefile.am | 33 ++++++++++++---------------------
1 file changed, 12 insertions(+), 21 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e009de830c..ac4c0e1a3a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -500,11 +500,10 @@ sockettest_SOURCES = \
sockettest_LDADD = $(LDADDS)
if WITH_LIBXL
-libxl_LDADDS = ../src/libvirt_driver_libxl_impl.la
-if WITH_NETWORK
-libxl_LDADDS += ../src/libvirt_driver_network_impl.la
-endif WITH_NETWORK
-libxl_LDADDS += $(LDADDS)
+libxl_LDADDS = \
+ ../src/libvirt_driver_libxl_impl.la \
+ $(LDADDS) \
+ $(NULL)
libxltestdriver_la_SOURCES =
libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
@@ -547,12 +546,6 @@ if WITH_QEMU
libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
-if WITH_NETWORK
-qemu_LDADDS += ../src/libvirt_driver_network_impl.la
-endif WITH_NETWORK
-if WITH_STORAGE
-qemu_LDADDS += ../src/libvirt_driver_storage_impl.la
-endif WITH_STORAGE
if WITH_DTRACE_PROBES
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
endif WITH_DTRACE_PROBES
@@ -733,11 +726,10 @@ endif ! WITH_QEMU
if WITH_LXC
-lxc_LDADDS = ../src/libvirt_driver_lxc_impl.la
-if WITH_NETWORK
-lxc_LDADDS += ../src/libvirt_driver_network_impl.la
-endif WITH_NETWORK
-lxc_LDADDS += $(LDADDS)
+lxc_LDADDS = \
+ ../src/libvirt_driver_lxc_impl.la \
+ $(LDADDS) \
+ $(NULL)
lxcxml2xmltest_SOURCES = \
lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
@@ -818,11 +810,10 @@ libbhyveargv2xmlmock_la_SOURCES = \
libbhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
libbhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS)
-bhyve_LDADDS = ../src/libvirt_driver_bhyve_impl.la
-if WITH_STORAGE
-bhyve_LDADDS += ../src/libvirt_driver_storage_impl.la
-endif WITH_STORAGE
-bhyve_LDADDS += $(LDADDS)
+bhyve_LDADDS = \
+ ../src/libvirt_driver_bhyve_impl.la \
+ $(LDADDS) \
+ $(NULL)
bhyvexml2argvtest_SOURCES = \
bhyvexml2argvtest.c \
testutils.c testutils.h
--
2.21.0
4 years, 11 months
[libvirt] [PATCH] spec: mingw: add deps for genprotocol.pl usage
by Cole Robinson
As of 0985a9597bb03 we no longer distribute generated files. mingw
needs to call genprotocol.pl itself, which means it needs rpcgen
and cpp installed.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
mingw-libvirt.spec.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
index c29f3eeed2..fd9b729591 100644
--- a/mingw-libvirt.spec.in
+++ b/mingw-libvirt.spec.in
@@ -89,6 +89,10 @@ BuildRequires: mingw64-libssh2
BuildRequires: mingw32-curl
BuildRequires: mingw64-curl
%endif
+BuildRequires: cpp
+%if 0%{?fedora} || 0%{?rhel} > 7
+BuildRequires: rpcgen
+%endif
BuildArch: noarch
--
2.23.0
4 years, 11 months
[libvirt] [PATCH v2] driver: Include source as a flag to virDomainGetHostname
by Julio Faracco
There is a lots of possibilities to retrieve hostname information from
domain. Libvirt could use lease information from dnsmasq to get current
hostname too. QEMU supports QEMU-agent but it can use lease source. See
'domifaddr' as an example.
This commit still adds lease options for QEMU. It will get the first
hostname available from domain networks.
This case, every driver has a default section inside switch to keep
compatibility. So, if someone call 'domhostname' without specifying
source, it will get the default option.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
include/libvirt/libvirt-domain.h | 5 +++
src/lxc/lxc_driver.c | 71 ++++++++++++++++++++++++++++++++
src/openvz/openvz_driver.c | 30 ++++++++++----
src/qemu/qemu_driver.c | 69 ++++++++++++++++++++++++++-----
tools/virsh-domain.c | 25 ++++++++++-
5 files changed, 178 insertions(+), 22 deletions(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index a2f007568c..b37f33d5d0 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -4790,6 +4790,11 @@ typedef struct _virTypedParameter virMemoryParameter;
*/
typedef virMemoryParameter *virMemoryParameterPtr;
+typedef enum {
+ VIR_DOMAIN_HOSTNAME_SRC_LEASE = (1 << 0), /* Parse DHCP lease file */
+ VIR_DOMAIN_HOSTNAME_SRC_AGENT = (1 << 1), /* Query qemu guest agent */
+} virDomainHostnameSource;
+
typedef enum {
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE = 0, /* Parse DHCP lease file */
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT = 1, /* Query qemu guest agent */
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 826bf074e3..3221b06261 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -5321,6 +5321,76 @@ lxcDomainGetCPUStats(virDomainPtr dom,
return ret;
}
+static char *
+lxcDomainGetHostname(virDomainPtr dom,
+ unsigned int flags)
+{
+ virDomainObjPtr vm = NULL;
+ char macaddr[VIR_MAC_STRING_BUFLEN];
+ g_autoptr(virNetwork) network = NULL;
+ virNetworkDHCPLeasePtr *leases = NULL;
+ int n_leases;
+ size_t i, j;
+ char *hostname = NULL;
+
+ virCheckFlags(VIR_DOMAIN_HOSTNAME_SRC_LEASE |
+ VIR_DOMAIN_HOSTNAME_SRC_AGENT, NULL);
+
+ if (!(vm = lxcDomObjFromDomain(dom)))
+ return NULL;
+
+ if (virDomainGetHostnameEnsureACL(dom->conn, vm->def) < 0)
+ goto cleanup;
+
+ switch (flags) {
+ default:
+ case VIR_DOMAIN_HOSTNAME_SRC_LEASE:
+ for (i = 0; i < vm->def->nnets; i++) {
+ if (vm->def->nets[i]->type != VIR_DOMAIN_NET_TYPE_NETWORK)
+ continue;
+
+ virMacAddrFormat(&(vm->def->nets[i]->mac), macaddr);
+ virObjectUnref(network);
+ network = virNetworkLookupByName(dom->conn,
+ vm->def->nets[i]->data.network.name);
+
+ if ((n_leases = virNetworkGetDHCPLeases(network, macaddr,
+ &leases, 0)) < 0)
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("There is no available hostname %d"),
+ flags);
+
+ for (j = 0; j < n_leases; j++) {
+ virNetworkDHCPLeasePtr lease = leases[j];
+ if (lease->hostname) {
+ hostname = g_strdup(lease->hostname);
+
+ for (j = 0; j < n_leases; j++)
+ virNetworkDHCPLeaseFree(leases[j]);
+
+ VIR_FREE(leases);
+
+ goto cleanup;
+ }
+ }
+
+ for (j = 0; j < n_leases; j++)
+ virNetworkDHCPLeaseFree(leases[j]);
+
+ VIR_FREE(leases);
+ }
+ break;
+ case VIR_DOMAIN_HOSTNAME_SRC_AGENT:
+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
+ _("Unknown hostname data source %d"),
+ flags);
+ break;
+ }
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return hostname;
+}
static int
lxcNodeGetFreePages(virConnectPtr conn,
@@ -5467,6 +5537,7 @@ static virHypervisorDriver lxcHypervisorDriver = {
.domainSetMetadata = lxcDomainSetMetadata, /* 1.1.3 */
.domainGetMetadata = lxcDomainGetMetadata, /* 1.1.3 */
.domainGetCPUStats = lxcDomainGetCPUStats, /* 1.2.2 */
+ .domainGetHostname = lxcDomainGetHostname, /* 5.9.0 */
.nodeGetMemoryParameters = lxcNodeGetMemoryParameters, /* 0.10.2 */
.nodeSetMemoryParameters = lxcNodeSetMemoryParameters, /* 0.10.2 */
.domainSendProcessSignal = lxcDomainSendProcessSignal, /* 1.0.1 */
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index e07b3b302d..c9f8255f19 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -301,19 +301,31 @@ openvzDomainGetHostname(virDomainPtr dom, unsigned int flags)
struct openvz_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
- virCheckFlags(0, NULL);
+ virCheckFlags(VIR_DOMAIN_HOSTNAME_SRC_LEASE |
+ VIR_DOMAIN_HOSTNAME_SRC_AGENT, NULL);
+
if (!(vm = openvzDomObjFromDomain(driver, dom->uuid)))
return NULL;
- hostname = openvzVEGetStringParam(dom, "hostname");
- if (hostname == NULL)
- goto cleanup;
+ switch (flags) {
+ default:
+ hostname = openvzVEGetStringParam(dom, "hostname");
+ if (hostname == NULL)
+ goto cleanup;
- /* vzlist prints an unset hostname as '-' */
- if (STREQ(hostname, "-")) {
- virReportError(VIR_ERR_OPERATION_FAILED,
- _("Hostname of '%s' is unset"), vm->def->name);
- VIR_FREE(hostname);
+ /* vzlist prints an unset hostname as '-' */
+ if (STREQ(hostname, "-")) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("Hostname of '%s' is unset"), vm->def->name);
+ VIR_FREE(hostname);
+ }
+ break;
+ case VIR_DOMAIN_HOSTNAME_SRC_AGENT:
+ case VIR_DOMAIN_HOSTNAME_SRC_LEASE:
+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
+ _("Unknown hostname data source %d"),
+ flags);
+ break;
}
cleanup:
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b5300241a8..928f75cafe 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20090,9 +20090,15 @@ qemuDomainGetHostname(virDomainPtr dom,
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
qemuAgentPtr agent;
+ char macaddr[VIR_MAC_STRING_BUFLEN];
+ g_autoptr(virNetwork) network = NULL;
+ virNetworkDHCPLeasePtr *leases = NULL;
+ int n_leases;
+ size_t i, j;
char *hostname = NULL;
- virCheckFlags(0, NULL);
+ virCheckFlags(VIR_DOMAIN_HOSTNAME_SRC_LEASE |
+ VIR_DOMAIN_HOSTNAME_SRC_AGENT, NULL);
if (!(vm = qemuDomainObjFromDomain(dom)))
return NULL;
@@ -20100,21 +20106,62 @@ qemuDomainGetHostname(virDomainPtr dom,
if (virDomainGetHostnameEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) < 0)
- goto cleanup;
-
if (virDomainObjCheckActive(vm) < 0)
goto endjob;
- if (!qemuDomainAgentAvailable(vm, true))
- goto endjob;
+ switch (flags) {
+ default:
+ case VIR_DOMAIN_HOSTNAME_SRC_AGENT:
+ if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) < 0)
+ goto cleanup;
- agent = qemuDomainObjEnterAgent(vm);
- ignore_value(qemuAgentGetHostname(agent, &hostname));
- qemuDomainObjExitAgent(vm, agent);
+ if (!qemuDomainAgentAvailable(vm, true))
+ goto endjob;
- endjob:
- qemuDomainObjEndAgentJob(vm);
+ agent = qemuDomainObjEnterAgent(vm);
+ ignore_value(qemuAgentGetHostname(agent, &hostname));
+ qemuDomainObjExitAgent(vm, agent);
+
+ endjob:
+ qemuDomainObjEndAgentJob(vm);
+ break;
+ case VIR_DOMAIN_HOSTNAME_SRC_LEASE:
+ for (i = 0; i < vm->def->nnets; i++) {
+ if (vm->def->nets[i]->type != VIR_DOMAIN_NET_TYPE_NETWORK)
+ continue;
+
+ virMacAddrFormat(&(vm->def->nets[i]->mac), macaddr);
+ virObjectUnref(network);
+ network = virNetworkLookupByName(dom->conn,
+ vm->def->nets[i]->data.network.name);
+
+ if ((n_leases = virNetworkGetDHCPLeases(network, macaddr,
+ &leases, 0)) < 0)
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("There is no available hostname %d"),
+ flags);
+
+ for (j = 0; j < n_leases; j++) {
+ virNetworkDHCPLeasePtr lease = leases[j];
+ if (lease->hostname) {
+ hostname = g_strdup(lease->hostname);
+
+ for (j = 0; j < n_leases; j++)
+ virNetworkDHCPLeaseFree(leases[j]);
+
+ VIR_FREE(leases);
+
+ goto cleanup;
+ }
+ }
+
+ for (j = 0; j < n_leases; j++)
+ virNetworkDHCPLeaseFree(leases[j]);
+
+ VIR_FREE(leases);
+ }
+ break;
+ }
cleanup:
virDomainObjEndAPI(&vm);
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 6be9780836..01de6b633a 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -11669,6 +11669,10 @@ static const vshCmdInfo info_domhostname[] = {
static const vshCmdOptDef opts_domhostname[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
+ {.name = "source",
+ .type = VSH_OT_STRING,
+ .flags = VSH_OFLAG_NONE,
+ .help = N_("address source: 'lease' or 'agent'")},
{.name = NULL}
};
@@ -11678,21 +11682,38 @@ cmdDomHostname(vshControl *ctl, const vshCmd *cmd)
char *hostname;
virDomainPtr dom;
bool ret = false;
+ const char *sourcestr = NULL;
+ int flags = 0; /* Use default value. Drivers can have its own default. */
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- hostname = virDomainGetHostname(dom, 0);
+ if (vshCommandOptStringReq(ctl, cmd, "source", &sourcestr) < 0)
+ goto error;
+
+ if (sourcestr) {
+ if (STREQ(sourcestr, "lease")) {
+ flags |= VIR_DOMAIN_HOSTNAME_SRC_LEASE;
+ } else if (STREQ(sourcestr, "agent")) {
+ flags |= VIR_DOMAIN_HOSTNAME_SRC_AGENT;
+ } else {
+ vshError(ctl, _("Unknown data source '%s'"), sourcestr);
+ goto error;
+ }
+ }
+
+ hostname = virDomainGetHostname(dom, flags);
if (hostname == NULL) {
vshError(ctl, "%s", _("failed to get hostname"));
goto error;
}
vshPrint(ctl, "%s\n", hostname);
+
+ VIR_FREE(hostname);
ret = true;
error:
- VIR_FREE(hostname);
virshDomainFree(dom);
return ret;
}
--
2.20.1
4 years, 11 months
[libvirt] [PATCH RFC V2] guests: Add support for openSUSE
by Jim Fehlig
This change adds support for the latest openSUSE Leap and
openSUSE Tumbleweed guests.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
This version of the patch overcomes the 'lci build' issues noted in V1
and works well for openSUSE Leap 15.1 and Tumbleweed. I'm still of the
opinion of only supporting the latest Leap since there is only a six
month support overlap between versions. Version x-1 is only supported
six months after x is released.
'lci update ... libvirt' fails in task "Configure hostname":
fatal: [libvirt-opensuse-tumbleweed]: FAILED! => {"changed": false, "msg": "hostname module cannot be used on platform Linux (Opensuse-tumbleweed)"}
Not sure why that is the case. But more importantly, even though it
doesn't fail, the "Update installed packages" task doesn't install any
of the packages required to build libvirt. I suppose that agrees with
guests/REAMDME, but how then are the packages required to build $project
installed? How/when is the list of packages required to build $project
conveyed to $package_manager?
'lcitool build libvirt-opensuse-tumbleweed libvirt' fails in the
"Gathering Facts" task:
fatal: [libvirt-opensuse-tumbleweed]: UNREACHABLE! => {"changed": false, "msg": "Invalid/incorrect password: ", "unreachable": true}
Passing --debug to the command didn't help with determining what needed
the password. ssh? I can't find where the "Gathering Facts" task is
defined. The $root_password_file passed to /usr/bin/ansible-playbook
contains the correct password for the root user. /me needs to figure
out how to better debug this stuff :-).
guests/configs/autoinst.xml | 75 +++++++++++++++++++
.../host_vars/libvirt-opensuse-15/docker.yml | 2 +
.../host_vars/libvirt-opensuse-15/install.yml | 2 +
guests/host_vars/libvirt-opensuse-15/main.yml | 22 ++++++
.../libvirt-opensuse-tumbleweed/docker.yml | 2 +
.../libvirt-opensuse-tumbleweed/install.yml | 2 +
.../libvirt-opensuse-tumbleweed/main.yml | 22 ++++++
guests/inventory | 2 +
guests/lcitool | 2 +
guests/playbooks/update/tasks/base.yml | 15 ++++
guests/vars/mappings.yml | 41 +++++++++-
11 files changed, 185 insertions(+), 2 deletions(-)
diff --git a/guests/configs/autoinst.xml b/guests/configs/autoinst.xml
new file mode 100644
index 0000000..42c42f8
--- /dev/null
+++ b/guests/configs/autoinst.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<!DOCTYPE profile>
+<profile
+ xmlns="http://www.suse.com/1.0/yast2ns"
+ xmlns:config="http://www.suse.com/1.0/configns">
+ <general>
+ <mode>
+ <confirm config:type="boolean">false</confirm>
+ </mode>
+ </general>
+ <partitioning config:type="list">
+ <drive>
+ <device>/dev/vda</device>
+ <use>all</use>
+ <partitions config:type="list">
+ <partition>
+ <filesystem config:type="symbol">swap</filesystem>
+ <size>256M</size>
+ <mount>swap</mount>
+ </partition>
+ <partition>
+ <filesystem config:type="symbol">ext4</filesystem>
+ <mount>/</mount>
+ <size>max</size>
+ </partition>
+ </partitions>
+ </drive>
+ </partitioning>
+ <bootloader>
+ <global>
+ <terminal>console serial</terminal>
+ </global>
+ </bootloader>
+ <timezone>
+ <hwclock>UTC</hwclock>
+ <timezone>UTC</timezone>
+ </timezone>
+ <software>
+ <install_recommended config:type="boolean">false</install_recommended>
+ <products config:type="list">
+ <product>openSUSE</product>
+ </products>
+ <patterns config:type="list">
+ <pattern>base</pattern>
+ <pattern>minimal_base</pattern>
+ <pattern>yast2_basis</pattern>
+ </patterns>
+ <packages config:type="list">
+ <package>openssh</package>
+ </packages>
+ </software>
+ <networking>
+ <keep_install_network config:type="boolean">true</keep_install_network>
+ </networking>
+ <users config:type="list">
+ <user>
+ <username>root</username>
+ <user_password>root</user_password>
+ <encrypted config:type="boolean">false</encrypted>
+ <uid>0</uid>
+ <gid>0</gid>
+ <home>/root</home>
+ <shell>/bin/bash</shell>
+ </user>
+ </users>
+ <services-manager>
+ <default_target>multi-user</default_target>
+ <services config:type="list">
+ <service>
+ <service_name>sshd</service_name>
+ <service_status>enable</service_status>
+ </service>
+ </services>
+ </services-manager>
+</profile>
diff --git a/guests/host_vars/libvirt-opensuse-15/docker.yml b/guests/host_vars/libvirt-opensuse-15/docker.yml
new file mode 100644
index 0000000..8f32d06
--- /dev/null
+++ b/guests/host_vars/libvirt-opensuse-15/docker.yml
@@ -0,0 +1,2 @@
+---
+docker_base: opensuse/leap:15
diff --git a/guests/host_vars/libvirt-opensuse-15/install.yml b/guests/host_vars/libvirt-opensuse-15/install.yml
new file mode 100644
index 0000000..d0fdbe5
--- /dev/null
+++ b/guests/host_vars/libvirt-opensuse-15/install.yml
@@ -0,0 +1,2 @@
+---
+install_url: http://download.opensuse.org/distribution/leap/15.1/repo/oss/
diff --git a/guests/host_vars/libvirt-opensuse-15/main.yml b/guests/host_vars/libvirt-opensuse-15/main.yml
new file mode 100644
index 0000000..abd83c5
--- /dev/null
+++ b/guests/host_vars/libvirt-opensuse-15/main.yml
@@ -0,0 +1,22 @@
+---
+projects:
+ - libosinfo
+ - libvirt
+ - libvirt-cim
+ - libvirt-dbus
+ - libvirt-glib
+ - libvirt-perl
+ - libvirt-python
+ - libvirt-sandbox
+ - libvirt-tck
+ - osinfo-db
+ - osinfo-db-tools
+ - virt-manager
+ - virt-viewer
+
+package_format: 'rpm'
+package_manager: 'zypper'
+os_name: 'OpenSUSE'
+os_version: '15'
+
+ansible_python_interpreter: /usr/bin/python3
diff --git a/guests/host_vars/libvirt-opensuse-tumbleweed/docker.yml b/guests/host_vars/libvirt-opensuse-tumbleweed/docker.yml
new file mode 100644
index 0000000..cc79a22
--- /dev/null
+++ b/guests/host_vars/libvirt-opensuse-tumbleweed/docker.yml
@@ -0,0 +1,2 @@
+---
+docker_base: opensuse/tumbleweed
diff --git a/guests/host_vars/libvirt-opensuse-tumbleweed/install.yml b/guests/host_vars/libvirt-opensuse-tumbleweed/install.yml
new file mode 100644
index 0000000..36cea68
--- /dev/null
+++ b/guests/host_vars/libvirt-opensuse-tumbleweed/install.yml
@@ -0,0 +1,2 @@
+---
+install_url: http://download.opensuse.org/tumbleweed/repo/oss/
diff --git a/guests/host_vars/libvirt-opensuse-tumbleweed/main.yml b/guests/host_vars/libvirt-opensuse-tumbleweed/main.yml
new file mode 100644
index 0000000..828df81
--- /dev/null
+++ b/guests/host_vars/libvirt-opensuse-tumbleweed/main.yml
@@ -0,0 +1,22 @@
+---
+projects:
+ - libosinfo
+ - libvirt
+ - libvirt-cim
+ - libvirt-dbus
+ - libvirt-glib
+ - libvirt-perl
+ - libvirt-python
+ - libvirt-sandbox
+ - libvirt-tck
+ - osinfo-db
+ - osinfo-db-tools
+ - virt-manager
+ - virt-viewer
+
+package_format: 'rpm'
+package_manager: 'zypper'
+os_name: 'OpenSUSE'
+os_version: 'Tumbleweed'
+
+ansible_python_interpreter: /usr/bin/python3
diff --git a/guests/inventory b/guests/inventory
index 3b15513..71d3c91 100644
--- a/guests/inventory
+++ b/guests/inventory
@@ -8,5 +8,7 @@ libvirt-fedora-rawhide
libvirt-freebsd-11
libvirt-freebsd-12
libvirt-freebsd-current
+libvirt-opensuse-15
+libvirt-opensuse-tumbleweed
libvirt-ubuntu-16
libvirt-ubuntu-18
diff --git a/guests/lcitool b/guests/lcitool
index a630971..7f26731 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -531,6 +531,8 @@ class Application:
install_config = "preseed.cfg"
elif facts["os_name"] in ["CentOS", "Fedora"]:
install_config = "kickstart.cfg"
+ elif facts["os_name"] == "OpenSUSE":
+ install_config = "autoinst.xml"
else:
raise Exception(
"Host {} doesn't support installation".format(host)
diff --git a/guests/playbooks/update/tasks/base.yml b/guests/playbooks/update/tasks/base.yml
index 3d83e78..b6a2cd2 100644
--- a/guests/playbooks/update/tasks/base.yml
+++ b/guests/playbooks/update/tasks/base.yml
@@ -65,12 +65,27 @@
when:
- package_format == 'pkg'
+- name: Update installed packages
+ command: '{{ package_manager }} update -y -l --force-resolution --no-recommends'
+ args:
+ warn: no
+ when:
+ - os_name == 'OpenSUSE'
+
- name: Clean up packages after update
shell: '{{ package_manager }} clean packages -y && {{ package_manager }} autoremove -y'
args:
warn: no
when:
- package_format == 'rpm'
+ - not os_name == "OpenSUSE"
+
+- name: Clean up packages after update
+ shell: '{{ package_manager }} clean'
+ args:
+ warn: no
+ when:
+ - os_name == "OpenSUSE"
- name: Clean up packages after update
apt:
diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index bd9b161..8359ce2 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -19,10 +19,10 @@
# - deb, pkg, rpm
#
# Valid OS names are:
-# - CentOS, Debian, Fedora, FreeBSD, Ubuntu
+# - CentOS, Debian, Fedora, FreeBSD, OpenSUSE, Ubuntu
#
# Valid OS versions are:
-# - CentOS7, Debian9, FedoraRawhide, Ubuntu18 and so on
+# - CentOS7, Debian9, FedoraRawhide, OpenSUSE15, Ubuntu18 and so on
#
# The arch specific rules use a prefix "$ARCH-" where $ARCH
# is a libvirt arch name.
@@ -70,6 +70,7 @@ mappings:
apparmor:
deb: libapparmor-dev
+ OpenSUSE: libapparmor-devel
cross-policy-deb: foreign
augeas:
@@ -117,6 +118,7 @@ mappings:
cppi:
Fedora: cppi
FreeBSD: cppi
+ OpenSUSE: cppi
cyrus-sasl:
deb: libsasl2-dev
@@ -127,6 +129,7 @@ mappings:
dbus-daemon:
default: dbus
Fedora: dbus-daemon
+ OpenSUSE: dbus-1
device-mapper:
deb: libdevmapper-dev
@@ -196,6 +199,7 @@ mappings:
deb: libglusterfs-dev
rpm: glusterfs-api-devel
Debian9: glusterfs-common
+ OpenSUSE: glusterfs-devel
Ubuntu16: glusterfs-common
Ubuntu18: glusterfs-common
cross-policy-deb: foreign
@@ -204,6 +208,7 @@ mappings:
deb: libgnutls28-dev
pkg: gnutls
rpm: gnutls-devel
+ OpenSUSE: libgnutls-devel
cross-policy-deb: foreign
go:
@@ -228,6 +233,7 @@ mappings:
gtk-update-icon-cache:
default: gtk-update-icon-cache
+ OpenSUSE: gtk3-tools
Ubuntu16: libgtk2.0-bin
gtk-vnc2:
@@ -248,14 +254,17 @@ mappings:
ip:
deb: iproute2
rpm: iproute
+ OpenSUSE: iproute2
iscsiadm:
deb: open-iscsi
rpm: iscsi-initiator-utils
+ OpenSUSE: open-iscsi
isoinfo:
default: genisoimage
FreeBSD: cdrkit
+ OpenSUSE: mkisofs
java:
deb: openjdk-11-jre-headless
@@ -289,6 +298,7 @@ mappings:
libaudit:
deb: libaudit-dev
rpm: audit-libs-devel
+ OpenSUSE: audit-devel
cross-policy-deb: foreign
libblkid:
@@ -320,6 +330,7 @@ mappings:
deb: libdbus-1-dev
pkg: dbus
rpm: dbus-devel
+ OpenSUSE: dbus-1-devel
cross-policy-deb: foreign
libgovirt:
@@ -347,6 +358,7 @@ mappings:
rpm: numactl-devel
armv6l-deb:
armv7l-deb:
+ OpenSUSE: libnuma-devel
cross-policy-deb: foreign
libparted:
@@ -370,6 +382,7 @@ mappings:
deb: librbd-dev
Fedora: librbd-devel
CentOS7: librbd1-devel
+ OpenSUSE: librbd-devel
cross-policy-deb: foreign
libselinux:
@@ -436,6 +449,7 @@ mappings:
deb: locales
Fedora: glibc-langpack-en
FreeBSD:
+ OpenSUSE: glibc-locale
lsof:
default: lsof
@@ -458,6 +472,7 @@ mappings:
ninja:
default: ninja-build
FreeBSD: ninja
+ OpenSUSE: ninja
mingw32-curl:
Fedora: mingw32-curl
@@ -639,6 +654,7 @@ mappings:
netcf:
deb: libnetcf-dev
rpm: netcf-devel
+ OpenSUSE:
cross-policy-deb: skip
net-tools:
@@ -678,6 +694,7 @@ mappings:
deb: perl
pkg: perl5
rpm: perl-Archive-Tar
+ OpenSUSE: perl-Archive-Tar-Wrapper
perl-CPAN-Changes:
deb: libcpan-changes-perl
@@ -709,6 +726,7 @@ mappings:
deb: libio-compress-perl
pkg: p5-IO-Compress
rpm: perl-IO-Compress-Bzip2
+ OpenSUSE: perl-Compress-Bzip2
perl-IO-String:
deb: libio-string-perl
@@ -747,6 +765,7 @@ mappings:
deb: libtest-lwp-useragent-perl
pkg: p5-Test-LWP-UserAgent
Fedora: perl-Test-LWP-UserAgent
+ OpenSUSE: perl-Test-LWP-UserAgent
perl-Test-Pod:
deb: libtest-pod-perl
@@ -809,20 +828,24 @@ mappings:
deb: python-dev
pkg: python2
rpm: python2-devel
+ OpenSUSE: python-devel
cross-policy-deb: foreign
python2-lxml:
default: python-lxml
Fedora: python2-lxml
FreeBSD: py27-lxml
+ OpenSUSE: python2-lxml
python2-nose:
default: python-nose
Fedora: python2-nose
FreeBSD: py27-nose
+ OpenSUSE: python2-nose
python2-setuptools:
CentOS7: python2-setuptools
+ OpenSUSE: python2-setuptools
python3:
default: python3
@@ -831,6 +854,7 @@ mappings:
default: python3-dbus
FreeBSD: py36-dbus
CentOS7: python36-dbus
+ OpenSUSE: python3-dbus-python
python3-devel:
deb: python3-dev
@@ -838,17 +862,20 @@ mappings:
Fedora: python3-devel
CentOS7: python36-devel
cross-policy-deb: foreign
+ OpenSUSE: python3-devel
python3-gi:
deb: python3-gi
pkg: py36-gobject3
rpm: python3-gobject
CentOS7: python36-gobject
+ OpenSUSE: python3-gobject
python3-libxml2:
default: python3-libxml2
FreeBSD: py36-libxml2
CentOS7:
+ OpenSUSE: python3-libxml2-python
Ubuntu16:
python3-lxml:
@@ -864,6 +891,7 @@ mappings:
python3-pip:
CentOS7: python3-pip
Debian9: python3-pip
+ OpenSUSE: python3-pip
Ubuntu16: python3-pip
Ubuntu18: python3-pip
@@ -884,6 +912,7 @@ mappings:
qemu-img:
default: qemu-utils
rpm: qemu-img
+ OpenSUSE: qemu-tools
radvd:
default: radvd
@@ -929,6 +958,7 @@ mappings:
deb: libspice-client-gtk-3.0-dev
pkg: spice-gtk
rpm: spice-gtk3-devel
+ OpenSUSE: spice-gtk-devel
cross-policy-deb: foreign
strace:
@@ -942,6 +972,7 @@ mappings:
deb: iproute2
rpm: iproute-tc
CentOS7: iproute
+ OpenSUSE: iproute2
unzip:
default: unzip
@@ -964,10 +995,12 @@ mappings:
wireshark:
deb: wireshark-dev
Fedora: wireshark-devel
+ OpenSUSE: wireshark-devel
cross-policy-deb: skip
xen:
Fedora: xen-devel
+ OpenSUSE: xen-devel
x86_64-deb: libxen-dev
armv7l-deb: libxen-dev
aarch64-deb: libxen-dev
@@ -994,18 +1027,21 @@ mappings:
xz-static:
deb: liblzma-dev
Fedora: xz-static
+ OpenSUSE: xz-static-devel
cross-policy-deb: foreign
yajl:
deb: libyajl-dev
pkg: yajl
rpm: yajl-devel
+ OpenSUSE: libyajl-devel
cross-policy-deb: foreign
zfs:
default: zfs-fuse
CentOS:
FreeBSD:
+ OpenSUSE:
zlib:
deb: zlib1g-dev
@@ -1015,6 +1051,7 @@ mappings:
zlib-static:
deb: zlib1g-dev
rpm: zlib-static
+ OpenSUSE: zlib-devel-static
cross-policy-deb: foreign
--
2.24.0
4 years, 11 months
[libvirt] [PATCH] maint: Post-release version bump to 5.11.0
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Pushing under the trivial rule.
configure.ac | 2 +-
docs/news.xml | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index ef521e370c..d0ef7de750 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
-AC_INIT([libvirt], [5.10.0], [libvir-list(a)redhat.com], [], [https://libvirt.org])
+AC_INIT([libvirt], [5.11.0], [libvir-list(a)redhat.com], [], [https://libvirt.org])
if test $srcdir = "."
then
diff --git a/docs/news.xml b/docs/news.xml
index 46a3466238..e4533cc46e 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -42,6 +42,14 @@
-->
<libvirt>
+ <release version="v5.11.0" date="unreleased">
+ <section title="New features">
+ </section>
+ <section title="Improvements">
+ </section>
+ <section title="Bug fixes">
+ </section>
+ </release>
<release version="v5.10.0" date="2019-12-02">
<section title="New features">
<change>
--
2.24.0
4 years, 11 months
[libvirt] [PATCH v3 0/4] qemu: block: implement optional removal of committed snapshot images
by Pavel Mores
v3 aims to incorporate Peter's feedback to v2, mainly:
- patch 1 was split into two - the delete flag propagation stays in patch 1,
the actual enabling the feature was moved to what's now patch 4
- patch 2 was modified to handle NFS and to use g_strerror() instead of
strerror_r()
- the former patch 4 was squashed into patch 3.
Pavel Mores (4):
qemu: block: propagate the delete flag to where it can actually be
used
qemu: block: use the delete flag to delete snapshot images if
requested
qemu: block: store the delete flag in libvirtd's status XML
qemu: block: enable the snapshot image deletion feature
src/qemu/qemu_blockjob.c | 43 ++++++++++++++++++-
src/qemu/qemu_blockjob.h | 4 +-
src/qemu/qemu_domain.c | 6 ++-
src/qemu/qemu_domain.h | 6 +++
src/qemu/qemu_driver.c | 5 ++-
.../blockjob-blockdev-in.xml | 1 +
6 files changed, 60 insertions(+), 5 deletions(-)
--
2.21.0
4 years, 11 months
[libvirt] [glib PATCH] glib,docs: Remove "object-tree" chapter
by Fabiano Fidêncio
gtk-doc-1.30+ does *not* create tree_index.sgml in case the library does
not provide GObjects, which is the case of LibvirtGLib. In previous
versions, though, an empty file would be generated.
This seems to be a regression which hit *a* *lot* of different projects,
all of them having to take the very same approach.
Signed-off-by: Fabiano Fidêncio <fidencio(a)redhat.com>
---
docs/libvirt-glib/Libvirt-glib-docs.xml | 4 ----
1 file changed, 4 deletions(-)
diff --git a/docs/libvirt-glib/Libvirt-glib-docs.xml b/docs/libvirt-glib/Libvirt-glib-docs.xml
index f2f3572..505f138 100644
--- a/docs/libvirt-glib/Libvirt-glib-docs.xml
+++ b/docs/libvirt-glib/Libvirt-glib-docs.xml
@@ -16,10 +16,6 @@
<xi:include href="xml/libvirt-glib-error.xml"/>
<xi:include href="xml/libvirt-glib-event.xml"/>
</chapter>
- <chapter id="object-tree">
- <title>Object Hierarchy</title>
- <xi:include href="xml/tree_index.sgml"/>
- </chapter>
<index id="api-index-full">
<title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
--
2.23.0
4 years, 11 months
[libvirt] Libvirt 5.9.0 Lags
by Dincer Beken
Hello all,
I am using Arch Linux 5.3.13-arch1-1 and libvirt 5.9.0.
After I made a linux update (sudo pacman -Syu), I got the new, libvirt version mentioned above.
But soon after I realized, while programming in eclipse, that copy paste does not work anymore. After couple of tries, when I try to copy some lines of code, it freezes for a short time, and looses the copied text in the clipboard.
I converted the VM's into vdi and continuing to work with virtual box. There, on the same laptop and the same VM, I don't have that issue!
Is this a known issue? I really need a fix urgently, since I ve got other VMs which are optimized for KVM.
I ve also post this issue to stackoverflow:
https://stackoverflow.com/questions/59155986/lags-in-libvirt-5-9-0
Many Thanks, Dincer
4 years, 11 months
[libvirt] [PATCH 00/21] Incremental backup support for qemu
by Peter Krempa
This is a finished version of my RFC posted here:
https://www.redhat.com/archives/libvir-list/2019-October/msg01193.html
All cleanups of that series are now merged and this series has new
cleanups and depending patches that I posted earlier this week. For
convenience everything can be fetched at:
git fetch https://gitlab.com/pipo.sk/libvirt.git blockdev-backup
This series requires qemu 4.2 to work properly. Please make sure to
fetch the current head.
Compared to previous versions:
- The API is similar to what was posted last time or in Eric's version
- the backup job ID was removed, this can't be integrated with qemu
async jobs as there is only one async jobs.
- the virDomainBackupEnd API was removed as virDomainAbortJob can be
used instead
- the usage of domain job APIs is fully implemented as it was documented
in previous eric's postings
- the domain job completion event and completed job statistics are used
to notify about the state and successful finishing of the job
(see virDomainGetJobStats/virsh domjobinfo)
- unfortunately block jobs and snapshots are still not supported, thus
this feature will stay disabled for now:
If you want to give the feature a spin you must use the following XML
override:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
<qemu:capabilities>
<qemu:add capability='incremental-backup'/>
</qemu:capabilities>
</domain>
Eric Blake (5):
backup: Document new XML for backups
backup: Introduce virDomainBackup APIs
backup: Implement backup APIs for remote driver
backup: Parse and output backup XML
backup: Implement virsh support for backup
Peter Krempa (16):
API: Introduce field for reporting temporary disk space usage of a
domain job
virsh: Implement VIR_DOMAIN_JOB_DISK_TEMP_(USED|TOTAL) in
cmdDomjobinfo
API: Add domain job operation for backups
qemu: Add infrastructure for statistics of a backup job
qemu: domain: Introduce QEMU_ASYNC_JOB_BACKUP async job type
Add 'backup' block job type
qemu: monitor: Add support for blockdev-backup via 'transaction'
qemu: domain: Track backup job data in the status XML
qemu: blockjob: Track internal data for 'backup' blockjob
tests: qemustatusxml2xml: Add test for 'pull' type backup job
conf: backup: Add fields for tracking stats of completed sub-jobs
doc: Document quirk of getting block job info for a 'backup' blockjob
qemu: Implement backup job APIs and qemu handling
qemu: backup: Implement stats gathering while the job is running
qemu: driver: Allow cancellation of the backup job
qemu: blockjob: Implement concluded blockjob handler for backup
blockjobs
docs/docs.html.in | 3 +-
docs/format.html.in | 1 +
docs/formatbackup.html.in | 161 +++
docs/formatcheckpoint.html.in | 12 +-
docs/index.html.in | 3 +-
docs/schemas/domainbackup.rng | 214 ++++
examples/c/misc/event-test.c | 3 +
include/libvirt/libvirt-domain.h | 32 +-
libvirt.spec.in | 1 +
mingw-libvirt.spec.in | 2 +
po/POTFILES.in | 3 +
src/conf/Makefile.inc.am | 2 +
src/conf/backup_conf.c | 499 ++++++++
src/conf/backup_conf.h | 108 ++
src/conf/domain_conf.c | 2 +-
src/conf/virconftypes.h | 3 +
src/driver-hypervisor.h | 12 +
src/libvirt-domain-checkpoint.c | 7 +-
src/libvirt-domain.c | 142 +++
src/libvirt_private.syms | 8 +
src/libvirt_public.syms | 6 +
src/qemu/Makefile.inc.am | 2 +
src/qemu/qemu_backup.c | 1017 +++++++++++++++++
src/qemu/qemu_backup.h | 46 +
src/qemu/qemu_blockjob.c | 96 +-
src/qemu/qemu_blockjob.h | 17 +
src/qemu/qemu_domain.c | 140 +++
src/qemu/qemu_domain.h | 14 +
src/qemu/qemu_driver.c | 68 +-
src/qemu/qemu_migration.c | 2 +
src/qemu/qemu_monitor.c | 13 +
src/qemu/qemu_monitor.h | 15 +
src/qemu/qemu_monitor_json.c | 33 +
src/qemu/qemu_monitor_json.h | 8 +
src/qemu/qemu_process.c | 25 +
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 33 +-
src/remote_protocol-structs | 15 +
tests/Makefile.am | 3 +
tests/domainbackupxml2xmlin/backup-pull.xml | 9 +
tests/domainbackupxml2xmlin/backup-push.xml | 9 +
tests/domainbackupxml2xmlin/empty.xml | 1 +
tests/domainbackupxml2xmlout/backup-pull.xml | 9 +
tests/domainbackupxml2xmlout/backup-push.xml | 9 +
tests/domainbackupxml2xmlout/empty.xml | 7 +
tests/qemumonitorjsontest.c | 8 +-
.../qemustatusxml2xmldata/backup-pull-in.xml | 607 ++++++++++
.../qemustatusxml2xmldata/backup-pull-out.xml | 1 +
tests/qemuxml2xmltest.c | 2 +
tests/virschematest.c | 2 +
tools/Makefile.am | 1 +
tools/virsh-backup.c | 144 +++
tools/virsh-backup.h | 21 +
tools/virsh-domain.c | 26 +-
tools/virsh.c | 2 +
tools/virsh.h | 1 +
tools/virsh.pod | 32 +
57 files changed, 3639 insertions(+), 25 deletions(-)
create mode 100644 docs/formatbackup.html.in
create mode 100644 docs/schemas/domainbackup.rng
create mode 100644 src/conf/backup_conf.c
create mode 100644 src/conf/backup_conf.h
create mode 100644 src/qemu/qemu_backup.c
create mode 100644 src/qemu/qemu_backup.h
create mode 100644 tests/domainbackupxml2xmlin/backup-pull.xml
create mode 100644 tests/domainbackupxml2xmlin/backup-push.xml
create mode 100644 tests/domainbackupxml2xmlin/empty.xml
create mode 100644 tests/domainbackupxml2xmlout/backup-pull.xml
create mode 100644 tests/domainbackupxml2xmlout/backup-push.xml
create mode 100644 tests/domainbackupxml2xmlout/empty.xml
create mode 100644 tests/qemustatusxml2xmldata/backup-pull-in.xml
create mode 120000 tests/qemustatusxml2xmldata/backup-pull-out.xml
create mode 100644 tools/virsh-backup.c
create mode 100644 tools/virsh-backup.h
--
2.23.0
4 years, 11 months
[libvirt] [jenkins-ci PATCH] lcitool: Explain our use of the 'ks' kernel parameter
by Andrea Bolognani
It's not immediately obvious why we're using it even when installing
a distribution like Debian, so explain the motivation in a comment.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/lcitool | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/guests/lcitool b/guests/lcitool
index a630971..0e27796 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -540,7 +540,9 @@ class Application:
# preseed files must use a well-known name to be picked up by
# d-i; for kickstart files, we can use whatever name we please
# but we need to point anaconda in the right direction through
- # a kernel argument
+ # the 'ks' kernel parameter. We can use 'ks' unconditionally
+ # for simplicity's sake, because distributions that don't use
+ # kickstart for unattended installation will simply ignore it
extra_arg = "console=ttyS0 ks=file:/{}".format(install_config)
virt_install = distutils.spawn.find_executable("virt-install")
--
2.23.0
4 years, 11 months