[libvirt] [PATCH v2 0/3] Update VRDE server port handling.
by Dawid Zamirski
v1: https://www.redhat.com/archives/libvir-list/2017-October/msg00421.html
Changes since v1:
* separate out the patch that drops VBOX_SESSION_OPEN/CLOSE macros.
* reverse logic to check for rdp.autoport instead of rdp.port to avoid
handling port = -1
* do not set rdp.port = -1 if vboxGetActiveRdpPort returns -1 and add
more verbose code comments to clarify the logic
Dawid Zamirski (3):
vbox: Remove old unflexible macros
vbox: Make autoport set RDP port range.
vbox: Read runtime RDP port and handle autoport
src/vbox/vbox_common.c | 3 +-
src/vbox/vbox_tmpl.c | 159 ++++++++++++++++++++++++++++++------------
src/vbox/vbox_uniformed_api.h | 2 +-
3 files changed, 118 insertions(+), 46 deletions(-)
--
2.14.2
7 years, 1 month
[libvirt] [PATCH go-xml] Add bootp option to NetworkDHCP
by Michal Rostecki
From: Michal Rostecki <michal.rostecki(a)gmail.com>
Support specyfing concrete file and TFTP server
for PXE boot.
Signed-off-by: Michal Rostecki <michal.rostecki(a)gmail.com>
---
network.go | 6 ++++++
network_test.go | 7 +++++++
2 files changed, 13 insertions(+)
diff --git a/network.go b/network.go
index 32f125a..10c4dfc 100644
--- a/network.go
+++ b/network.go
@@ -78,9 +78,15 @@ type NetworkDHCPHost struct {
IP string `xml:"ip,attr,omitempty"`
}
+type NetworkBootp struct {
+ File string `xml:"file,attr,omitempty"`
+ Server string `xml:"server,attr,omitempty"`
+}
+
type NetworkDHCP struct {
Ranges []NetworkDHCPRange `xml:"range"`
Hosts []NetworkDHCPHost `xml:"host"`
+ Bootp []NetworkBootp `xml:"bootp"`
}
type NetworkIP struct {
diff --git a/network_test.go b/network_test.go
index b1bd168..3efb278 100644
--- a/network_test.go
+++ b/network_test.go
@@ -100,6 +100,12 @@ var networkTestData = []struct {
IP: "192.168.122.10",
},
},
+ Bootp: []NetworkBootp{
+ NetworkBootp{
+ File: "pxelinux.0",
+ Server: "192.168.122.1",
+ },
+ },
},
},
NetworkIP{
@@ -179,6 +185,7 @@ var networkTestData = []struct {
` <dhcp>`,
` <range start="192.168.122.2" end="192.168.122.254"></range>`,
` <host mac="00:16:3e:77:e2:ed" name="foo.example.com" ip="192.168.122.10"></host>`,
+ ` <bootp file="pxelinux.0" server="192.168.122.1"></bootp>`,
` </dhcp>`,
` </ip>`,
` <ip address="2001:db8:ca2:2::1" family="ipv6" prefix="64">`,
--
2.13.6
7 years, 2 months
[libvirt] [PATCH] spec: Restart libvirtd in posttrans
by Jiri Denemark
When upgrading libvirt packages, there's no strict ordering for the
installation or removal of the individual libvirt sub packages. Thus
libvirt-daemon may be upgraded (and its %postun scriptlet) started
before all sub packages with driver libraries are upgraded. When
libvirt-daemon's %postun scriptlet restarts the daemon old drivers may
still be laying around and the daemon may crash when it tries to use
them.
Let's restart the daemon in %posttrans to make sure libvirtd is
restarted only after all sub packages are at the same version.
https://bugzilla.redhat.com/show_bug.cgi?id=1464300
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
libvirt.spec.in | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 0123d0655..73e647cb5 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1554,13 +1554,11 @@ fi
if [ $1 -ge 1 ] ; then
/bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || :
/bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || :
- /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
fi
%else
if [ $1 -ge 1 ]; then
/sbin/service virtlockd reload > /dev/null 2>&1 || :
/sbin/service virtlogd reload > /dev/null 2>&1 || :
- /sbin/service libvirtd condrestart > /dev/null 2>&1
fi
%endif
@@ -1570,10 +1568,16 @@ fi
if [ "$1" -ge "1" ]; then
/sbin/service virtlockd reload > /dev/null 2>&1 || :
/sbin/service virtlogd reload > /dev/null 2>&1 || :
- /sbin/service libvirtd condrestart > /dev/null 2>&1
fi
%endif
+%posttrans daemon
+%if %{with_systemd}
+/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
+%else
+/sbin/service libvirtd condrestart > /dev/null 2>&1 || :
+%endif
+
# In upgrade scenario we must explicitly enable virtlockd/virtlogd
# sockets, if libvirtd is already enabled and start them if
# libvirtd is running, otherwise you'll get failures to start
@@ -1642,11 +1646,13 @@ fi
%post daemon-config-nwfilter
cp %{_datadir}/libvirt/nwfilter/*.xml %{_sysconfdir}/libvirt/nwfilter/
+
+%posttrans daemon-config-nwfilter
# Make sure libvirt picks up the new nwfilter defininitons
%if %{with_systemd}
- /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 ||:
+/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
%else
- /sbin/service libvirtd condrestart > /dev/null 2>&1 || :
+/sbin/service libvirtd condrestart > /dev/null 2>&1 || :
%endif
--
2.14.2
7 years, 2 months
[libvirt] [PATCH] virsh: domain: Fix option handling in domxml-to-native
by Peter Krempa
Commit fdeac7a05fdf85458d72e89efcfa0f444525aaad tried to fix the output
of 'virsh --help domxml-to-native' by switching types around. One of the
changes broke the option parser. VSH_OT_ARGV should be used only for
variable argument count, not to make the help generator look pretty.
The correct option type in this case is VSH_OT_STRING as it's not
mandatory now since it can be substituted by using --domain.
This makes --help for this command look incorrect, but the parser works
as it should.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1494400
---
tools/virsh-domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index e1a312a6a..1e33e8295 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10152,7 +10152,7 @@ static const vshCmdOptDef opts_domxmltonative[] = {
.help = N_("domain name, id or uuid")
},
{.name = "xml",
- .type = VSH_OT_ARGV,
+ .type = VSH_OT_STRING,
.help = N_("xml data file to export from")
},
{.name = NULL}
--
2.13.6
7 years, 2 months
[libvirt] [PATCH] qemu: Reset hasManagedSave after removing a corrupted image
by Jiri Denemark
When starting a domain with managed save image, we try to restore it
first. If the image is corrupted, we silently unlink it and just
normally start the domain. At this point the domain has no managed save
image, yet we did not reset the hasManagedSave flag.
https://bugzilla.redhat.com/show_bug.cgi?id=1460962
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 32a416f9e..74fdfdb0f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7256,6 +7256,7 @@ qemuDomainObjStart(virConnectPtr conn,
} else {
VIR_WARN("Ignoring incomplete managed state %s", managed_save);
priv->job.current->operation = op;
+ vm->hasManagedSave = false;
}
}
}
--
2.14.2
7 years, 2 months
[libvirt] [PATCH] iohelper: use saferead if later write with O_DIRECT
by Nikolay Shirokovskiy
One of the usecases of iohelper is to read from pipe and write
to file with O_DIRECT. As we read from pipe we can have partial
read and then we fail to write this data because output file
is open with O_DIRECT and buffer size is not aligned.
---
src/util/iohelper.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/util/iohelper.c b/src/util/iohelper.c
index 5416d45..bb8a8dd 100644
--- a/src/util/iohelper.c
+++ b/src/util/iohelper.c
@@ -109,9 +109,21 @@ runIO(const char *path, int fd, int oflags)
while (1) {
ssize_t got;
- if ((got = read(fdin, buf, buflen)) < 0) {
- if (errno == EINTR)
+ /* If we read with O_DIRECT from file we can't use saferead as
+ * it can lead to unaligned read after reading last bytes.
+ * If we write with O_DIRECT use should use saferead so that
+ * writes will be aligned.
+ * In other cases using saferead reduces number of syscalls.
+ */
+ if (fdin == fd && direct) {
+ if ((got = read(fdin, buf, buflen)) < 0 &&
+ errno == EINTR)
continue;
+ } else {
+ got = saferead(fdin, buf, buflen);
+ }
+
+ if (got < 0) {
virReportSystemError(errno, _("Unable to read %s"), fdinname);
goto cleanup;
}
--
1.8.3.1
7 years, 2 months
[libvirt] [PATCH v1 0/5] Predictable file names for memory-backend-file
by Michal Privoznik
As discussed here [1], for some types of environment it's important to
allocate memory upfront. In such cases libvirt needs to reuse the paths.
However, since we don't want to expose the paths anywhere, reversed
approach is implemented. If enabled in config file, libvirt builds
predictable paths for memory-backend-file.
1: https://www.redhat.com/archives/libvir-list/2017-October/msg01036.html
As usual, you can also find all the patches on my github:
https://github.com/zippy2/libvirt/tree/aliases_from_user_v2
(Why v2? Don't ask.)
Michal Privoznik (5):
conf: s/virDomainObjGetShortName/virDomainDefGetShortName/
qemu: Move memPath generation from memoryBackingDir to a separate
function
qemu.conf: Introduce memory_predictable_file_names
qemuxml2argvtest: Test memory_predictable_file_names
news: Document memory_predictable_file_names
docs/news.xml | 10 ++
src/conf/domain_conf.c | 4 +-
src/conf/domain_conf.h | 2 +-
src/libvirt_private.syms | 2 +-
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 5 +
src/qemu/qemu_command.c | 9 +-
src/qemu/qemu_conf.c | 92 +++++++++++++-
src/qemu/qemu_conf.h | 11 ++
src/qemu/qemu_domain.c | 4 +-
src/qemu/qemu_driver.c | 21 ++-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_process.c | 141 +++++++++++++++------
src/qemu/qemu_process.h | 8 +-
src/qemu/test_libvirtd_qemu.aug.in | 1 +
.../qemuxml2argv-cpu-numa-memshared.args | 6 +-
.../qemuxml2argv-fd-memory-numa-topology.args | 3 +-
.../qemuxml2argv-fd-memory-numa-topology2.args | 6 +-
.../qemuxml2argv-fd-memory-numa-topology3.args | 9 +-
.../qemuxml2argv-hugepages-memaccess2.args | 9 +-
tests/qemuxml2argvtest.c | 1 +
21 files changed, 279 insertions(+), 68 deletions(-)
--
2.13.6
7 years, 2 months
[libvirt] libvirt not wanting to read back its own interface XML
by Marc Haber
Hi,
I'm trying to give libvirt knowlegde of a VLAN interface that is
configured by a different means and not by libvirt. To figure out the
syntax, I created a VLAN interface through virt-manager and dumped out
the XML:
<interface type='vlan' name='ens3.180'>
<protocol family='ipv6'>
<ip address='2a01:4f8:150:436c::55:100' prefix='64'/>
<ip address='fe80::5054:ff:fe30:e0d1' prefix='64'/>
</protocol>
<link speed='4294967295' state='up'/>
<vlan tag='180'>
<interface name='ens3'/>
</vlan>
</interface>
I then removed the Interface in virt-manager and tried to have libvirt
read back its own XML.
[12/784]mh@testsid85:~ $ virsh iface-dumpxml ens3.180 > ens3.180.xml
[13/785]mh@testsid85:~ $ virsh iface-define ens3.180.xml
error: Failed to define interface from ens3.180.xml
error: XML error: could not get interface XML description: XML invalid - Expecting an element start, got nothing
What is going on here? How do I define a VLAN interface via XML?
Greetings
Marc
--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
7 years, 2 months
[libvirt] [jenkins-ci PATCH v2 0/5] guests: Fixes for development releases
by Andrea Bolognani
Changes from [v1]:
* rebase on top of current master;
* perform pure code motions in a separate patch;
* clean up non-CI guests.
[v1] https://www.redhat.com/archives/libvir-list/2017-October/msg01045.html
Andrea Bolognani (5):
guests: Shuffle base steps around
guests: Use non-debug kernel on Fedora Rawhide
guests: Clean up non-CI guests
ansible: Use ansible_distribution_release on FreeBSD
guests: Add Debian sid and FreeBSD -CURRENT
guests/files/fedora-rawhide-kernel-nodebug.repo | 8 ++
guests/host_vars/libvirt-debian-sid/install.yml | 3 +
.../main.yml | 2 +-
.../main.yml | 11 ++-
guests/host_vars/libvirt-ubuntu-12/main.yml | 1 -
guests/host_vars/libvirt-ubuntu-14/main.yml | 1 -
guests/host_vars/libvirt-ubuntu-16/main.yml | 1 -
guests/tasks/base.yml | 61 +++++++++-----
guests/vars/mappings.yml | 3 +-
guests/vars/vault.yml | 98 ++++++++++------------
10 files changed, 107 insertions(+), 82 deletions(-)
create mode 100644 guests/files/fedora-rawhide-kernel-nodebug.repo
create mode 100644 guests/host_vars/libvirt-debian-sid/install.yml
copy guests/host_vars/{libvirt-ubuntu-16 => libvirt-debian-sid}/main.yml (94%)
copy guests/host_vars/{libvirt-ubuntu-16 => libvirt-freebsd-current}/main.yml (51%)
--
2.13.6
7 years, 2 months