Re: [libvirt] [PATCH 11/12] src: replace gmtime_r/localtime_r/strftime with GDateTime

2020-01-15 Thread Ján Tomko

On Tue, Jan 14, 2020 at 04:22:39PM +0100, Pavel Hrdina wrote:

On Fri, Jan 10, 2020 at 03:41:15PM +, Daniel P. Berrangé wrote:

gmtime_r/localtime_r are mostly used in combination with
strftime to format timestamps in libvirt. This can all
be replaced with GDateTime resulting in simpler code
that is also more portable.

There is some boundary condition problem in parsing POSIX
timezone offsets in GLib which tickles our test suite.
The test suite is hacked to avoid the problem. The upsteam


Also, s/upsteam/upstream/


GLib bug report is


Missing link to the bug report, it's only in the comment in
virtimetest.c.


Signed-off-by: Daniel P. Berrangé 
---
 src/conf/domain_conf.c   | 11 
 src/libxl/libxl_domain.c | 10 +++
 src/qemu/qemu_command.c  | 17 ---
 src/qemu/qemu_driver.c   | 10 +++
 src/util/virtime.c   | 35 ---
 tests/qemuxml2argvmock.c | 12 
 tests/virtimetest.c  | 39 +
 tools/virsh-checkpoint.c | 20 +
 tools/virsh-domain-monitor.c | 14 -
 tools/virsh-domain.c | 13 -
 tools/virsh-network.c| 11 
 tools/virsh-snapshot.c   | 19 -
 tools/virt-admin.c   | 55 
 tools/vsh.c  | 16 ---
 14 files changed, 96 insertions(+), 186 deletions(-)


Reviewed-by: Pavel Hrdina 





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list




signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 1/4] virsh.rst: Mention media update is not supported in attach-{disk, device}

2020-01-15 Thread Han Han
Signed-off-by: Han Han 
---
 docs/manpages/virsh.rst | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index c637caa583..92f113fbde 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -4391,9 +4391,7 @@ as the top-level element.  See the documentation at
 libvirt XML format for a device.  If *--config* is specified the
 command alters the persistent domain configuration with the device
 attach taking effect the next time libvirt starts the domain.
-For cdrom and floppy devices, this command only replaces the media
-within an existing device; consider using ``update-device`` for this
-usage.  For passthrough host devices, see also ``nodedev-detach``,
+For passthrough host devices, see also ``nodedev-detach``,
 needed if the PCI device does not use managed mode.
 
 If *--live* is specified, affect a running domain.
@@ -4408,7 +4406,8 @@ an offline domain, and like *--live* *--config* for a 
running domain.
 
 ``Note``: using of partial device definition XML files may lead to unexpected
 results as some fields may be autogenerated and thus match devices other than
-expected.
+expected. It doesn't support replace the media within the existing virtual
+cdrom or floppy device. Use ``update-device`` or ``change-media`` instead.
 
 
 attach-disk
@@ -4442,9 +4441,7 @@ of the disk source, such as *raw* or *qcow2*.  Hypervisor 
default will be
 used if *subdriver* is not specified.  However, the default may not be
 correct, esp. for QEMU as for security reasons it is configured not to detect
 disk formats.  *type* can indicate *lun*, *cdrom* or *floppy* as
-alternative to the disk default, although this use only replaces the media
-within the existing virtual cdrom or floppy device; consider using
-``update-device`` for this usage instead.
+alternative to the disk default.
 *alias* can set user supplied alias.
 *mode* can specify the two specific mode *readonly* or *shareable*.
 *sourcetype* can indicate the type of source (block|file)
@@ -4476,6 +4473,9 @@ For compatibility purposes, *--persistent* behaves like 
*--config* for
 an offline domain, and like *--live* *--config* for a running domain.
 Likewise, *--shareable* is an alias for *--mode shareable*.
 
+``Note``: It doesn't support replace the media within the existing virtual
+cdrom or floppy device. Use ``update-device`` or ``change-media`` instead.
+
 
 attach-interface
 
-- 
2.24.0.rc1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [PATCH 3/4] qemu: Drop support of media update in live disk attach API

2020-01-15 Thread Han Han
virDomainUpdateDeviceFlags has been introduced since v0.8.0. There is no
reason to use virDomainAttachDevice* API to update media for cdrom or
floopy device.

https://bugzilla.redhat.com/show_bug.cgi?id=1788793

Signed-off-by: Han Han 
---
 src/qemu/qemu_hotplug.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 31d455505b..db8cb0e696 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1076,7 +1076,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriverPtr 
driver,
  * @vm: domain object
  * @dev: device to attach (expected type is DISK)
  *
- * Attach a new disk or in case of cdroms/floppies change the media in the 
drive.
+ * Attach a new disk in the drive.
  * This function handles all the necessary steps to attach a new storage source
  * to the VM.
  */
@@ -1088,17 +1088,13 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver,
 virDomainDiskDefPtr disk = dev->data.disk;
 virDomainDiskDefPtr orig_disk = NULL;
 
-/* this API overloads media change semantics on disk hotplug
- * for devices supporting media changes */
 if ((disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ||
  disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) &&
 (orig_disk = virDomainDiskByTarget(vm->def, disk->dst))) {
-if (qemuDomainChangeEjectableMedia(driver, vm, orig_disk,
-   disk->src, false) < 0)
+virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+   _("cdrom/floppy media update isn't supported. "
+ "Use virDomainUpdateDeviceFlags instead."));
 return -1;
-
-disk->src = NULL;
-return 0;
 }
 
 return qemuDomainAttachDeviceDiskLiveInternal(driver, vm, dev);
-- 
2.24.0.rc1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [PATCH 2/4] libvirt: Remove comments of media update in virDomainAttachDeviceFlags

2020-01-15 Thread Han Han
Signed-off-by: Han Han 
---
 src/libvirt-domain.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index eb66999f07..a6a246c3a4 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -8208,10 +8208,6 @@ virDomainAttachDevice(virDomainPtr domain, const char 
*xml)
  * return failure if LIVE is specified but it only supports modifying the
  * persisted device allocation.
  *
- * For compatibility, this method can also be used to change the media
- * in an existing CDROM/Floppy device, however, applications are
- * recommended to use the virDomainUpdateDeviceFlag method instead.
- *
  * Be aware that hotplug changes might not persist across a domain going
  * into S4 state (also known as hibernation) unless you also modify the
  * persistent domain definition.
-- 
2.24.0.rc1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [PATCH 4/4] libxl: Drop cdrom media update support in live disk attch APIs

2020-01-15 Thread Han Han
Signed-off-by: Han Han 
---
 src/libxl/libxl_driver.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index f021ec9c5d..b481e950da 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3030,8 +3030,10 @@ libxlDomainAttachDeviceDiskLive(virDomainObjPtr vm, 
virDomainDeviceDefPtr dev)
 
 switch (l_disk->device)  {
 case VIR_DOMAIN_DISK_DEVICE_CDROM:
-ret = libxlDomainChangeEjectableMedia(vm, l_disk);
-break;
+virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+   "%s", _("cdrom update is not supported in this API. 
"
+   "Use virDomainUpdateDeviceFlags instead."));
+goto cleanup;
 case VIR_DOMAIN_DISK_DEVICE_DISK:
 if (l_disk->bus == VIR_DOMAIN_DISK_BUS_XEN) {
 if (virDomainDiskIndexByName(vm->def, l_disk->dst, true) >= 0) 
{
-- 
2.24.0.rc1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [PATCH 0/4][RFC] Drop media update support in virDomainAttachDevice*

2020-01-15 Thread Han Han
https://bugzilla.redhat.com/show_bug.cgi?id=1788793

Before virDomainUpdateDeviceFlags, virDomainAttachDevice* were used for
media update. Now we have introduced virDomainUpdateDeviceFlags for 9
years(since commit 46a2ea3689) but keep that compatibility of
virDomainAttachDevice* until now.

I think it is time to remove the compatibility since it doesn't work as
well as virDomainUpdateDeviceFlags on disk xml validation.

I wonder if any uplayer software relying on this compatibility...

My git repo: https://github.com/qiankehan/libvirt/tree/attach-device-nocdrom

Han Han (4):
  virsh.rst: Mention media update is not supported in
attach-{disk,device}
  libvirt: Remove comments of media update in virDomainAttachDeviceFlags
  qemu: Drop support of media update in live disk attach API
  libxl: Drop cdrom media update support in live disk attch APIs

 docs/manpages/virsh.rst  | 14 +++---
 src/libvirt-domain.c |  4 
 src/libxl/libxl_driver.c |  6 --
 src/qemu/qemu_hotplug.c  | 12 
 4 files changed, 15 insertions(+), 21 deletions(-)

-- 
2.24.0.rc1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH 0/4][RFC] Drop media update support in virDomainAttachDevice*

2020-01-15 Thread Daniel P . Berrangé
On Wed, Jan 15, 2020 at 04:24:54PM +0800, Han Han wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1788793
> 
> Before virDomainUpdateDeviceFlags, virDomainAttachDevice* were used for
> media update. Now we have introduced virDomainUpdateDeviceFlags for 9
> years(since commit 46a2ea3689) but keep that compatibility of
> virDomainAttachDevice* until now.
> 
> I think it is time to remove the compatibility since it doesn't work as
> well as virDomainUpdateDeviceFlags on disk xml validation.
> 
> I wonder if any uplayer software relying on this compatibility...

NACK, this is explicitly the kind of thing we will never do.

Providing a long term stable API means keeping existing methods
operating unchanged, even if we have since introduced a new method
which can do the same thing in a better way. The cost of keeping
this existing code is negligible in context to the maint work of
libvirt in general.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [patch v2 1/1] virt-aa-helper: Add support for smartcard host-certificates

2020-01-15 Thread Arnaud Patard
Cole Robinson  writes:

Hi,

> On 12/5/19 12:11 PM, Arnaud Patard wrote:
>> When emulating smartcard with host certificates, qemu needs to
>> be able to read the certificates files. Add necessary code to
>> add the smartcard certificates file path to the apparmor profile.
>> 
>> Passthrough support has been tested with spicevmc and remote-viewer.
>> 
>> v2:
>> - Fix CodingStyle
>> - Add support for 'host' case.
>> - Add a comment to mention that the passthrough case doesn't need
>>   some configuration
>> - Use one rule with '{,*}' instead of two rules.
>> 
>> Signed-off-by: Arnaud Patard 
>> Index: libvirt/src/security/virt-aa-helper.c
>> ===
>> --- libvirt.orig/src/security/virt-aa-helper.c
>> +++ libvirt/src/security/virt-aa-helper.c
>> @@ -1271,6 +1271,39 @@ get_files(vahControl * ctl)
>>  }
>>  }
>>  
>> +for (i = 0; i < ctl->def->nsmartcards; i++) {
>> +virDomainSmartcardDefPtr sc = ctl->def->smartcards[i];
>> +virDomainSmartcardType sc_type = sc->type;
>> +char *sc_db = (char *)VIR_DOMAIN_SMARTCARD_DEFAULT_DATABASE;
>> +if (sc->data.cert.database)
>> +sc_db = sc->data.cert.database;
>> +switch (sc_type) {
>> +/*
>> + * Note: At time of writing, to get this working, qemu seccomp 
>> sandbox has
>> + * to be disabled or the host must be running QEMU with commit
>> + * 9a1565a03b79d80b236bc7cc2dbce52a2ef3a1b8.
>> + * It's possibly due to 
>> libcacard:vcard_emul_new_event_thread(), which calls
>> + * PR_CreateThread(), which calls {g,s}etpriority(). And 
>> resourcecontrol seccomp
>> + * filter forbids it (cf src/qemu/qemu_command.c which seems to 
>> always use
>> + * resourcecontrol=deny).
>> + */
>
> This doesn't seem like the type of thing to track in a permanent code
> comment, nor a commit message, but as part of the email discussion.
> Otherwise, for the code because I don't have a test setup:
>
> Reviewed-by: Cole Robinson 
>
> If apparmor maintainers agree they can strip out of the comment so
> doesn't require a repost either way IMO

This patch doesn't seem to have been merged. Did it get lost or is it
waiting for me to resubmit it without the comment ?

Thanks,
Arnaud


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH 07/12] util: pull gnulib physmem impl into local code

2020-01-15 Thread Pavel Hrdina
On Fri, Jan 10, 2020 at 03:41:11PM +, Daniel P. Berrangé wrote:
> We don't need all the platforms gnulib deals with, so
> this is a cut down version of GNULIB's physmem.c
> code. This also allows us to integrate libvirt's
> error reporting functions closer to the error cause.
> 
> Signed-off-by: Daniel P. Berrangé 
> ---
>  build-aux/syntax-check.mk |   2 +-
>  src/conf/capabilities.c   |   1 -
>  src/util/virhostcpu.c |   1 -
>  src/util/virhostmem.c | 182 +++---
>  4 files changed, 153 insertions(+), 33 deletions(-)

Reviewed-by: Pavel Hrdina 


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Getting memory usage info for domains with balloon driver disabled

2020-01-15 Thread Daniel P . Berrangé
On Wed, Jan 15, 2020 at 03:45:50PM +0100, Tomasz Barański wrote:
> Hello,
> 
> I'm looking for a way to read guest memory usage information (RAM used,
> RAM available) for VMs with balloon driver disabled.
> 
> oVirt used to read that information using ovirt guest agent, but OGA is no
> longer used (and not even available for RHEL8).
> 
> I've seen that there was a discussion about adding it to the QEMU guest
> agent a couple years back[1] but it has not been implemented.
> 
> dominfo doesn't help:
> 
> # virsh dominfo 306c001c-f569-4afa-b024-81135c566a73 | grep memory
> Max memory: 1048576 KiB
> Used memory:1048576 KiB
> 
> dommemstat doesn't help:
> 
> # virsh dommemstat 306c001c-f569-4afa-b024-81135c566a73
> rss 1049432
> 
> Neither does domstats.
> 
> Is there any other way to get the info?

The balloon driver is the only thing that libvirt is able to use
for this purpose.

If you need the functionality the balloon driver provides, why
are you disabling the balloon driver in the guest ? It doesn't
really make sense to re-implement the logic again in the guest
agent, when the balloon driver is already capable of providing
this information.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [tck PATCH 2/3] network: Fix the dhcp range output being matched

2020-01-15 Thread Erik Skultety
Since libvirt commit 82fe58ff libvirt has been formatting the network
mask to the dnsmasq's dhcp-range config option which broke a few of the
networking tests.

Signed-off-by: Erik Skultety 
---
 scripts/networks/networkxml2hostout/tck-testnet-1.dat | 2 +-
 scripts/networks/networkxml2hostout/tck-testnet-2.dat | 2 +-
 scripts/networks/networkxml2hostout/tck-testnet-3.dat | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/networks/networkxml2hostout/tck-testnet-1.dat 
b/scripts/networks/networkxml2hostout/tck-testnet-1.dat
index eacd4c4..cf6f150 100644
--- a/scripts/networks/networkxml2hostout/tck-testnet-1.dat
+++ b/scripts/networks/networkxml2hostout/tck-testnet-1.dat
@@ -15,7 +15,7 @@ ACCEPT all  --  10.1.2.0/24  0.0.0.0/0
 #grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ 
s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
 bind-dynamic
 #grep dhcp-range `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ 
s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
-dhcp-range=10.1.2.2,10.1.2.254
+dhcp-range=10.1.2.2,10.1.2.254,255.255.255.0
 #ip link show type bridge | grep tck-testbr | gawk '{print $2}'
 tck-testbr:
 #ip -o addr show dev tck-testbr | gawk '{print $4" "$6}'
diff --git a/scripts/networks/networkxml2hostout/tck-testnet-2.dat 
b/scripts/networks/networkxml2hostout/tck-testnet-2.dat
index 9c90348..aabd959 100644
--- a/scripts/networks/networkxml2hostout/tck-testnet-2.dat
+++ b/scripts/networks/networkxml2hostout/tck-testnet-2.dat
@@ -10,7 +10,7 @@ ACCEPT all  --  10.1.2.0/24  0.0.0.0/0
 #grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ 
s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
 bind-dynamic
 #grep dhcp-range `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ 
s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
-dhcp-range=10.1.2.2,10.1.2.254
+dhcp-range=10.1.2.2,10.1.2.254,255.255.255.0
 #ip link show type bridge | grep tck-testbr | gawk '{print $2}'
 tck-testbr:
 #ip -o addr show dev tck-testbr | gawk '{print $4" "$6}'
diff --git a/scripts/networks/networkxml2hostout/tck-testnet-3.dat 
b/scripts/networks/networkxml2hostout/tck-testnet-3.dat
index 77664ba..cb3dd18 100644
--- a/scripts/networks/networkxml2hostout/tck-testnet-3.dat
+++ b/scripts/networks/networkxml2hostout/tck-testnet-3.dat
@@ -19,7 +19,7 @@ ACCEPT all  2001:db8:ac10:fe01::/64  ::/0
 #grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ 
s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
 bind-dynamic
 #grep dhcp-range `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ 
s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
-dhcp-range=10.1.2.2,10.1.2.254
+dhcp-range=10.1.2.2,10.1.2.254,255.255.255.0
 dhcp-range=2001:db8:ac10:fe01::1,ra-only
 dhcp-range=2001:db8:ac10:fd01::1,ra-only
 #ip link show type bridge | grep tck-testbr | gawk '{print $2}'
-- 
2.24.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [tck PATCH 1/3] network: Fix the iptables FORWARD chain name being queried

2020-01-15 Thread Erik Skultety
libvirt's has been defining private chains within iptables for a while,
only putting a target labels inside the master FORWARD chain which broke
the networking test suite which wasn't adjusted accordingly.

Signed-off-by: Erik Skultety 
---
 .../networks/networkxml2hostout/tck-testnet-1.dat|  3 ++-
 .../networks/networkxml2hostout/tck-testnet-2.dat|  3 ++-
 .../networks/networkxml2hostout/tck-testnet-3.dat| 12 +++-
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/scripts/networks/networkxml2hostout/tck-testnet-1.dat 
b/scripts/networks/networkxml2hostout/tck-testnet-1.dat
index 3e2ce12..eacd4c4 100644
--- a/scripts/networks/networkxml2hostout/tck-testnet-1.dat
+++ b/scripts/networks/networkxml2hostout/tck-testnet-1.dat
@@ -4,8 +4,9 @@ RETURN all  --  10.1.2.0/24 255.255.255.255
 MASQUERADE  tcp  --  10.1.2.0/24 !10.1.2.0/24 masq ports: 
1024-65535 
 MASQUERADE  udp  --  10.1.2.0/24 !10.1.2.0/24 masq ports: 
1024-65535 
 MASQUERADE  all  --  10.1.2.0/24 !10.1.2.0/24 
-#iptables -n -L FORWARD | grep ' 10\.1\.2\.' | sed -e 's/ctstate/state/'
+#iptables -n -L LIBVIRT_FWI | grep ' 10\.1\.2\.' | sed -e 's/ctstate/state/'
 ACCEPT all  --  0.0.0.0/010.1.2.0/24 state 
RELATED,ESTABLISHED 
+#iptables -n -L LIBVIRT_FWO | grep ' 10\.1\.2\.'
 ACCEPT all  --  10.1.2.0/24  0.0.0.0/0   
 #ip -o route show dev tck-testbr | gawk '{print $1" "$7}'
 10.1.2.0/24 10.1.2.1
diff --git a/scripts/networks/networkxml2hostout/tck-testnet-2.dat 
b/scripts/networks/networkxml2hostout/tck-testnet-2.dat
index 48b4b28..9c90348 100644
--- a/scripts/networks/networkxml2hostout/tck-testnet-2.dat
+++ b/scripts/networks/networkxml2hostout/tck-testnet-2.dat
@@ -1,5 +1,6 @@
-#iptables -L FORWARD -n | grep ' 10\.1\.2\.'
+#iptables -L LIBVIRT_FWI -n | grep ' 10\.1\.2\.'
 ACCEPT all  --  0.0.0.0/010.1.2.0/24 
+#iptables -L LIBVIRT_FWO -n | grep ' 10\.1\.2\.'
 ACCEPT all  --  10.1.2.0/24  0.0.0.0/0   
 #iptables -t nat -L -n | grep ' 10\.1\.2\.'
 #ip -o route show dev tck-testbr | gawk '{print $1" "$7}'
diff --git a/scripts/networks/networkxml2hostout/tck-testnet-3.dat 
b/scripts/networks/networkxml2hostout/tck-testnet-3.dat
index fca4f81..77664ba 100644
--- a/scripts/networks/networkxml2hostout/tck-testnet-3.dat
+++ b/scripts/networks/networkxml2hostout/tck-testnet-3.dat
@@ -4,14 +4,16 @@ RETURN all  --  10.1.2.0/24 255.255.255.255
 MASQUERADE  tcp  --  10.1.2.0/24 !10.1.2.0/24 masq ports: 
1024-65535 
 MASQUERADE  udp  --  10.1.2.0/24 !10.1.2.0/24 masq ports: 
1024-65535 
 MASQUERADE  all  --  10.1.2.0/24 !10.1.2.0/24 
-#iptables -n -L FORWARD | grep ' 10\.1\.2\.' | sed -e 's/ctstate/state/'
+#iptables -n -L LIBVIRT_FWI | grep ' 10\.1\.2\.' | sed -e 's/ctstate/state/'
 ACCEPT all  --  0.0.0.0/010.1.2.0/24 state 
RELATED,ESTABLISHED 
-ACCEPT all  --  10.1.2.0/24  0.0.0.0/0   
-#ip6tables -n -L FORWARD | grep ' 2001:db8:ac10'
+#iptables -n -L LIBVIRT_FWO | grep ' 10\.1\.2\.'
+ACCEPT all  --  10.1.2.0/24  0.0.0.0/0
+#ip6tables -n -L LIBVIRT_FWI | grep ' 2001:db8:ac10'
 ACCEPT all  ::/0 2001:db8:ac10:fd01::/64 
-ACCEPT all  2001:db8:ac10:fd01::/64  ::/0
 ACCEPT all  ::/0 2001:db8:ac10:fe01::/64 
-ACCEPT all  2001:db8:ac10:fe01::/64  ::/0
+#ip6tables -n -L LIBVIRT_FWO | grep ' 2001:db8:ac10'
+ACCEPT all  2001:db8:ac10:fd01::/64  ::/0
+ACCEPT all  2001:db8:ac10:fe01::/64  ::/0
 #ps aux | sed -n '/dnsmasq .*tck-testnet/ 
s|.*\(\/dnsmasq\/tck-testnet.conf\).*|\1|p' | head -1
 /dnsmasq/tck-testnet.conf
 #grep bind-dynamic `ps aux | sed -n '0,/dnsmasq .*tck-testnet/ 
s|.*--conf-file=\(.*tck-testnet.conf\).*|\1|p'`
-- 
2.24.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [tck PATCH 0/3] A few network related fixes to get the network suite running

2020-01-15 Thread Erik Skultety
Erik Skultety (3):
  network: Fix the iptables FORWARD chain name being queried
  network: Fix the dhcp range output being matched
  nwfilter: Fix the expected output from ebtables

 .../networks/networkxml2hostout/tck-testnet-1.dat  |  5 +++--
 .../networks/networkxml2hostout/tck-testnet-2.dat  |  5 +++--
 .../networks/networkxml2hostout/tck-testnet-3.dat  | 14 --
 .../nwfilter/nwfilterxml2fwallout/ipv6-test.fwall  | 12 ++--
 4 files changed, 20 insertions(+), 16 deletions(-)

--
2.24.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] Getting memory usage info for domains with balloon driver disabled

2020-01-15 Thread Tomasz Barański
Hello,

I'm looking for a way to read guest memory usage information (RAM used,
RAM available) for VMs with balloon driver disabled.

oVirt used to read that information using ovirt guest agent, but OGA is no
longer used (and not even available for RHEL8).

I've seen that there was a discussion about adding it to the QEMU guest
agent a couple years back[1] but it has not been implemented.

dominfo doesn't help:

# virsh dominfo 306c001c-f569-4afa-b024-81135c566a73 | grep memory
Max memory: 1048576 KiB
Used memory:1048576 KiB

dommemstat doesn't help:

# virsh dommemstat 306c001c-f569-4afa-b024-81135c566a73
rss 1049432

Neither does domstats.

Is there any other way to get the info?


[1] https://bugzilla.redhat.com/show_bug.cgi?id=1101915


Tomo

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH] qemu: Refuse to use "ps2" on machines that do not have this bus

2020-01-15 Thread Daniel Henrique Barboza




On 1/15/20 9:23 AM, Thomas Huth wrote:

The "ps2" bus is only available on certain machines like x86. On
machines like s390x, we should refuse to add a device to this bus
instead of silently ignoring it.

Looking at the QEMU sources, PS/2 is only available if the QEMU binary
has the "i8042" device, so let's check for that and only allow "ps2"
devices if this QEMU device is available, or if we're on x86 anyway
(so we don't have to fake the QEMU_CAPS_DEVICE_I8042 capability in
all the tests that use  in their xml data).

Reported-by: Sebastian Mitterle 
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1763191
Signed-off-by: Thomas Huth 
---



Reviewed-by: Daniel Henrique Barboza 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH] qemu: Refuse to use "ps2" on machines that do not have this bus

2020-01-15 Thread Daniel Henrique Barboza




On 1/15/20 9:23 AM, Thomas Huth wrote:

The "ps2" bus is only available on certain machines like x86. On
machines like s390x, we should refuse to add a device to this bus
instead of silently ignoring it.

Looking at the QEMU sources, PS/2 is only available if the QEMU binary
has the "i8042" device, so let's check for that and only allow "ps2"
devices if this QEMU device is available, or if we're on x86 anyway
(so we don't have to fake the QEMU_CAPS_DEVICE_I8042 capability in
all the tests that use  in their xml data).

Reported-by: Sebastian Mitterle 
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1763191
Signed-off-by: Thomas Huth 
---



Reviewed-by: Daniel Henrique Barboza 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [PATCH v2 86/86] numa: remove deprecated implicit RAM distribution between nodes

2020-01-15 Thread Igor Mammedov
Feature has been deprecated since 4.1 (4bb4a273),
remove it.

As result if RAM distribution wasn't specified explicitly,
the machine won't start and CLI should be changed to explicitly
assign RAM to nodes using options:
  -node node,memdev  (5.0 and newer machine types)
  -node node,mem (4.2 and older machine types)
It's recommended to use "memdev" variant for new virtual machines
and use "mem" only when it's necessary to migrate already existing
virtual machine started with implicit RAM distribution.

Signed-off-by: Igor Mammedov 
---
CC: ehabk...@redhat.com
CC: marcel.apfelb...@gmail.com
CC: m...@redhat.com
CC: pbonz...@redhat.com
CC: da...@gibson.dropbear.id.au
CC: libvir-list@redhat.com
CC: qemu-...@nongnu.org
CC: r...@twiddle.net
---
 include/hw/boards.h   |  3 ---
 include/sysemu/numa.h |  4 
 hw/core/machine.c |  6 -
 hw/core/numa.c| 61 +--
 hw/i386/pc_piix.c |  1 -
 hw/i386/pc_q35.c  |  1 -
 hw/ppc/spapr.c|  7 --
 qemu-deprecated.texi  |  8 ---
 qemu-options.hx   | 16 +++---
 9 files changed, 13 insertions(+), 94 deletions(-)

diff --git a/include/hw/boards.h b/include/hw/boards.h
index 7f09bc9..916bb50 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -192,12 +192,9 @@ struct MachineClass {
 int minimum_page_bits;
 bool has_hotpluggable_cpus;
 bool ignore_memory_transaction_failures;
-int numa_mem_align_shift;
 const char **valid_cpu_types;
 strList *allowed_dynamic_sysbus_devices;
 bool auto_enable_numa_with_memhp;
-void (*numa_auto_assign_ram)(MachineClass *mc, NodeInfo *nodes,
- int nb_nodes, ram_addr_t size);
 bool ignore_boot_device_suffixes;
 bool smbus_no_migration_support;
 bool nvdimm_supported;
diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h
index ad58ee8..4173ef2 100644
--- a/include/sysemu/numa.h
+++ b/include/sysemu/numa.h
@@ -106,10 +106,6 @@ void parse_numa_hmat_cache(MachineState *ms, 
NumaHmatCacheOptions *node,
 void numa_complete_configuration(MachineState *ms);
 void query_numa_node_mem(NumaNodeMem node_mem[], MachineState *ms);
 extern QemuOptsList qemu_numa_opts;
-void numa_legacy_auto_assign_ram(MachineClass *mc, NodeInfo *nodes,
- int nb_nodes, ram_addr_t size);
-void numa_default_auto_assign_ram(MachineClass *mc, NodeInfo *nodes,
-  int nb_nodes, ram_addr_t size);
 void numa_cpu_pre_plug(const struct CPUArchId *slot, DeviceState *dev,
Error **errp);
 bool numa_uses_legacy_mem(void);
diff --git a/hw/core/machine.c b/hw/core/machine.c
index d8fa45c..0862f45 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -747,12 +747,6 @@ static void machine_class_init(ObjectClass *oc, void *data)
 mc->rom_file_has_mr = true;
 mc->smp_parse = smp_parse;
 
-/* numa node memory size aligned on 8MB by default.
- * On Linux, each node's border has to be 8MB aligned
- */
-mc->numa_mem_align_shift = 23;
-mc->numa_auto_assign_ram = numa_default_auto_assign_ram;
-
 object_class_property_add_str(oc, "kernel",
 machine_get_kernel, machine_set_kernel, _abort);
 object_class_property_set_description(oc, "kernel",
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 47d5ea1..591e62a 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -627,42 +627,6 @@ static void complete_init_numa_distance(MachineState *ms)
 }
 }
 
-void numa_legacy_auto_assign_ram(MachineClass *mc, NodeInfo *nodes,
- int nb_nodes, ram_addr_t size)
-{
-int i;
-uint64_t usedmem = 0;
-
-/* Align each node according to the alignment
- * requirements of the machine class
- */
-
-for (i = 0; i < nb_nodes - 1; i++) {
-nodes[i].node_mem = (size / nb_nodes) &
-~((1 << mc->numa_mem_align_shift) - 1);
-usedmem += nodes[i].node_mem;
-}
-nodes[i].node_mem = size - usedmem;
-}
-
-void numa_default_auto_assign_ram(MachineClass *mc, NodeInfo *nodes,
-  int nb_nodes, ram_addr_t size)
-{
-int i;
-uint64_t usedmem = 0, node_mem;
-uint64_t granularity = size / nb_nodes;
-uint64_t propagate = 0;
-
-for (i = 0; i < nb_nodes - 1; i++) {
-node_mem = (granularity + propagate) &
-   ~((1 << mc->numa_mem_align_shift) - 1);
-propagate = granularity + propagate - node_mem;
-nodes[i].node_mem = node_mem;
-usedmem += node_mem;
-}
-nodes[i].node_mem = size - usedmem;
-}
-
 static void numa_init_memdev_container(MachineState *ms, MemoryRegion *ram)
 {
 int i;
@@ -732,30 +696,15 @@ void numa_complete_configuration(MachineState *ms)
 ms->numa_state->num_nodes = MAX_NODES;
 }
 
-/* If no memory size is given for any node, assume the default case
- * and distribute the 

[libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types

2020-01-15 Thread Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch
introduced by cd5ff8333a.
Disable legacy option for new machine types and amend documentation.

Signed-off-by: Igor Mammedov 
---
CC: peter.mayd...@linaro.org
CC: ehabk...@redhat.com
CC: marcel.apfelb...@gmail.com
CC: m...@redhat.com
CC: pbonz...@redhat.com
CC: r...@twiddle.net
CC: da...@gibson.dropbear.id.au
CC: libvir-list@redhat.com
CC: qemu-...@nongnu.org
CC: qemu-...@nongnu.org
---
 hw/arm/virt.c|  2 +-
 hw/core/numa.c   |  6 ++
 hw/i386/pc.c |  1 -
 hw/i386/pc_piix.c|  1 +
 hw/i386/pc_q35.c |  1 +
 hw/ppc/spapr.c   |  2 +-
 qemu-deprecated.texi | 16 
 qemu-options.hx  |  8 
 8 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index e2fbca3..49de0d8 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2049,7 +2049,6 @@ static void virt_machine_class_init(ObjectClass *oc, void 
*data)
 hc->pre_plug = virt_machine_device_pre_plug_cb;
 hc->plug = virt_machine_device_plug_cb;
 hc->unplug_request = virt_machine_device_unplug_request_cb;
-mc->numa_mem_supported = true;
 mc->auto_enable_numa_with_memhp = true;
 mc->default_ram_id = "mach-virt.ram";
 }
@@ -2153,6 +2152,7 @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 0)
 static void virt_machine_4_2_options(MachineClass *mc)
 {
 compat_props_add(mc->compat_props, hw_compat_4_2, hw_compat_4_2_len);
+mc->numa_mem_supported = true;
 }
 DEFINE_VIRT_MACHINE(4, 2)
 
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 0970a30..3177066 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -117,6 +117,12 @@ static void parse_numa_node(MachineState *ms, 
NumaNodeOptions *node,
 }
 
 if (node->has_mem) {
+if (!mc->numa_mem_supported) {
+error_setg(errp, "Parameter -numa node,mem is not supported by 
this"
+  " machine type. Use -numa node,memdev instead");
+return;
+}
+
 numa_info[nodenr].node_mem = node->mem;
 if (!qtest_enabled()) {
 warn_report("Parameter -numa node,mem is deprecated,"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 21b8290..fa8d024 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1947,7 +1947,6 @@ static void pc_machine_class_init(ObjectClass *oc, void 
*data)
 hc->unplug = pc_machine_device_unplug_cb;
 mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
 mc->nvdimm_supported = true;
-mc->numa_mem_supported = true;
 mc->default_ram_id = "pc.ram";
 
 object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int",
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index fa12203..0a9b9e0 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -435,6 +435,7 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)
 pc_i440fx_5_0_machine_options(m);
 m->alias = NULL;
 m->is_default = 0;
+m->numa_mem_supported = true;
 compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len);
 compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len);
 }
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 84cf925..4d6e2be 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -363,6 +363,7 @@ static void pc_q35_4_2_machine_options(MachineClass *m)
 {
 pc_q35_5_0_machine_options(m);
 m->alias = NULL;
+m->numa_mem_supported = true;
 compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len);
 compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len);
 }
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index bcbe1f1..2686b73 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4383,7 +4383,6 @@ static void spapr_machine_class_init(ObjectClass *oc, 
void *data)
  * in which LMBs are represented and hot-added
  */
 mc->numa_mem_align_shift = 28;
-mc->numa_mem_supported = true;
 mc->auto_enable_numa = true;
 
 smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF;
@@ -4465,6 +4464,7 @@ static void spapr_machine_4_2_class_options(MachineClass 
*mc)
 {
 spapr_machine_5_0_class_options(mc);
 compat_props_add(mc->compat_props, hw_compat_4_2, hw_compat_4_2_len);
+mc->numa_mem_supported = true;
 }
 
 DEFINE_SPAPR_MACHINE(4_2, "4.2", false);
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 982af95..17a0e1d 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -89,22 +89,6 @@ error in the future.
 The @code{-realtime mlock=on|off} argument has been replaced by the
 @code{-overcommit mem-lock=on|off} argument.
 
-@subsection -numa node,mem=@var{size} (since 4.1)
-
-The parameter @option{mem} of @option{-numa node} is used to assign a part of
-guest RAM to a NUMA node. But when using it, it's impossible to manage 
specified
-RAM chunk on the host side (like bind it to a host node, setting bind policy, 
...),
-so guest end-ups with the fake NUMA configuration with suboptiomal performance.
-However since 2014 there is an alternative way to 

Re: [libvirt] [PATCH] gnulib: Pull in latest changes

2020-01-15 Thread Andrea Bolognani
On Tue, 2020-01-14 at 18:21 +0100, Andrea Bolognani wrote:
> Note that I have not actually had the time to confirm this fixes
> the problem, or to reproduce it in the first place (I'll do that
> tomorrow).

I haven't been able to reproduce the issue in a fully up to date
Fedora 31 ppc64le guest, so obviously I can't confirm updating gnulib
actually addresses it.

Either way, I'll push this under the gnulib update rule once 6.1.0 is
open for business.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [tck PATCH 3/3] nwfilter: Fix the expected output from ebtables

2020-01-15 Thread Erik Skultety
For some reason, some of the PTP link addresses didn't specify the
/128 prefix explicitly which fails the pattern matching in the nwfilter
tests.

Signed-off-by: Erik Skultety 
---
 .../nwfilter/nwfilterxml2fwallout/ipv6-test.fwall| 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/nwfilter/nwfilterxml2fwallout/ipv6-test.fwall 
b/scripts/nwfilter/nwfilterxml2fwallout/ipv6-test.fwall
index 5803759..0e26b6c 100644
--- a/scripts/nwfilter/nwfilterxml2fwallout/ipv6-test.fwall
+++ b/scripts/nwfilter/nwfilterxml2fwallout/ipv6-test.fwall
@@ -4,10 +4,10 @@
 -o vnet0 -j libvirt-O-vnet0
 #ebtables -t nat -L libvirt-I-vnet0 | sed 
's#/:::::::##g' | sed 
's#/:::::::8000#/113#g' | sed 
's#/::::8000::#/65#g' | sed 's#/:fc00::#/22#g' | sed 
s/01:02:03:04:05:06/1:2:3:4:5:6/g | grep -v "^Bridge" | grep -v "^$"
 -p IPv6 -s 1:2:3:4:5:6/ff:ff:ff:ff:ff:fe -d 
aa:bb:cc:dd:ee:80/ff:ff:ff:ff:ff:80 --ip6-src ::/22 --ip6-dst ::10.1.0.0/113 
--ip6-proto udp --ip6-sport 20:22 --ip6-dport 100:101 -j ACCEPT
--p IPv6 --ip6-src a:b:c::/65 --ip6-dst 1::2 --ip6-proto tcp --ip6-sport 
100:101 --ip6-dport 20:22 -j ACCEPT
--p IPv6 --ip6-src a:b:c::/65 --ip6-dst 1::2 --ip6-proto tcp --ip6-sport 65535 
--ip6-dport 255:256 -j ACCEPT
--p IPv6 --ip6-src a:b:c::/65 --ip6-dst 1::2 --ip6-proto mux -j ACCEPT
+-p IPv6 --ip6-src a:b:c::/65 --ip6-dst 1::2/128 --ip6-proto tcp --ip6-sport 
100:101 --ip6-dport 20:22 -j ACCEPT
+-p IPv6 --ip6-src a:b:c::/65 --ip6-dst 1::2/128 --ip6-proto tcp --ip6-sport 
65535 --ip6-dport 255:256 -j ACCEPT
+-p IPv6 --ip6-src a:b:c::/65 --ip6-dst 1::2/128 --ip6-proto mux -j ACCEPT
 #ebtables -t nat -L libvirt-O-vnet0 | sed 
's#/:::::::##g' | sed 
's#/::::8000::#/65#g' | grep -v "^Bridge" | grep -v "^$"
--p IPv6 --ip6-src 1::2 --ip6-dst a:b:c::/65 --ip6-proto tcp --ip6-sport 20:22 
--ip6-dport 100:101 -j ACCEPT
--p IPv6 --ip6-src 1::2 --ip6-dst a:b:c::/65 --ip6-proto tcp --ip6-sport 
255:256 --ip6-dport 65535 -j ACCEPT
--p IPv6 --ip6-src 1::2 --ip6-dst a:b:c::/65 --ip6-proto mux -j ACCEPT
+-p IPv6 --ip6-src 1::2/128 --ip6-dst a:b:c::/65 --ip6-proto tcp --ip6-sport 
20:22 --ip6-dport 100:101 -j ACCEPT
+-p IPv6 --ip6-src 1::2/128 --ip6-dst a:b:c::/65 --ip6-proto tcp --ip6-sport 
255:256 --ip6-dport 65535 -j ACCEPT
+-p IPv6 --ip6-src 1::2/128 --ip6-dst a:b:c::/65 --ip6-proto mux -j ACCEPT
-- 
2.24.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH 05/12] util: introduce compat wrappers for Winsock2

2020-01-15 Thread Pavel Hrdina
On Fri, Jan 10, 2020 at 03:41:09PM +, Daniel P. Berrangé wrote:
> Windows sockets take a SOCKET HANDLE object instead of a
> file descriptor. Wrap them in the same way that gnulib
> does so that they use C runtime file descriptors.
> 
> While we could in theory use GSocket, it is hard to get
> the exact same semantics libvirt has for its current
> socket usage. Wrapping the Winsock2 APIs is thus the
> easiest approach in the short term.
> 
> Signed-off-by: Daniel P. Berrangé 
> ---
>  src/util/Makefile.inc.am |   2 +
>  src/util/virsocket.c | 346 +++
>  src/util/virsocket.h |  89 ++
>  3 files changed, 437 insertions(+)
>  create mode 100644 src/util/virsocket.c
>  create mode 100644 src/util/virsocket.h

Reviewed-by: Pavel Hrdina 


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] maint: Post-release version bump to 6.1.0

2020-01-15 Thread Ján Tomko
Signed-off-by: Ján Tomko 
---
 configure.ac  | 2 +-
 docs/news.xml | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 002a3dcdb0..8837928358 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 .
 
-AC_INIT([libvirt], [6.0.0], [libvir-list@redhat.com], [], 
[https://libvirt.org])
+AC_INIT([libvirt], [6.1.0], [libvir-list@redhat.com], [], 
[https://libvirt.org])
 
 if test $srcdir = "."
 then
diff --git a/docs/news.xml b/docs/news.xml
index 731f010297..056c7ef026 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -42,6 +42,14 @@
  -->
 
 
+  
+
+
+
+
+
+
+  
   
 
   
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 1/2] test: let qemuhotplugtest report details of init fails

2020-01-15 Thread Christian Ehrhardt
If virHostdevManagerGetDefault in qemuhotplugtest fails it works
for quite a while to later segfault when accessing
mgr->activePCIHostdevs.

Report the error details and break on a failed init to see the
real issue right away.

Signed-off-by: Christian Ehrhardt 
---
 tests/qemuhotplugtest.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index a60c8d1c93..94440791d5 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -634,6 +634,11 @@ mymain(void)
 return EXIT_FAILURE;
 
 driver.hostdevMgr = virHostdevManagerGetDefault();
+if (driver.hostdevMgr == NULL) {
+VIR_TEST_VERBOSE("Could not initialize HostdevManager - %s\n",
+virGetLastErrorMessage());
+return EXIT_FAILURE;
+}
 
 
 #define DO_TEST(file, ACTION, dev, fial, kep, ...) \
-- 
2.25.0


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [PATCH 0/2] fix segfaults on qemuhotplugtest

2020-01-15 Thread Christian Ehrhardt
After debugging for a while and eventually finding the root cause we
discussed this on IRC today:

 danpb: BTW the test crash in 6.0 that I'm tracing (asked yesterday)
   is virHostdevManagerInitialize failing
 the test goes on with mgr set to 0x0 and that is the segfault
   later on
 virSetError was helpful as "Could not initialize HostdevManager
   operation failed: Failed to create state dir
   '/sbuild-nonexistent/.cache/libvirt/hostdevmgr'" sounds like a
   very testbed-specific issue that I might be able to solve when
   invoking the tests
 hmm, seems like we're missing a mock for  mkdir()
 i guess we should mock  virFileMakePath in this case

This series got v6.0.0 building in Ubuntu, so I thought it is worth to
submit it for review.

Christian Ehrhardt (2):
  test: let qemuhotplugtest report details of init fails
  test: qemuhotplugtest mock virFileMakePath

 tests/qemuhotplugmock.c | 18 ++
 tests/qemuhotplugtest.c |  5 +
 2 files changed, 23 insertions(+)

-- 
2.25.0


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [PATCH 2/2] test: qemuhotplugtest mock virFileMakePath

2020-01-15 Thread Christian Ehrhardt
In certain build environments (e.g. Debian and Ubuntu) $HOME is set
to a non existing path intentionally. That breaks and crashes
qemuhotplugtest by failing the init in virHostdevManagerGetDefault.

Avoid that issue by mocking the virFileMakePath behavior if it is
passed a path that matches $HOME and doesn't exists. That fixes
qemuhotplugtest in Debian/Ubuntu builds of v6.0.0.

Signed-off-by: Christian Ehrhardt 
---
 tests/qemuhotplugmock.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/tests/qemuhotplugmock.c b/tests/qemuhotplugmock.c
index 43a9d79051..bd5eb3ceb6 100644
--- a/tests/qemuhotplugmock.c
+++ b/tests/qemuhotplugmock.c
@@ -18,6 +18,7 @@
 
 #include 
 
+#include "virmock.h"
 #include "qemu/qemu_hotplug.h"
 #include "conf/domain_conf.h"
 
@@ -31,3 +32,20 @@ qemuDomainGetUnplugTimeout(virDomainObjPtr vm G_GNUC_UNUSED)
 return 200;
 return 100;
 }
+
+VIR_MOCK_IMPL_RET_ARGS(virFileMakePath, int,
+   const char *, path)
+{
+const char *home;
+
+VIR_MOCK_REAL_INIT(virFileMakePath);
+
+/* ignore non-existing homes (e.g. in build environments) */
+home = getenv("HOME");
+if (strstr(path, home)) {
+if (!g_file_test (home, G_FILE_TEST_EXISTS)) {
+return 0;
+}
+}
+return real_virFileMakePath(path);
+}
-- 
2.25.0


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] Release of libvirt-6.0.0

2020-01-15 Thread Daniel Veillard
  As planned the release is available, tagged in git, and the signed
tarball and source rpm are available from the usual place:

  https://libvirt.org/sources/

I also made the release of the pythn bindings which can be found at:

  https://libvirt.org/sources/python/

This release carries some serious changes, dropping the support for python2
and the phyp Power Hypervisor. This comes with a set of new features and
improvements too:

Packaging changes:

- support for python2 is removed
Libvirt is no longer able to be built using the Python 2 binary. Python
3 must be used instead.

- docs: the python docutils toolset is now required
The use of rst2html has been introduced for the website build process
since docs are now being written in the RST as an alternative to HTML.

New features:

- new PCI hostdev address type: unassigned
A new PCI hostdev address type 'unassigned' is introduced. An
unassigned PCI hostdev behaves like any regular PCI hostdev inside
Libvirt, but it is not usable by the guest. This gives the user a new
option to manage the binding of PCI devices via Libvirt, declaring PCI
hostdevs in the domain XML but allowing just a subset of them to be
assigned to the guest.

- Provide init scripts for sub-deaemons
So far libvirt shipped systemd unit files for sub-daemons. With this
release, init scripts are available too. Package maintainers can choose
which one to install via --with-init-script configure option.

- qemu: Support cold-unplug of sound devices

- qemu: Implement VIR_MIGRATE_PARAM_TLS_DESTINATION
This flag, which can be enabled using virsh's --tls-destination option,
allows migration to succeed in situations where there is a mismatch
between the destination's hostname and the information stored in its
TLS certificate.

- qemu: Support reporting memory bandwidth usage stats
Implement Intel RDT-MBM in libvirt. The stats can be obtained via virsh
domstats --memory.

- qemu: Allow accessing NVMe disks directly
Before this release there were two ways to configure a NVMe disk for a
domain. The first was using  with the  pointing to the
/dev/nvme. The other was using PCI assignment via 
element. Both have their disadvantages: the former adds latency of file
system and block layers of the host kernel, the latter prohibits domain
migration. In this release the third way of configuring NVMe disk is
added which combines the advantages and drops disadvantages of the
previous two ways. It's accessible via .

Removed features:

- 'phyp' Power Hypervisor driver removed
The 'phyp' Power Hypervisor driver has not seen active development
since 2011 and does not seem to have any real world usage. It has now
been removed.

Improvements:

- qemu: xz save image compression is faster
When using the xz format to compressed virtual machine saved state
images, the "-3" compression level preset is now used. This results in
slightly larger files, but with a massively reduced time to compress.
The xz format offers the best compression level for saved state images,
albeit still with the slowest running time. For the fastest possible
running time, at cost of the larest compressed size, lzop should be
used.

- domain: Improve job stat handling
It is now possible to retrieve stats for completed and failed jobs.

- qemu: Don't hold monitor and agent job at the same time
Before this change, a malicious (or buggy) qemu-guest-agent running in
the guest could make other libvirt APIs unavailable for an unbounded
amount of time.

Bug fixes:

- qemu: Report error if backing image format is not specified explicitly
For a long time libvirt was assuming that a backing file is RAW when
the format was not specified. This didn't pose a problem until blockdev
support was enabled in last release. Libvirt now requires that the
format is specified in the image metadata or domain XML and the VM will
refuse to start otherwise. Additionally the error message now links to
the knowledge base which summarizes how to fix the images.

- qemu: Fix non-shared storage migration over NBD

- qemu: Generate a single MAC address for hotplugged network devices
Since libvirt 4.6.0, when hotplugging a network device that didn't have
a MAC address already assigned by the user, two separate addresses
would be generated: one for the live configuration, which would show up
immediately, and one for the inactive configuration, which would show
up after the first reboot. This situation was clearly undesirable, so a
single MAC address is now generated and used both for the live
configuration and the inactive one.

  thanks everybody who helped on this release, with reports, fixes,
reviews, ideas, documentation, etc ...

   Enjoy the release, next one will be scheduled at the end of
February !

Daniel

-- 
Daniel Veillard  | Red Hat 

Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types

2020-01-15 Thread Peter Krempa
On Wed, Jan 15, 2020 at 16:07:37 +0100, Igor Mammedov wrote:
> Deprecation period is ran out and it's a time to flip the switch
> introduced by cd5ff8333a.
> Disable legacy option for new machine types and amend documentation.
> 
> Signed-off-by: Igor Mammedov 
> ---
> CC: peter.mayd...@linaro.org
> CC: ehabk...@redhat.com
> CC: marcel.apfelb...@gmail.com
> CC: m...@redhat.com
> CC: pbonz...@redhat.com
> CC: r...@twiddle.net
> CC: da...@gibson.dropbear.id.au
> CC: libvir-list@redhat.com
> CC: qemu-...@nongnu.org
> CC: qemu-...@nongnu.org
> ---
>  hw/arm/virt.c|  2 +-
>  hw/core/numa.c   |  6 ++
>  hw/i386/pc.c |  1 -
>  hw/i386/pc_piix.c|  1 +
>  hw/i386/pc_q35.c |  1 +
>  hw/ppc/spapr.c   |  2 +-
>  qemu-deprecated.texi | 16 
>  qemu-options.hx  |  8 
>  8 files changed, 14 insertions(+), 23 deletions(-)

I'm afraid nobody bothered to fix it yet:

https://bugzilla.redhat.com/show_bug.cgi?id=1783355

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types

2020-01-15 Thread Igor Mammedov
On Wed, 15 Jan 2020 16:34:53 +0100
Peter Krempa  wrote:

> On Wed, Jan 15, 2020 at 16:07:37 +0100, Igor Mammedov wrote:
> > Deprecation period is ran out and it's a time to flip the switch
> > introduced by cd5ff8333a.
> > Disable legacy option for new machine types and amend documentation.
> > 
> > Signed-off-by: Igor Mammedov 
> > ---
> > CC: peter.mayd...@linaro.org
> > CC: ehabk...@redhat.com
> > CC: marcel.apfelb...@gmail.com
> > CC: m...@redhat.com
> > CC: pbonz...@redhat.com
> > CC: r...@twiddle.net
> > CC: da...@gibson.dropbear.id.au
> > CC: libvir-list@redhat.com
> > CC: qemu-...@nongnu.org
> > CC: qemu-...@nongnu.org
> > ---
> >  hw/arm/virt.c|  2 +-
> >  hw/core/numa.c   |  6 ++
> >  hw/i386/pc.c |  1 -
> >  hw/i386/pc_piix.c|  1 +
> >  hw/i386/pc_q35.c |  1 +
> >  hw/ppc/spapr.c   |  2 +-
> >  qemu-deprecated.texi | 16 
> >  qemu-options.hx  |  8 
> >  8 files changed, 14 insertions(+), 23 deletions(-)  
> 
> I'm afraid nobody bothered to fix it yet:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1783355

It's time to start working on it :)
(looks like just deprecating stuff isn't sufficient motivation,
maybe actual switch flipping would work out better)

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] FYI: intention to remove mail subject prefix & footer text

2020-01-15 Thread Daniel P . Berrangé
FYI, I'm intending to make this change tomorrow (Thursday Jan 16th)

On Fri, Jan 10, 2020 at 12:26:07PM +, Daniel P. Berrangé wrote:
> Hi List Subscribers,
> 
> In recent months we have been seeing an increasing number of bounced
> deliveries from libvirt mailing lists[1] due to DMARC policies on list
> subscriber's mail servers. IOW, many subscribers are only receiving
> a subset of mails sent to the libvirt mailing lists.
> 
> We believe the root cause of many of the problems is that mailman is
> modifying the mail subject to add the "[libvirt]" / "[libvirt-users]"
> prefix, and modifying the mail body to add the footer with links to
> the listinfo page.
> 
> These modifications invalidate the DKIM signatures on mails sent to
> the list by some of our subscribers. This in turn causes DMARC policy
> rejections by the destination SMTP servers when mailman delivers
> messages.
> 
> The solution is to disable any feature in mailman which modifies
> parts of the mail validated by the DKIM signature. This means removing
> the subject prefix and the mail body header. Further information on
> this approach can be seen here:
> 
>https://begriffs.com/posts/2018-09-18-dmarc-mailing-list.html
> 
> QEMU has made the same change on their mailing list last year:
> 
>https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg00416.html
> 
> If you are currently doing mail filtering / sorting based on the subject
> prefix, you will need to change to use the List-Id header instead.
> 
> I will wait until the latter part of next week before making this change
> to allow people time to adapt any filters.
> 
> Regards,
> Daniel
> 
> [1] technically moderators have only been seeing bounces for messages on
> libvirt-users-list, but that's because we've got mailman configured
> to send libvir-list bounces to /dev/null.
> -- 
> |: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o-https://fstop138.berrange.com :|
> |: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 00/12] include result of bootstrap in git

2020-01-15 Thread Daniel P . Berrangé
On Thu, Jan 09, 2020 at 03:53:10PM +0100, Pavel Hrdina wrote:
> This patch series is motivated by the effort to adopt Meson as our
> build system but all of it improves the current build system on its own.
> 
> It moves the burden to run bootstrap/autoreconf to developers which
> means it will save some time for others when there is any change to
> the build system.
> 
> Since one of the patches is slightly bigger here is link to git:
> 
>  branch 

FYI, I am getting really close to being able to post another
series which entirely kills off gnulib. I'm down to 4 modules
left today, and a bunch of testing. If all goes well I'll
likely be done by end of this week.

Most of these patches are still OK to push, but I'm thinking
it is nicer to hold off on pushing the really big patch 10
which actually commits all the gnulib files.


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH 1/2] test: let qemuhotplugtest report details of init fails

2020-01-15 Thread Daniel Henrique Barboza




On 1/15/20 1:37 PM, Christian Ehrhardt wrote:

If virHostdevManagerGetDefault in qemuhotplugtest fails it works
for quite a while to later segfault when accessing
mgr->activePCIHostdevs.

Report the error details and break on a failed init to see the
real issue right away.

Signed-off-by: Christian Ehrhardt 
---
  tests/qemuhotplugtest.c | 5 +
  1 file changed, 5 insertions(+)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index a60c8d1c93..94440791d5 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -634,6 +634,11 @@ mymain(void)
  return EXIT_FAILURE;
  
  driver.hostdevMgr = virHostdevManagerGetDefault();

+if (driver.hostdevMgr == NULL) {
+VIR_TEST_VERBOSE("Could not initialize HostdevManager - %s\n",
+virGetLastErrorMessage());


Suggestion/nit: make 'virGetLastErrorMessage()' with the same identation of
the string above it:


+VIR_TEST_VERBOSE("Could not initialize HostdevManager - %s\n",
+ virGetLastErrorMessage());



LGTM regardless, so


Reviewed-by: Daniel Henrique Barboza 




+return EXIT_FAILURE;
+}
  
  
  #define DO_TEST(file, ACTION, dev, fial, kep, ...) \




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH 2/2] test: qemuhotplugtest mock virFileMakePath

2020-01-15 Thread Daniel Henrique Barboza




On 1/15/20 1:37 PM, Christian Ehrhardt wrote:

In certain build environments (e.g. Debian and Ubuntu) $HOME is set
to a non existing path intentionally. That breaks and crashes
qemuhotplugtest by failing the init in virHostdevManagerGetDefault.

Avoid that issue by mocking the virFileMakePath behavior if it is
passed a path that matches $HOME and doesn't exists. That fixes
qemuhotplugtest in Debian/Ubuntu builds of v6.0.0.

Signed-off-by: Christian Ehrhardt 
---
  tests/qemuhotplugmock.c | 18 ++
  1 file changed, 18 insertions(+)

diff --git a/tests/qemuhotplugmock.c b/tests/qemuhotplugmock.c
index 43a9d79051..bd5eb3ceb6 100644
--- a/tests/qemuhotplugmock.c
+++ b/tests/qemuhotplugmock.c
@@ -18,6 +18,7 @@
  
  #include 
  
+#include "virmock.h"

  #include "qemu/qemu_hotplug.h"
  #include "conf/domain_conf.h"
  
@@ -31,3 +32,20 @@ qemuDomainGetUnplugTimeout(virDomainObjPtr vm G_GNUC_UNUSED)

  return 200;
  return 100;
  }
+
+VIR_MOCK_IMPL_RET_ARGS(virFileMakePath, int,
+   const char *, path)
+{
+const char *home;
+
+VIR_MOCK_REAL_INIT(virFileMakePath);
+
+/* ignore non-existing homes (e.g. in build environments) */
+home = getenv("HOME");
+if (strstr(path, home)) {
+if (!g_file_test (home, G_FILE_TEST_EXISTS)) {
+return 0;
+}
+}


make syntax-check is not happy with the curly brackets here:


Whitespace after non-keyword:
../tests/qemuhotplugmock.c:46: if (!g_file_test (home, 
G_FILE_TEST_EXISTS)) {
Curly brackets around single-line body:
../tests/qemuhotplugmock.c:46-48:
if (!g_file_test (home, G_FILE_TEST_EXISTS)) {
return 0;
}
build-aux/syntax-check.mk: incorrect formatting
make: *** [../build-aux/syntax-check.mk:2173: spacing-check] Error 1
make: *** Waiting for unfinished jobs
$


This fixes it:

$ git diff
diff --git a/tests/qemuhotplugmock.c b/tests/qemuhotplugmock.c
index bd5eb3ceb6..fdad585e33 100644
--- a/tests/qemuhotplugmock.c
+++ b/tests/qemuhotplugmock.c
@@ -43,9 +43,8 @@ VIR_MOCK_IMPL_RET_ARGS(virFileMakePath, int,
 /* ignore non-existing homes (e.g. in build environments) */
 home = getenv("HOME");
 if (strstr(path, home)) {
-if (!g_file_test (home, G_FILE_TEST_EXISTS)) {
+if (!g_file_test(home, G_FILE_TEST_EXISTS))
 return 0;
-}
 }
 return real_virFileMakePath(path);
 }



With this fixed:


Reviewed-by: Daniel Henrique Barboza 




+return real_virFileMakePath(path);
+}



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [libvirt-tck PATCH] Support version compare

2020-01-15 Thread dzheng
From: Dan Zheng 

Some APIs are only supported from new version. This is to compare
the current running version to the supporting version in order to
decide if one test should be skipped.

Signed-off-by: Dan Zheng 
---
 lib/Sys/Virt/TCK.pm | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm
index a641d01..98ea945 100644
--- a/lib/Sys/Virt/TCK.pm
+++ b/lib/Sys/Virt/TCK.pm
@@ -1229,6 +1229,21 @@ sub get_host_block_device {
 return $match ? $device : undef;
 }
 
+sub compare_version {
+my $self = shift;
+my $to_version = shift;
+
+my $from_version = `rpm -q perl-Sys-Virt | cut -d'-' -f4`;
+$from_version =~ s/\R//g;
+print "Current version:$from_version compares to $to_version\n";
+$from_version =~ /(\d+).(\d+).(\d+)/;
+$from_version = $1 * 100 + $2 * 1000 + $3;
+
+$to_version =~ /(\d+).(\d+).(\d+)/;
+$to_version = $1 * 100 + $2 * 1000 + $3;
+return ($from_version ge $to_version)? 1 : 0;
+}
+
 sub get_host_network_device {
 my $self = shift;
 my $devindex = @_ ? shift : 0;
-- 
2.18.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



Re: [libvirt] [PATCH] gnulib: Pull in latest changes

2020-01-15 Thread Satheesh Rajendran
On Tue, Jan 14, 2020 at 06:21:33PM +0100, Andrea Bolognani wrote:
> In particular, we're interested in the following commits:
> 
>   commit 43b5194d5b156f8dd7ae576952568d331978f5f0
>   Author: Bruno Haible 
>   Date:   Sun Jan 5 20:42:12 2020 +0100
> 
> tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.
> 
> * lib/stdlib.in.h: Tweak last commit.
> 
>   commit b7d7afe10ddf599452bd80b8a840c830cd474b09
>   Author: Bruno Haible 
>   Date:   Sun Jan 5 09:13:25 2020 +0100
> 
> tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.
> 
> Reported by Jim Meyering in
> .
> 
> * lib/stdlib.in.h (GNULIB_defined_canonicalize_file_name): New macro.
> (GNULIB_defined_ptsname_r): New macro.
> * tests/test-canonicalize.c (_GL_ARG_NONNULL): Define to empty.
> (main): Disable the NULL argument test if canonicalize_file_name does
> not come from gnulib.
> * tests/test-canonicalize-lgpl.c (_GL_ARG_NONNULL): Define to empty.
> (main): Disable the NULL argument test if canonicalize_file_name does
> not come from gnulib.
> * tests/test-ptsname_r.c (_GL_ARG_NONNULL): Define to empty.
> (test_errors): Disable the NULL argument test if ptsname_r does not come
> from gnulib.
> 
> since they fix a build failure caused by the gnulib tests failing
> on ppc64le, as reported in
> 
>   https://www.redhat.com/archives/libvir-list/2020-January/msg00616.html
> 
> Reported-by: Satheesh Rajendran 

Tested and build is working fine with these commit.

Regards,
-Satheesh

> Tracked-down-by: Bruno Haible 
> Signed-off-by: Andrea Bolognani 
> ---
> Note that I have not actually had the time to confirm this fixes
> the problem, or to reproduce it in the first place (I'll do that
> tomorrow). Either way, it's way too late for this to make it
> into v6.0.0; I'm mostly posting this so that the reporter can
> have a go at testing it in the meantime.
> 
>  .gnulib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.gnulib b/.gnulib
> index 7d06937892..611869be9f 16
> --- a/.gnulib
> +++ b/.gnulib
> @@ -1 +1 @@
> -Subproject commit 7d069378921bfa0d7c7198ea177aac0a2440016f
> +Subproject commit 611869be9f1083e53305446d90a2909fc89914ef
> -- 
> 2.24.1
> 


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



[libvirt] [PATCH] qemu: Refuse to use "ps2" on machines that do not have this bus

2020-01-15 Thread Thomas Huth
The "ps2" bus is only available on certain machines like x86. On
machines like s390x, we should refuse to add a device to this bus
instead of silently ignoring it.

Looking at the QEMU sources, PS/2 is only available if the QEMU binary
has the "i8042" device, so let's check for that and only allow "ps2"
devices if this QEMU device is available, or if we're on x86 anyway
(so we don't have to fake the QEMU_CAPS_DEVICE_I8042 capability in
all the tests that use  in their xml data).

Reported-by: Sebastian Mitterle 
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1763191
Signed-off-by: Thomas Huth 
---
 src/qemu/qemu_capabilities.c   |  2 ++
 src/qemu/qemu_capabilities.h   |  1 +
 src/qemu/qemu_domain.c | 10 +-
 tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml  |  1 +
 tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml|  1 +
 tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml|  1 +
 tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml|  1 +
 tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml|  1 +
 tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml|  1 +
 tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml   |  1 +
 tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml|  1 +
 tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml   |  1 +
 .../qemuhotplug-base-ccw-live+ccw-virtio.xml   |  6 --
 ...cw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml |  6 --
 ...ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml |  6 --
 .../qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml|  6 --
 ...-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml |  6 --
 ...plug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml |  6 --
 .../qemuhotplug-base-ccw-live-with-ccw-virtio.xml  |  6 --
 .../qemuhotplug-base-ccw-live.xml  |  6 --
 37 files changed, 38 insertions(+), 49 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 84c62a4e28..e22ef28662 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -553,6 +553,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
   "blockdev-file-dynamic-auto-read-only",
   "savevm-monitor-nodes",
   "drive-nvme",
+  "i8042",
 );
 
 
@@ -1244,6 +1245,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
 { "vhost-user-vga", QEMU_CAPS_DEVICE_VHOST_USER_VGA },
 { "ramfb", QEMU_CAPS_DEVICE_RAMFB },
 { "max-arm-cpu", QEMU_CAPS_ARM_MAX_CPU },
+{ "i8042", QEMU_CAPS_DEVICE_I8042 },
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 193c19fc81..c1ce590cab 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -534,6 +534,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for 
syntax-check */
 QEMU_CAPS_BLOCK_FILE_AUTO_READONLY_DYNAMIC, /* the auto-read-only property 
of block backends for files is dynamic */
 QEMU_CAPS_SAVEVM_MONITOR_NODES, /* 'savevm' handles monitor-owned nodes 
properly */
 QEMU_CAPS_DRIVE_NVME, /* -drive file.driver=nvme */
+QEMU_CAPS_DEVICE_I8042, /* PS/2 controller */
 
 QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index a6dde15bad..ada7d9b318 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8039,13 +8039,21 @@ qemuDomainDeviceDefValidateGraphics(const 
virDomainGraphicsDef *graphics,
 
 static int
 qemuDomainDeviceDefValidateInput(const virDomainInputDef *input,
- const virDomainDef *def G_GNUC_UNUSED,
+ const virDomainDef *def,
  virQEMUCapsPtr qemuCaps)
 {
 

Re: [libvirt] [PATCH 06/12] src: convert code to use new socket portability wrappers

2020-01-15 Thread Pavel Hrdina
On Fri, Jan 10, 2020 at 03:41:10PM +, Daniel P. Berrangé wrote:
> Convert to use socket wrappers. Aside from the header file
> include change, this requires changing close -> closesocket
> since our portability isn't trying to replace the close
> function.
> 
> Signed-off-by: Daniel P. Berrangé 
> ---
>  src/rpc/virnetsocket.c  | 34 +++---
>  src/util/virportallocator.c |  8 +++-
>  2 files changed, 26 insertions(+), 16 deletions(-)

I wonder if we should change all the remaining VIR_FORCE_CLOSE and
VIR_AUTOCLOSE related to sockets as well to be on a safe side.

Reviewed-by: Pavel Hrdina 


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list