[libvirt] [PATCH] qemu: Don't assume secret provided for LUKS encryption
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1405269
If a secret was not provided for what was determined to be a LUKS
encrypted disk (during virStorageFileGetMetadata processing when
called from qemuDomainDetermineDiskChain as a result of hotplug
attach qemuDomainAttachDeviceDiskLive), then do not attempt to
look it up (avoiding a libvirtd crash) and do not alter the format
to "luks" when adding the disk; otherwise, the device_add would
fail with a message such as:
"unable to execute QEMU command 'device_add': Property 'scsi-hd.drive'
can't find value 'drive-scsi0-0-0-0'"
because of assumptions that when the format=luks that libvirt would have
provided the secret to decrypt the volume.
Access to unlock the volume will thus be left to the application.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
I could have spread things over 2 patches (one to create the helper
and one to add the extra check for nsecrets > 0), but just going with
one to fix the issue just felt cleaner (besides makes any possible
backports a bit simpler).
NB: The "extra" !virStorageSourceIsEmpty check for the qemu_command
path is a no-op essentially.
src/qemu/qemu_command.c | 3 +--
src/qemu/qemu_domain.c | 15 +++++++++++++--
src/qemu/qemu_domain.h | 3 +++
src/qemu/qemu_hotplug.c | 3 ++-
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f8e48d2..28d8146 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1442,8 +1442,7 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk,
if (disk->src->format > 0 &&
disk->src->type != VIR_STORAGE_TYPE_DIR) {
const char *qemuformat = virStorageFileFormatTypeToString(disk->src->format);
- if (disk->src->encryption &&
- disk->src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS)
+ if (qemuDomainDiskHasEncryptionSecret(disk->src))
qemuformat = "luks";
virBufferAsprintf(buf, "format=%s,", qemuformat);
}
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index acfa695..25cb4ad 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1174,6 +1174,18 @@ qemuDomainSecretDiskCapable(virStorageSourcePtr src)
}
+bool
+qemuDomainDiskHasEncryptionSecret(virStorageSourcePtr src)
+{
+ if (!virStorageSourceIsEmpty(src) && src->encryption &&
+ src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS &&
+ src->encryption->nsecrets > 0)
+ return true;
+
+ return false;
+}
+
+
/* qemuDomainSecretDiskPrepare:
* @conn: Pointer to connection
* @priv: pointer to domain private object
@@ -1209,8 +1221,7 @@ qemuDomainSecretDiskPrepare(virConnectPtr conn,
diskPriv->secinfo = secinfo;
}
- if (!virStorageSourceIsEmpty(src) && src->encryption &&
- src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
+ if (qemuDomainDiskHasEncryptionSecret(src)) {
if (VIR_ALLOC(secinfo) < 0)
return -1;
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index b2db45e..cce879f 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -734,6 +734,9 @@ void qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk)
bool qemuDomainSecretDiskCapable(virStorageSourcePtr src)
ATTRIBUTE_NONNULL(1);
+bool qemuDomainDiskHasEncryptionSecret(virStorageSourcePtr src)
+ ATTRIBUTE_NONNULL(1);
+
int qemuDomainSecretDiskPrepare(virConnectPtr conn,
qemuDomainObjPrivatePtr priv,
virDomainDiskDefPtr disk)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 92a2e73..6b10e63 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3584,7 +3584,8 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
* can remove the luks object password too
*/
if (!virStorageSourceIsEmpty(disk->src) && disk->src->encryption &&
- disk->src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS) {
+ disk->src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS &&
+ disk->src->encryption->nsecrets > 0) {
if (!(encAlias =
qemuDomainGetSecretAESAlias(disk->info.alias, true))) {
--
2.7.4
7 years, 10 months
[libvirt] [PATCH 0/3] Fix networkxml2conftest on FreeBSD
by Martin Kletzander
Yet another approach. If you hate it, we still have this:
https://www.redhat.com/archives/libvir-list/2016-December/msg01123.html
as an option.
Martin Kletzander (3):
networkxml2conftest: Rename outxml to outconf
networkxml2conftest: Indent function parameters properly
networkxml2conftest: Fix build on BSD
tests/networkxml2confdata/dhcp6-nat-network.conf | 2 +-
tests/networkxml2confdata/dhcp6-network.conf | 2 +-
.../dhcp6host-routed-network.conf | 2 +-
tests/networkxml2confdata/isolated-network.conf | 2 +-
.../nat-network-dns-forward-plain.conf | 2 +-
.../nat-network-dns-forwarders.conf | 2 +-
.../networkxml2confdata/nat-network-dns-hosts.conf | 2 +-
.../nat-network-dns-local-domain.conf | 2 +-
.../nat-network-dns-srv-record-minimal.conf | 2 +-
.../nat-network-dns-srv-record.conf | 2 +-
.../nat-network-dns-txt-record.conf | 2 +-
.../nat-network-name-with-quotes.conf | 2 +-
tests/networkxml2confdata/nat-network.conf | 2 +-
tests/networkxml2confdata/netboot-network.conf | 2 +-
.../networkxml2confdata/netboot-proxy-network.conf | 2 +-
tests/networkxml2confdata/open-network.conf | 2 +-
tests/networkxml2confdata/ptr-domains-auto.conf | 2 +-
.../networkxml2confdata/routed-network-no-dns.conf | 2 +-
tests/networkxml2confdata/routed-network.conf | 2 +-
tests/networkxml2conftest.c | 51 +++++++++++++++++++---
20 files changed, 63 insertions(+), 26 deletions(-)
--
2.11.0
7 years, 10 months
[libvirt] [PATCH 0/9] Couple of *BSD fixes
by Michal Privoznik
After Andrea pointed out that FreeBSD build is broken [1], I've
started my freebsd domain and found out couple of problems. Here
are the fixes.
Oh, I've noticed alternative approaches to patch 6/9 on the list
[2] [3]. None of them have been ACKed though. Yet.
1: https://www.redhat.com/archives/libvir-list/2016-December/msg01121.html
2: https://www.redhat.com/archives/libvir-list/2016-December/msg00009.html
3: https://www.redhat.com/archives/libvir-list/2016-December/msg01123.html
Michal Privoznik (9):
tests: Run virmacmaptest iff WITH_YAJL
tests: Move test_libraries a bit higher
virt-nss: Introduce more checks before enabling NSS
tests: Run nss*test iff WITH_NSS
src: Build libvirt_nss.la iff WITH_NSS
networkxml2conftest: s/lo/lo0/ on non-Linux
bhyvexml2argvdata: Fix <drive/> addresses
bhyvexml2argvdata: Add mac address to <interface/>
bhyvexml2xmltest: Test more XMLs
configure.ac | 2 +-
m4/virt-nss.m4 | 36 +++++++---
src/Makefile.am | 2 +
tests/Makefile.am | 77 +++++++++++-----------
.../bhyvexml2argvdata/bhyvexml2argv-acpiapic.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.xml | 3 +-
tests/bhyvexml2argvdata/bhyvexml2argv-base.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-base.xml | 3 +-
.../bhyvexml2argv-bhyveload-bootorder.args | 2 +-
.../bhyvexml2argv-bhyveload-bootorder.xml | 5 +-
.../bhyvexml2argv-bhyveload-bootorder1.args | 2 +-
.../bhyvexml2argv-bhyveload-bootorder1.xml | 5 +-
.../bhyvexml2argv-bhyveload-bootorder2.xml | 3 +-
.../bhyvexml2argv-bhyveload-bootorder3.args | 2 +-
.../bhyvexml2argv-bhyveload-bootorder3.xml | 5 +-
.../bhyvexml2argv-bhyveload-bootorder4.xml | 5 +-
.../bhyvexml2argv-bhyveload-explicitargs.args | 2 +-
.../bhyvexml2argv-bhyveload-explicitargs.xml | 3 +-
tests/bhyvexml2argvdata/bhyvexml2argv-console.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-console.xml | 3 +-
.../bhyvexml2argv-custom-loader.args | 2 +-
.../bhyvexml2argv-custom-loader.xml | 3 +-
.../bhyvexml2argv-disk-cdrom-grub.args | 2 +-
.../bhyvexml2argv-disk-cdrom-grub.xml | 3 +-
.../bhyvexml2argv-disk-cdrom.args | 2 +-
.../bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.xml | 3 +-
.../bhyvexml2argv-disk-virtio.args | 2 +-
.../bhyvexml2argv-disk-virtio.xml | 1 +
.../bhyvexml2argv-grub-bootorder.args | 6 +-
.../bhyvexml2argv-grub-bootorder.xml | 7 +-
.../bhyvexml2argv-grub-bootorder2.args | 6 +-
.../bhyvexml2argv-grub-bootorder2.xml | 7 +-
.../bhyvexml2argv-grub-defaults.args | 2 +-
.../bhyvexml2argv-grub-defaults.xml | 3 +-
.../bhyvexml2argvdata/bhyvexml2argv-localtime.args | 2 +-
.../bhyvexml2argvdata/bhyvexml2argv-localtime.xml | 3 +-
tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.xml | 2 +-
.../bhyvexml2argv-serial-grub-nocons.args | 2 +-
.../bhyvexml2argv-serial-grub-nocons.xml | 3 +-
.../bhyvexml2argv-serial-grub.args | 2 +-
.../bhyvexml2argv-serial-grub.xml | 3 +-
tests/bhyvexml2argvdata/bhyvexml2argv-serial.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-serial.xml | 3 +-
.../bhyvexml2xmlout-acpiapic.xml | 34 ++++++++++
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml | 30 +++++++++
.../bhyvexml2xmlout-bhyveload-bootorder.xml | 37 +++++++++++
.../bhyvexml2xmlout-bhyveload-bootorder1.xml | 37 +++++++++++
.../bhyvexml2xmlout-bhyveload-bootorder2.xml | 30 +++++++++
.../bhyvexml2xmlout-bhyveload-bootorder3.xml | 37 +++++++++++
.../bhyvexml2xmlout-bhyveload-bootorder4.xml | 38 +++++++++++
.../bhyvexml2xmlout-bhyveload-explicitargs.xml | 30 +++++++++
.../bhyvexml2xmlout-console.xml | 38 +++++++++++
.../bhyvexml2xmlout-custom-loader.xml | 31 +++++++++
.../bhyvexml2xmlout-disk-cdrom-grub.xml | 31 +++++++++
.../bhyvexml2xmlout-disk-cdrom.xml | 31 +++++++++
.../bhyvexml2xmlout-disk-virtio.xml | 29 ++++++++
.../bhyvexml2xmlout-grub-bootorder.xml | 43 ++++++++++++
.../bhyvexml2xmlout-grub-bootorder2.xml | 45 +++++++++++++
.../bhyvexml2xmlout-grub-defaults.xml | 30 +++++++++
.../bhyvexml2xmlout-localtime.xml | 30 +++++++++
.../bhyvexml2xmlout-macaddr.xml | 30 +++++++++
.../bhyvexml2xmlout-serial-grub-nocons.xml | 38 +++++++++++
.../bhyvexml2xmlout-serial-grub.xml | 38 +++++++++++
.../bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml | 38 +++++++++++
tests/bhyvexml2xmltest.c | 21 ++++++
tests/networkxml2conftest.c | 15 ++++-
66 files changed, 896 insertions(+), 102 deletions(-)
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-virtio.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml
--
2.11.0
7 years, 10 months
[libvirt] Libvirtd is not started as a service
by Weiwei Jia
Hi Daniel,
I download libvirt 2.5.0 source codes and install them as following steps.
$ ./autogen.sh --prefix=/usr --localstatedir=/var --sysconfdir=/etc
$ make
$ sudo make install
However, the libvirtd is not started as a service daemon.
$ initctl stop libvirt-bin
initctl: Unknown job: libvirt-bin
Is libvirtd started as a service daemon by default after 'make
install'? Or I need to start it manually. Is there any doc to make
libvirtd as a service daemon, which is located at
'/etc/init.d/libvirtd' for debian?
My distro version is
> lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 17.2 Rafaela
Release: 17.2
Codename: rafaela
The same as Ubuntu 14.04 Trusty.
Thanks,
Weiwei Jia
7 years, 10 months
[libvirt] [PATCH] network: write both lo and lo0 in dnsmasq configuration
by Pino Toscano
When generating a new configuration for dnsmasq, add except-interface
for both lo and lo0: this should make sure the configuration works,
and is always the same for every supported OS.
Adjust the data of networkxml2conftest to reflect the new dnsmasq
configuration, making networkxml2conftest pass on non-Linux OSes.
Followup of commit 478ddedc12b77313cbaf72328ab2236ce7c56ead.
---
src/network/bridge_driver.c | 9 ++++-----
tests/networkxml2confdata/dhcp6-nat-network.conf | 1 +
tests/networkxml2confdata/dhcp6-network.conf | 1 +
tests/networkxml2confdata/dhcp6host-routed-network.conf | 1 +
tests/networkxml2confdata/isolated-network.conf | 1 +
tests/networkxml2confdata/nat-network-dns-forward-plain.conf | 1 +
tests/networkxml2confdata/nat-network-dns-forwarders.conf | 1 +
tests/networkxml2confdata/nat-network-dns-hosts.conf | 1 +
tests/networkxml2confdata/nat-network-dns-local-domain.conf | 1 +
.../networkxml2confdata/nat-network-dns-srv-record-minimal.conf | 1 +
tests/networkxml2confdata/nat-network-dns-srv-record.conf | 1 +
tests/networkxml2confdata/nat-network-dns-txt-record.conf | 1 +
tests/networkxml2confdata/nat-network-name-with-quotes.conf | 1 +
tests/networkxml2confdata/nat-network.conf | 1 +
tests/networkxml2confdata/netboot-network.conf | 1 +
tests/networkxml2confdata/netboot-proxy-network.conf | 1 +
tests/networkxml2confdata/open-network.conf | 1 +
tests/networkxml2confdata/routed-network-no-dns.conf | 1 +
tests/networkxml2confdata/routed-network.conf | 1 +
19 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 9d94d65..feea35b 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1001,13 +1001,12 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
if (pidfile)
virBufferAsprintf(&configbuf, "pid-file=%s\n", pidfile);
- /* dnsmasq will *always* listen on localhost unless told otherwise */
-#ifdef __linux__
+ /* dnsmasq will *always* listen on localhost unless told otherwise:
+ * - "lo" is the loopback interface on Linux
+ * - "lo0" is the loopback interface on BSD and Solaris
+ */
virBufferAddLit(&configbuf, "except-interface=lo\n");
-#else
- /* BSD family OSes and Solaris call loopback interface as lo0 */
virBufferAddLit(&configbuf, "except-interface=lo0\n");
-#endif
if (dnsmasqCapsGet(caps, DNSMASQ_CAPS_BIND_DYNAMIC)) {
/* using --bind-dynamic with only --interface (no
diff --git a/tests/networkxml2confdata/dhcp6-nat-network.conf b/tests/networkxml2confdata/dhcp6-nat-network.conf
index d1058df..a5d69b5 100644
--- a/tests/networkxml2confdata/dhcp6-nat-network.conf
+++ b/tests/networkxml2confdata/dhcp6-nat-network.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
dhcp-range=192.168.122.2,192.168.122.254
diff --git a/tests/networkxml2confdata/dhcp6-network.conf b/tests/networkxml2confdata/dhcp6-network.conf
index 8270690..f58a088 100644
--- a/tests/networkxml2confdata/dhcp6-network.conf
+++ b/tests/networkxml2confdata/dhcp6-network.conf
@@ -8,6 +8,7 @@ strict-order
domain=mynet
expand-hosts
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff,64
diff --git a/tests/networkxml2confdata/dhcp6host-routed-network.conf b/tests/networkxml2confdata/dhcp6host-routed-network.conf
index 87a1498..03ea9a6 100644
--- a/tests/networkxml2confdata/dhcp6host-routed-network.conf
+++ b/tests/networkxml2confdata/dhcp6host-routed-network.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr1
dhcp-range=192.168.122.1,static
diff --git a/tests/networkxml2confdata/isolated-network.conf b/tests/networkxml2confdata/isolated-network.conf
index ce4a59f..b2b7ec2 100644
--- a/tests/networkxml2confdata/isolated-network.conf
+++ b/tests/networkxml2confdata/isolated-network.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.152.1
dhcp-option=3
diff --git a/tests/networkxml2confdata/nat-network-dns-forward-plain.conf b/tests/networkxml2confdata/nat-network-dns-forward-plain.conf
index 9a000b8..6e9a27a 100644
--- a/tests/networkxml2confdata/nat-network-dns-forward-plain.conf
+++ b/tests/networkxml2confdata/nat-network-dns-forward-plain.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.conf b/tests/networkxml2confdata/nat-network-dns-forwarders.conf
index 0bd76bf..c3d351b 100644
--- a/tests/networkxml2confdata/nat-network-dns-forwarders.conf
+++ b/tests/networkxml2confdata/nat-network-dns-forwarders.conf
@@ -11,6 +11,7 @@ server=8.8.4.4
server=/example.com/192.168.1.1
server=/www.example.com/#
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-hosts.conf b/tests/networkxml2confdata/nat-network-dns-hosts.conf
index 021316f..16cc397 100644
--- a/tests/networkxml2confdata/nat-network-dns-hosts.conf
+++ b/tests/networkxml2confdata/nat-network-dns-hosts.conf
@@ -10,6 +10,7 @@ expand-hosts
domain-needed
local=//
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-local-domain.conf b/tests/networkxml2confdata/nat-network-dns-local-domain.conf
index 5f41b91..f9ffd3a 100644
--- a/tests/networkxml2confdata/nat-network-dns-local-domain.conf
+++ b/tests/networkxml2confdata/nat-network-dns-local-domain.conf
@@ -9,6 +9,7 @@ local=/example.com/
domain=example.com
expand-hosts
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf
index f35ea1d..d15120d 100644
--- a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf
+++ b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.122.1
listen-address=192.168.123.1
diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.conf b/tests/networkxml2confdata/nat-network-dns-srv-record.conf
index af1ed70..07280da 100644
--- a/tests/networkxml2confdata/nat-network-dns-srv-record.conf
+++ b/tests/networkxml2confdata/nat-network-dns-srv-record.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
srv-host=_name._tcp.test-domain-name.com,test.example.com,1111,11,111
diff --git a/tests/networkxml2confdata/nat-network-dns-txt-record.conf b/tests/networkxml2confdata/nat-network-dns-txt-record.conf
index 7f560fb..ddc51be 100644
--- a/tests/networkxml2confdata/nat-network-dns-txt-record.conf
+++ b/tests/networkxml2confdata/nat-network-dns-txt-record.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
txt-record=example,example value
diff --git a/tests/networkxml2confdata/nat-network-name-with-quotes.conf b/tests/networkxml2confdata/nat-network-name-with-quotes.conf
index 36e11d1..fb2668c 100644
--- a/tests/networkxml2confdata/nat-network-name-with-quotes.conf
+++ b/tests/networkxml2confdata/nat-network-name-with-quotes.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.122.1
listen-address=192.168.123.1
diff --git a/tests/networkxml2confdata/nat-network.conf b/tests/networkxml2confdata/nat-network.conf
index a3c8b10..cf49e27 100644
--- a/tests/networkxml2confdata/nat-network.conf
+++ b/tests/networkxml2confdata/nat-network.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
dhcp-range=192.168.122.2,192.168.122.254
diff --git a/tests/networkxml2confdata/netboot-network.conf b/tests/networkxml2confdata/netboot-network.conf
index b554a54..cd8c7e9 100644
--- a/tests/networkxml2confdata/netboot-network.conf
+++ b/tests/networkxml2confdata/netboot-network.conf
@@ -8,6 +8,7 @@ strict-order
domain=example.com
expand-hosts
except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.122.1
dhcp-range=192.168.122.2,192.168.122.254
diff --git a/tests/networkxml2confdata/netboot-proxy-network.conf b/tests/networkxml2confdata/netboot-proxy-network.conf
index afb4033..e91edb8 100644
--- a/tests/networkxml2confdata/netboot-proxy-network.conf
+++ b/tests/networkxml2confdata/netboot-proxy-network.conf
@@ -8,6 +8,7 @@ strict-order
domain=example.com
expand-hosts
except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.122.1
dhcp-range=192.168.122.2,192.168.122.254
diff --git a/tests/networkxml2confdata/open-network.conf b/tests/networkxml2confdata/open-network.conf
index ff09984..acf9440 100644
--- a/tests/networkxml2confdata/open-network.conf
+++ b/tests/networkxml2confdata/open-network.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr1
addn-hosts=/var/lib/libvirt/dnsmasq/open.addnhosts
diff --git a/tests/networkxml2confdata/routed-network-no-dns.conf b/tests/networkxml2confdata/routed-network-no-dns.conf
index 83cc85e..ab687fa 100644
--- a/tests/networkxml2confdata/routed-network-no-dns.conf
+++ b/tests/networkxml2confdata/routed-network-no-dns.conf
@@ -7,5 +7,6 @@
strict-order
port=0
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr1
diff --git a/tests/networkxml2confdata/routed-network.conf b/tests/networkxml2confdata/routed-network.conf
index 970aa3c..ba0353c 100644
--- a/tests/networkxml2confdata/routed-network.conf
+++ b/tests/networkxml2confdata/routed-network.conf
@@ -6,6 +6,7 @@
## dnsmasq conf file created by libvirt
strict-order
except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr1
addn-hosts=/var/lib/libvirt/dnsmasq/local.addnhosts
--
2.7.4
7 years, 10 months
[libvirt] [PATCH] cmdPerf: Display enabled/disabled message on perf event enable/disable
by Nitesh Konkar
Currently, the code to display enabled/disabled message is
a dead code as its misplaced in if block instead of else.
This patch fixes that issue.
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
tools/virsh-domain.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3a6fa5c..624a36a 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -8891,18 +8891,19 @@ cmdPerf(vshControl *ctl, const vshCmd *cmd)
vshError(ctl, "%s", _("Unable to get perf events"));
goto cleanup;
}
- for (i = 0; i < nparams; i++) {
- if (params[i].type == VIR_TYPED_PARAM_BOOLEAN &&
- params[i].value.b) {
- vshPrint(ctl, "%-15s: %s\n", params[i].field, _("enabled"));
- } else {
- vshPrint(ctl, "%-15s: %s\n", params[i].field, _("disabled"));
- }
- }
} else {
if (virDomainSetPerfEvents(dom, params, nparams, flags) != 0) {
vshError(ctl, "%s", _("Unable to enable/disable perf events"));
goto cleanup;
+ } else {
+ for (i = 0; i < nparams; i++) {
+ if (params[i].type == VIR_TYPED_PARAM_BOOLEAN &&
+ params[i].value.b) {
+ vshPrint(ctl, "%-15s: %s\n", params[i].field, _("enabled"));
+ } else {
+ vshPrint(ctl, "%-15s: %s\n", params[i].field, _("disabled"));
+ }
+ }
}
}
--
1.9.3
7 years, 10 months
[libvirt] Cannot add iothreads label in libvirt xml configuration file
by Weiwei Jia
Hi,
I cannot add iothreads
(https://libvirt.org/formatdomain.html#elementsIOThreadsAllocation) in
the libvirt xml configuration file. Once I add
"<iothreads>4</iothreads>" and other related config for IOthreads into
the libvirt xml configuration file with virsh command and save it,
these iothreads related configuration will disappear after I open
libvirt xml configuration file again for double-check.
The current libvirt xml configuration file is like following.
# virsh dumpxml kvm1
<domain type='kvm'>
<name>kvm1</name>
<uuid>20811918-9057-4496-aa03-0fe9d1bcaf78</uuid>
<memory unit='KiB'>8194304</memory>
<currentMemory unit='KiB'>8194304</currentMemory>
<vcpu placement='static'>6</vcpu>
<cputune>
<vcpupin vcpu='0' cpuset='0'/>
<vcpupin vcpu='1' cpuset='1'/>
<vcpupin vcpu='2' cpuset='2'/>
<vcpupin vcpu='3' cpuset='3'/>
<vcpupin vcpu='4' cpuset='4'/>
<vcpupin vcpu='5' cpuset='5'/>
<emulatorpin cpuset='12-15'/>
</cputune>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-2.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm-spice</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source file='/var/lib/libvirt/images/kvm1.img'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06'
function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='scsi' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04'
function='0x0'/>
</controller>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x1'/>
</controller>
<interface type='network'>
<mac address='52:54:00:a7:67:eb'/>
<source network='default'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x0'/>
</memballoon>
</devices>
<seclabel type='none'/>
</domain>
I want to config above xml file to be like following but once I save
it, the iothreads related configuration will disappear (like above)
after I re-open the libvirt xml for double-check.
<domain type='kvm' id='1'
xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>kvm1</name>
<memory unit='KiB'>8194304</memory>
<currentMemory unit='KiB'>8194304</currentMemory>
<vcpu placement='static'>6</vcpu>
<iothreads>4</iothreads>
<iothreadids>
<iothread id="2"/>
<iothread id="4"/>
<iothread id="6"/>
<iothread id="8"/>
</iothreadids>
<cputune>
<vcpupin vcpu='0' cpuset='0'/>
<vcpupin vcpu='1' cpuset='1'/>
<vcpupin vcpu='2' cpuset='2'/>
<vcpupin vcpu='3' cpuset='3'/>
<vcpupin vcpu='4' cpuset='4'/>
<vcpupin vcpu='5' cpuset='5'/>
<emulatorpin cpuset="12-15"/>
<iothreadpin iothread="2" cpuset="7"/>
<iothreadpin iothread="4" cpuset="8"/>
<iothreadpin iothread="6" cpuset="9"/>
<iothreadpin iothread="8" cpuset="10"/>
</cputune>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-2.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm-spice</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native' iothread='2-8'/>
<source file='/home/wj47/ssd1/kvm1.img'/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06'
function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<alias name='ide0-1-0'/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<alias name='usb0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='scsi' index='0'>
<alias name='scsi0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04'
function='0x0'/>
</controller>
<controller type='ide' index='0'>
<alias name='ide0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x1'/>
</controller>
<interface type='network'>
<source network='default'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/11'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/11'>
<source path='/dev/pts/11'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x0'/>
</memballoon>
</devices>
<seclabel type='none'/>
</domain>
Another concern is like this: can I config 4 dedicated IOthreads for
one drive. Just like above, I want to start 4 IOthreads for
virtio-disk0. If true, is my config like above correct? Thank you.
Best,
Weiwei Jia
7 years, 10 months
[libvirt] [PATCH v3 00/11] clean up after slot sharing patches
by Laine Stump
(rebase of the original patches to make review easier)
Some of the patches that enabled sharing PCI slots by multiple
pcie-root-ports made the idea of reserving an entire slot obsolete. To
reduce confusion and misunderstandings, this patch series gets rid of
the name "Slot" in all of the functions that reserve and release PCI
addresses.
Laine Stump (11):
conf: fix fromConfig argument to virDomainPCIAddressReserveAddr()
conf: fix fromConfig argument to virDomainPCIAddressValidate()
conf: rename virDomainPCIAddressGetNextSlot() to ...GetNextAddr()
conf: eliminate virDomainPCIAddressReserveNextSlot()
qemu: replace virDomainPCIAddressReserveAddr with
virDomainPCIAddressReserveSlot
conf: make virDomainPCIAddressReserveAddr() a static function
conf: rename virDomainPCIAddressReserveAddr() to ...Internal()
conf: rename virDomainPCIAddressReserveSlot() to ...Addr()
qemu: remove qemuDomainPCIAddressReserveNextAddr()
qemu: rename qemuDomainPCIAddressReserveNextSlot() to ...Addr()
conf: eliminate virDomainPCIAddressReleaseSlot() in favor of ...Addr()
src/bhyve/bhyve_device.c | 26 ++++++----
src/conf/domain_addr.c | 60 +++++------------------
src/conf/domain_addr.h | 15 ------
src/libvirt_private.syms | 4 +-
src/qemu/qemu_domain_address.c | 105 ++++++++++++++++++++---------------------
5 files changed, 80 insertions(+), 130 deletions(-)
--
2.7.4
7 years, 10 months
[libvirt] [PATCH] tests/networkxml2conf: Fix to work again on non-Linux
by Andrea Bolognani
Since commit 478ddedc12b7 the name of the loopback interface
in the generated dnsmasq configuration is OS-dependent.
However, the test suite has not been updated to cope with the
change, causing it to fail on FreeBSD and other non-Linux
operating systems.
Modify the networkxml2conf test case to read the expected
output from different files based on the OS we're building on.
---
.../{dhcp6-nat-network.conf => dhcp6-nat-network-linux.conf} | 0
.../{dhcp6-nat-network.conf => dhcp6-nat-network-other.conf} | 2 +-
.../{dhcp6-network.conf => dhcp6-network-linux.conf} | 0
.../{dhcp6-network.conf => dhcp6-network-other.conf} | 2 +-
...t-routed-network.conf => dhcp6host-routed-network-linux.conf} | 0
...t-routed-network.conf => dhcp6host-routed-network-other.conf} | 2 +-
.../{isolated-network.conf => isolated-network-linux.conf} | 0
.../{isolated-network.conf => isolated-network-other.conf} | 2 +-
...rward-plain.conf => nat-network-dns-forward-plain-linux.conf} | 0
...rward-plain.conf => nat-network-dns-forward-plain-other.conf} | 2 +-
...dns-forwarders.conf => nat-network-dns-forwarders-linux.conf} | 0
...dns-forwarders.conf => nat-network-dns-forwarders-other.conf} | 2 +-
...t-network-dns-hosts.conf => nat-network-dns-hosts-linux.conf} | 0
...t-network-dns-hosts.conf => nat-network-dns-hosts-other.conf} | 2 +-
...local-domain.conf => nat-network-dns-local-domain-linux.conf} | 0
...local-domain.conf => nat-network-dns-local-domain-other.conf} | 2 +-
...dns-srv-record.conf => nat-network-dns-srv-record-linux.conf} | 0
...inimal.conf => nat-network-dns-srv-record-minimal-linux.conf} | 0
...inimal.conf => nat-network-dns-srv-record-minimal-other.conf} | 2 +-
...dns-srv-record.conf => nat-network-dns-srv-record-other.conf} | 2 +-
...dns-txt-record.conf => nat-network-dns-txt-record-linux.conf} | 0
...dns-txt-record.conf => nat-network-dns-txt-record-other.conf} | 2 +-
.../{nat-network.conf => nat-network-linux.conf} | 0
...-with-quotes.conf => nat-network-name-with-quotes-linux.conf} | 0
...-with-quotes.conf => nat-network-name-with-quotes-other.conf} | 2 +-
.../{nat-network.conf => nat-network-other.conf} | 2 +-
.../{netboot-network.conf => netboot-network-linux.conf} | 0
.../{netboot-network.conf => netboot-network-other.conf} | 2 +-
...tboot-proxy-network.conf => netboot-proxy-network-linux.conf} | 0
...tboot-proxy-network.conf => netboot-proxy-network-other.conf} | 2 +-
.../{open-network.conf => open-network-linux.conf} | 0
.../{open-network.conf => open-network-other.conf} | 2 +-
.../{ptr-domains-auto.conf => ptr-domains-auto-linux.conf} | 0
.../{ptr-domains-auto.conf => ptr-domains-auto-other.conf} | 2 +-
.../{routed-network.conf => routed-network-linux.conf} | 0
...uted-network-no-dns.conf => routed-network-no-dns-linux.conf} | 0
...uted-network-no-dns.conf => routed-network-no-dns-other.conf} | 2 +-
.../{routed-network.conf => routed-network-other.conf} | 2 +-
tests/networkxml2conftest.c | 9 +++++++--
39 files changed, 26 insertions(+), 21 deletions(-)
copy tests/networkxml2confdata/{dhcp6-nat-network.conf => dhcp6-nat-network-linux.conf} (100%)
rename tests/networkxml2confdata/{dhcp6-nat-network.conf => dhcp6-nat-network-other.conf} (96%)
copy tests/networkxml2confdata/{dhcp6-network.conf => dhcp6-network-linux.conf} (100%)
rename tests/networkxml2confdata/{dhcp6-network.conf => dhcp6-network-other.conf} (96%)
copy tests/networkxml2confdata/{dhcp6host-routed-network.conf => dhcp6host-routed-network-linux.conf} (100%)
rename tests/networkxml2confdata/{dhcp6host-routed-network.conf => dhcp6host-routed-network-other.conf} (96%)
copy tests/networkxml2confdata/{isolated-network.conf => isolated-network-linux.conf} (100%)
rename tests/networkxml2confdata/{isolated-network.conf => isolated-network-other.conf} (96%)
copy tests/networkxml2confdata/{nat-network-dns-forward-plain.conf => nat-network-dns-forward-plain-linux.conf} (100%)
rename tests/networkxml2confdata/{nat-network-dns-forward-plain.conf => nat-network-dns-forward-plain-other.conf} (94%)
copy tests/networkxml2confdata/{nat-network-dns-forwarders.conf => nat-network-dns-forwarders-linux.conf} (100%)
rename tests/networkxml2confdata/{nat-network-dns-forwarders.conf => nat-network-dns-forwarders-other.conf} (95%)
copy tests/networkxml2confdata/{nat-network-dns-hosts.conf => nat-network-dns-hosts-linux.conf} (100%)
rename tests/networkxml2confdata/{nat-network-dns-hosts.conf => nat-network-dns-hosts-other.conf} (95%)
copy tests/networkxml2confdata/{nat-network-dns-local-domain.conf => nat-network-dns-local-domain-linux.conf} (100%)
rename tests/networkxml2confdata/{nat-network-dns-local-domain.conf => nat-network-dns-local-domain-other.conf} (95%)
copy tests/networkxml2confdata/{nat-network-dns-srv-record.conf => nat-network-dns-srv-record-linux.conf} (100%)
copy tests/networkxml2confdata/{nat-network-dns-srv-record-minimal.conf => nat-network-dns-srv-record-minimal-linux.conf} (100%)
rename tests/networkxml2confdata/{nat-network-dns-srv-record-minimal.conf => nat-network-dns-srv-record-minimal-other.conf} (97%)
rename tests/networkxml2confdata/{nat-network-dns-srv-record.conf => nat-network-dns-srv-record-other.conf} (97%)
copy tests/networkxml2confdata/{nat-network-dns-txt-record.conf => nat-network-dns-txt-record-linux.conf} (100%)
rename tests/networkxml2confdata/{nat-network-dns-txt-record.conf => nat-network-dns-txt-record-other.conf} (96%)
copy tests/networkxml2confdata/{nat-network.conf => nat-network-linux.conf} (100%)
copy tests/networkxml2confdata/{nat-network-name-with-quotes.conf => nat-network-name-with-quotes-linux.conf} (100%)
rename tests/networkxml2confdata/{nat-network-name-with-quotes.conf => nat-network-name-with-quotes-other.conf} (97%)
rename tests/networkxml2confdata/{nat-network.conf => nat-network-other.conf} (96%)
copy tests/networkxml2confdata/{netboot-network.conf => netboot-network-linux.conf} (100%)
rename tests/networkxml2confdata/{netboot-network.conf => netboot-network-other.conf} (96%)
copy tests/networkxml2confdata/{netboot-proxy-network.conf => netboot-proxy-network-linux.conf} (100%)
rename tests/networkxml2confdata/{netboot-proxy-network.conf => netboot-proxy-network-other.conf} (96%)
copy tests/networkxml2confdata/{open-network.conf => open-network-linux.conf} (100%)
rename tests/networkxml2confdata/{open-network.conf => open-network-other.conf} (94%)
copy tests/networkxml2confdata/{ptr-domains-auto.conf => ptr-domains-auto-linux.conf} (100%)
rename tests/networkxml2confdata/{ptr-domains-auto.conf => ptr-domains-auto-other.conf} (97%)
copy tests/networkxml2confdata/{routed-network.conf => routed-network-linux.conf} (100%)
copy tests/networkxml2confdata/{routed-network-no-dns.conf => routed-network-no-dns-linux.conf} (100%)
rename tests/networkxml2confdata/{routed-network-no-dns.conf => routed-network-no-dns-other.conf} (93%)
rename tests/networkxml2confdata/{routed-network.conf => routed-network-other.conf} (94%)
diff --git a/tests/networkxml2confdata/dhcp6-nat-network.conf b/tests/networkxml2confdata/dhcp6-nat-network-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/dhcp6-nat-network.conf
copy to tests/networkxml2confdata/dhcp6-nat-network-linux.conf
diff --git a/tests/networkxml2confdata/dhcp6-nat-network.conf b/tests/networkxml2confdata/dhcp6-nat-network-other.conf
similarity index 96%
rename from tests/networkxml2confdata/dhcp6-nat-network.conf
rename to tests/networkxml2confdata/dhcp6-nat-network-other.conf
index d1058df..f182691 100644
--- a/tests/networkxml2confdata/dhcp6-nat-network.conf
+++ b/tests/networkxml2confdata/dhcp6-nat-network-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
dhcp-range=192.168.122.2,192.168.122.254
diff --git a/tests/networkxml2confdata/dhcp6-network.conf b/tests/networkxml2confdata/dhcp6-network-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/dhcp6-network.conf
copy to tests/networkxml2confdata/dhcp6-network-linux.conf
diff --git a/tests/networkxml2confdata/dhcp6-network.conf b/tests/networkxml2confdata/dhcp6-network-other.conf
similarity index 96%
rename from tests/networkxml2confdata/dhcp6-network.conf
rename to tests/networkxml2confdata/dhcp6-network-other.conf
index 8270690..6093037 100644
--- a/tests/networkxml2confdata/dhcp6-network.conf
+++ b/tests/networkxml2confdata/dhcp6-network-other.conf
@@ -7,7 +7,7 @@
strict-order
domain=mynet
expand-hosts
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff,64
diff --git a/tests/networkxml2confdata/dhcp6host-routed-network.conf b/tests/networkxml2confdata/dhcp6host-routed-network-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/dhcp6host-routed-network.conf
copy to tests/networkxml2confdata/dhcp6host-routed-network-linux.conf
diff --git a/tests/networkxml2confdata/dhcp6host-routed-network.conf b/tests/networkxml2confdata/dhcp6host-routed-network-other.conf
similarity index 96%
rename from tests/networkxml2confdata/dhcp6host-routed-network.conf
rename to tests/networkxml2confdata/dhcp6host-routed-network-other.conf
index 87a1498..2d1513a 100644
--- a/tests/networkxml2confdata/dhcp6host-routed-network.conf
+++ b/tests/networkxml2confdata/dhcp6host-routed-network-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr1
dhcp-range=192.168.122.1,static
diff --git a/tests/networkxml2confdata/isolated-network.conf b/tests/networkxml2confdata/isolated-network-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/isolated-network.conf
copy to tests/networkxml2confdata/isolated-network-linux.conf
diff --git a/tests/networkxml2confdata/isolated-network.conf b/tests/networkxml2confdata/isolated-network-other.conf
similarity index 96%
rename from tests/networkxml2confdata/isolated-network.conf
rename to tests/networkxml2confdata/isolated-network-other.conf
index ce4a59f..952e0d6 100644
--- a/tests/networkxml2confdata/isolated-network.conf
+++ b/tests/networkxml2confdata/isolated-network-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.152.1
dhcp-option=3
diff --git a/tests/networkxml2confdata/nat-network-dns-forward-plain.conf b/tests/networkxml2confdata/nat-network-dns-forward-plain-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/nat-network-dns-forward-plain.conf
copy to tests/networkxml2confdata/nat-network-dns-forward-plain-linux.conf
diff --git a/tests/networkxml2confdata/nat-network-dns-forward-plain.conf b/tests/networkxml2confdata/nat-network-dns-forward-plain-other.conf
similarity index 94%
rename from tests/networkxml2confdata/nat-network-dns-forward-plain.conf
rename to tests/networkxml2confdata/nat-network-dns-forward-plain-other.conf
index 9a000b8..e141afc 100644
--- a/tests/networkxml2confdata/nat-network-dns-forward-plain.conf
+++ b/tests/networkxml2confdata/nat-network-dns-forward-plain-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.conf b/tests/networkxml2confdata/nat-network-dns-forwarders-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/nat-network-dns-forwarders.conf
copy to tests/networkxml2confdata/nat-network-dns-forwarders-linux.conf
diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.conf b/tests/networkxml2confdata/nat-network-dns-forwarders-other.conf
similarity index 95%
rename from tests/networkxml2confdata/nat-network-dns-forwarders.conf
rename to tests/networkxml2confdata/nat-network-dns-forwarders-other.conf
index 0bd76bf..926fbe3 100644
--- a/tests/networkxml2confdata/nat-network-dns-forwarders.conf
+++ b/tests/networkxml2confdata/nat-network-dns-forwarders-other.conf
@@ -10,7 +10,7 @@ server=8.8.8.8
server=8.8.4.4
server=/example.com/192.168.1.1
server=/www.example.com/#
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-hosts.conf b/tests/networkxml2confdata/nat-network-dns-hosts-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/nat-network-dns-hosts.conf
copy to tests/networkxml2confdata/nat-network-dns-hosts-linux.conf
diff --git a/tests/networkxml2confdata/nat-network-dns-hosts.conf b/tests/networkxml2confdata/nat-network-dns-hosts-other.conf
similarity index 95%
rename from tests/networkxml2confdata/nat-network-dns-hosts.conf
rename to tests/networkxml2confdata/nat-network-dns-hosts-other.conf
index 021316f..cd51d0a 100644
--- a/tests/networkxml2confdata/nat-network-dns-hosts.conf
+++ b/tests/networkxml2confdata/nat-network-dns-hosts-other.conf
@@ -9,7 +9,7 @@ domain=example.com
expand-hosts
domain-needed
local=//
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-local-domain.conf b/tests/networkxml2confdata/nat-network-dns-local-domain-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/nat-network-dns-local-domain.conf
copy to tests/networkxml2confdata/nat-network-dns-local-domain-linux.conf
diff --git a/tests/networkxml2confdata/nat-network-dns-local-domain.conf b/tests/networkxml2confdata/nat-network-dns-local-domain-other.conf
similarity index 95%
rename from tests/networkxml2confdata/nat-network-dns-local-domain.conf
rename to tests/networkxml2confdata/nat-network-dns-local-domain-other.conf
index 5f41b91..bb72019 100644
--- a/tests/networkxml2confdata/nat-network-dns-local-domain.conf
+++ b/tests/networkxml2confdata/nat-network-dns-local-domain-other.conf
@@ -8,7 +8,7 @@ strict-order
local=/example.com/
domain=example.com
expand-hosts
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.conf b/tests/networkxml2confdata/nat-network-dns-srv-record-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/nat-network-dns-srv-record.conf
copy to tests/networkxml2confdata/nat-network-dns-srv-record-linux.conf
diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf
copy to tests/networkxml2confdata/nat-network-dns-srv-record-minimal-linux.conf
diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal-other.conf
similarity index 97%
rename from tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf
rename to tests/networkxml2confdata/nat-network-dns-srv-record-minimal-other.conf
index f35ea1d..fe1a804 100644
--- a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf
+++ b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.122.1
listen-address=192.168.123.1
diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.conf b/tests/networkxml2confdata/nat-network-dns-srv-record-other.conf
similarity index 97%
rename from tests/networkxml2confdata/nat-network-dns-srv-record.conf
rename to tests/networkxml2confdata/nat-network-dns-srv-record-other.conf
index af1ed70..bdf33dc 100644
--- a/tests/networkxml2confdata/nat-network-dns-srv-record.conf
+++ b/tests/networkxml2confdata/nat-network-dns-srv-record-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
srv-host=_name._tcp.test-domain-name.com,test.example.com,1111,11,111
diff --git a/tests/networkxml2confdata/nat-network-dns-txt-record.conf b/tests/networkxml2confdata/nat-network-dns-txt-record-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/nat-network-dns-txt-record.conf
copy to tests/networkxml2confdata/nat-network-dns-txt-record-linux.conf
diff --git a/tests/networkxml2confdata/nat-network-dns-txt-record.conf b/tests/networkxml2confdata/nat-network-dns-txt-record-other.conf
similarity index 96%
rename from tests/networkxml2confdata/nat-network-dns-txt-record.conf
rename to tests/networkxml2confdata/nat-network-dns-txt-record-other.conf
index 7f560fb..8f127c2 100644
--- a/tests/networkxml2confdata/nat-network-dns-txt-record.conf
+++ b/tests/networkxml2confdata/nat-network-dns-txt-record-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
txt-record=example,example value
diff --git a/tests/networkxml2confdata/nat-network.conf b/tests/networkxml2confdata/nat-network-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/nat-network.conf
copy to tests/networkxml2confdata/nat-network-linux.conf
diff --git a/tests/networkxml2confdata/nat-network-name-with-quotes.conf b/tests/networkxml2confdata/nat-network-name-with-quotes-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/nat-network-name-with-quotes.conf
copy to tests/networkxml2confdata/nat-network-name-with-quotes-linux.conf
diff --git a/tests/networkxml2confdata/nat-network-name-with-quotes.conf b/tests/networkxml2confdata/nat-network-name-with-quotes-other.conf
similarity index 97%
rename from tests/networkxml2confdata/nat-network-name-with-quotes.conf
rename to tests/networkxml2confdata/nat-network-name-with-quotes-other.conf
index 36e11d1..70dea13 100644
--- a/tests/networkxml2confdata/nat-network-name-with-quotes.conf
+++ b/tests/networkxml2confdata/nat-network-name-with-quotes-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.122.1
listen-address=192.168.123.1
diff --git a/tests/networkxml2confdata/nat-network.conf b/tests/networkxml2confdata/nat-network-other.conf
similarity index 96%
rename from tests/networkxml2confdata/nat-network.conf
rename to tests/networkxml2confdata/nat-network-other.conf
index a3c8b10..6fef02f 100644
--- a/tests/networkxml2confdata/nat-network.conf
+++ b/tests/networkxml2confdata/nat-network-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
dhcp-range=192.168.122.2,192.168.122.254
diff --git a/tests/networkxml2confdata/netboot-network.conf b/tests/networkxml2confdata/netboot-network-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/netboot-network.conf
copy to tests/networkxml2confdata/netboot-network-linux.conf
diff --git a/tests/networkxml2confdata/netboot-network.conf b/tests/networkxml2confdata/netboot-network-other.conf
similarity index 96%
rename from tests/networkxml2confdata/netboot-network.conf
rename to tests/networkxml2confdata/netboot-network-other.conf
index b554a54..a78f3e6 100644
--- a/tests/networkxml2confdata/netboot-network.conf
+++ b/tests/networkxml2confdata/netboot-network-other.conf
@@ -7,7 +7,7 @@
strict-order
domain=example.com
expand-hosts
-except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.122.1
dhcp-range=192.168.122.2,192.168.122.254
diff --git a/tests/networkxml2confdata/netboot-proxy-network.conf b/tests/networkxml2confdata/netboot-proxy-network-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/netboot-proxy-network.conf
copy to tests/networkxml2confdata/netboot-proxy-network-linux.conf
diff --git a/tests/networkxml2confdata/netboot-proxy-network.conf b/tests/networkxml2confdata/netboot-proxy-network-other.conf
similarity index 96%
rename from tests/networkxml2confdata/netboot-proxy-network.conf
rename to tests/networkxml2confdata/netboot-proxy-network-other.conf
index afb4033..cf2bec5 100644
--- a/tests/networkxml2confdata/netboot-proxy-network.conf
+++ b/tests/networkxml2confdata/netboot-proxy-network-other.conf
@@ -7,7 +7,7 @@
strict-order
domain=example.com
expand-hosts
-except-interface=lo
+except-interface=lo0
bind-interfaces
listen-address=192.168.122.1
dhcp-range=192.168.122.2,192.168.122.254
diff --git a/tests/networkxml2confdata/open-network.conf b/tests/networkxml2confdata/open-network-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/open-network.conf
copy to tests/networkxml2confdata/open-network-linux.conf
diff --git a/tests/networkxml2confdata/open-network.conf b/tests/networkxml2confdata/open-network-other.conf
similarity index 94%
rename from tests/networkxml2confdata/open-network.conf
rename to tests/networkxml2confdata/open-network-other.conf
index ff09984..6e03486 100644
--- a/tests/networkxml2confdata/open-network.conf
+++ b/tests/networkxml2confdata/open-network-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr1
addn-hosts=/var/lib/libvirt/dnsmasq/open.addnhosts
diff --git a/tests/networkxml2confdata/ptr-domains-auto.conf b/tests/networkxml2confdata/ptr-domains-auto-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/ptr-domains-auto.conf
copy to tests/networkxml2confdata/ptr-domains-auto-linux.conf
diff --git a/tests/networkxml2confdata/ptr-domains-auto.conf b/tests/networkxml2confdata/ptr-domains-auto-other.conf
similarity index 97%
rename from tests/networkxml2confdata/ptr-domains-auto.conf
rename to tests/networkxml2confdata/ptr-domains-auto-other.conf
index 7f1a393..7f2cd8b 100644
--- a/tests/networkxml2confdata/ptr-domains-auto.conf
+++ b/tests/networkxml2confdata/ptr-domains-auto-other.conf
@@ -7,7 +7,7 @@
strict-order
local=/122.168.192.in-addr.arpa/
local=/1.0.e.f.0.1.c.a.8.b.d.0.1.0.0.2.ip6.arpa/
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr0
dhcp-range=192.168.122.2,192.168.122.254
diff --git a/tests/networkxml2confdata/routed-network.conf b/tests/networkxml2confdata/routed-network-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/routed-network.conf
copy to tests/networkxml2confdata/routed-network-linux.conf
diff --git a/tests/networkxml2confdata/routed-network-no-dns.conf b/tests/networkxml2confdata/routed-network-no-dns-linux.conf
similarity index 100%
copy from tests/networkxml2confdata/routed-network-no-dns.conf
copy to tests/networkxml2confdata/routed-network-no-dns-linux.conf
diff --git a/tests/networkxml2confdata/routed-network-no-dns.conf b/tests/networkxml2confdata/routed-network-no-dns-other.conf
similarity index 93%
rename from tests/networkxml2confdata/routed-network-no-dns.conf
rename to tests/networkxml2confdata/routed-network-no-dns-other.conf
index 83cc85e..eada11e 100644
--- a/tests/networkxml2confdata/routed-network-no-dns.conf
+++ b/tests/networkxml2confdata/routed-network-no-dns-other.conf
@@ -6,6 +6,6 @@
## dnsmasq conf file created by libvirt
strict-order
port=0
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr1
diff --git a/tests/networkxml2confdata/routed-network.conf b/tests/networkxml2confdata/routed-network-other.conf
similarity index 94%
rename from tests/networkxml2confdata/routed-network.conf
rename to tests/networkxml2confdata/routed-network-other.conf
index 970aa3c..79f1d77 100644
--- a/tests/networkxml2confdata/routed-network.conf
+++ b/tests/networkxml2confdata/routed-network-other.conf
@@ -5,7 +5,7 @@
##
## dnsmasq conf file created by libvirt
strict-order
-except-interface=lo
+except-interface=lo0
bind-dynamic
interface=virbr1
addn-hosts=/var/lib/libvirt/dnsmasq/local.addnhosts
diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c
index a80d3b2..617c7ea 100644
--- a/tests/networkxml2conftest.c
+++ b/tests/networkxml2conftest.c
@@ -71,11 +71,16 @@ testCompareXMLToConfHelper(const void *data)
const testInfo *info = data;
char *inxml = NULL;
char *outxml = NULL;
+#ifdef __linux__
+ const char *os = "linux";
+#else
+ const char *os = "other";
+#endif
if (virAsprintf(&inxml, "%s/networkxml2confdata/%s.xml",
abs_srcdir, info->name) < 0 ||
- virAsprintf(&outxml, "%s/networkxml2confdata/%s.conf",
- abs_srcdir, info->name) < 0) {
+ virAsprintf(&outxml, "%s/networkxml2confdata/%s-%s.conf",
+ abs_srcdir, info->name, os) < 0) {
goto cleanup;
}
--
2.7.4
7 years, 10 months
[libvirt] [PATCH v2 0/5] vz: fix some CT disk representation cases and its statistics
by Maxim Nestratov
v1-v2 changes - comments addressed
Maxim Nestratov (5):
vz: report "scsi" bus for disks when nothing was set explixitly
vz: don't add implicit devices for CTs
vz: report disks either as disks or filesystems depending on original
xml
vz: set boot from disk for CT only when there is no root filesystem
vz: get disks statistics for CTs
src/vz/vz_driver.c | 10 ++++-
src/vz/vz_sdk.c | 129 ++++++++++++++++++++++++++++++++++++++++++++++-------
src/vz/vz_sdk.h | 2 +-
3 files changed, 121 insertions(+), 20 deletions(-)
--
2.4.11
7 years, 10 months