Re: [libvirt] [jenkins-ci PATCH] guests: Reduce boot delay for FreeBSD

2017-10-22 Thread Pavel Hrdina
On Fri, Oct 20, 2017 at 10:11:31PM +0200, Andrea Bolognani wrote:
> Set it to 1 second instead of the default 10 seconds. This brings
> it in line with Linux guests and makes boot faster.
> 
> Signed-off-by: Andrea Bolognani 
> ---
>  guests/tasks/base.yml | 7 +--
>  1 file changed, 5 insertions(+), 2 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] [PATCH] qemu_domain: Error out eariler when adding an IDE controller to a q35-based vm

2017-10-22 Thread Ján Tomko

s/eariler/earlier/ in the commit summary

On Sun, Oct 22, 2017 at 11:05:08PM +0800, Lin Ma wrote:

Signed-off-by: Lin Ma 
---
src/qemu/qemu_domain.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ece8ee7..120d31c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3975,10 +3975,18 @@ 
qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont,


This function is called when parsing every XML. Adding new errors here
could cause already existing machines (even though they aren't working)
disappear from libvirt.

qemuDomainDeviceDefValidate is called only for newly defined domains and
on domain startup, so the error from qemuBuildControllerDevStr can be
moved there.

Jan


}
break;

+case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
+if (qemuDomainIsQ35(def)) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+   _("IDE controllers are unsupported for q35 "
+ "machine type"));
+return -1;
+}
+break;
+
case VIR_DOMAIN_CONTROLLER_TYPE_SATA:


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

Re: [libvirt] [jenkins-ci PATCH] guests: Use OpenJDK 8 on Debian 8 too

2017-10-22 Thread Pavel Hrdina
On Fri, Oct 20, 2017 at 10:12:01PM +0200, Andrea Bolognani wrote:
> Signed-off-by: Andrea Bolognani 
> ---
>  guests/files/jessie-backports.preferences |  3 +++
>  guests/files/jessie-backports.sources |  1 +
>  guests/tasks/base.yml | 20 
>  guests/vars/mappings.yml  |  1 -
>  4 files changed, 24 insertions(+), 1 deletion(-)
>  create mode 100644 guests/files/jessie-backports.preferences
>  create mode 100644 guests/files/jessie-backports.sources

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] [PATCH v2 03/11] conf: Validate user supplied aliases

2017-10-22 Thread Ján Tomko

On Fri, Oct 20, 2017 at 04:52:13PM +0200, Michal Privoznik wrote:

They have to be unique within the domain. As usual, backwards
compatibility takes its price. In this particular situation we
have a device that is represented twice in a domain and so is its
alias.

Signed-off-by: Michal Privoznik 
---
src/conf/domain_conf.c   | 148 ++-
src/conf/domain_conf.h   |   5 ++
src/libvirt_private.syms |   1 +
src/qemu/qemu_driver.c   |   3 +
4 files changed, 155 insertions(+), 2 deletions(-)



ACK with the 'xmlopt' and 'parseFlags' arguments removed, see below:


diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 40fcbc7df..ad71e951b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5457,6 +5457,145 @@ virDomainDeviceDefValidateInternal(const 
virDomainDeviceDef *dev,
}


+struct virDomainDefValidateAliasesData {
+virHashTablePtr aliases;
+};
+
+
+static int
+virDomainDeviceDefValidateAliasesIterator(virDomainDefPtr def,
+  virDomainDeviceDefPtr dev,
+  virDomainDeviceInfoPtr info,
+  void *opaque)
+{
+struct virDomainDefValidateAliasesData *data = opaque;
+const char *alias = info->alias;
+
+if (!alias)
+return 0;
+
+/* Some crazy backcompat for consoles. */
+if (def->nserials && def->nconsoles &&
+def->consoles[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
+def->consoles[0]->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL 
&&
+dev->type == VIR_DOMAIN_DEVICE_CHR &&
+virDomainChrEquals(def->serials[0], dev->data.chr))
+return 0;
+
+if (virHashLookup(data->aliases, alias)) {
+virReportError(VIR_ERR_XML_ERROR,
+   _("non unique alias detected: %s"),
+   alias);
+return -1;
+}
+
+if (virHashAddEntry(data->aliases, alias, (void *) 1) < 0) {
+virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+   _("Unable to construct table of device aliases"));
+return -1;
+}
+
+return 0;
+}
+
+
+/**
+ * virDomainDefValidateAliases:
+ *
+ * Check for uniqueness of device aliases. If @aliases is not
+ * NULL return hash table of all the aliases in it.
+ *
+ * Returns 0 on success,
+ *-1 otherwise (with error reported).
+ */
+static int
+virDomainDefValidateAliases(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED,


xmlopt is unused here and all the other occurences in this patch.


+const virDomainDef *def,
+virHashTablePtr *aliases,
+unsigned int parseFlags)
+{
+struct virDomainDefValidateAliasesData data;
+int ret = -1;
+
+/* validate configuration only in certain places */
+if (parseFlags & VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)
+return 0;


This is checked from the virDomainDefValidateInternal path
before virDomainDefValidateInternal is even called.

And virDomainDeviceValidateAliasImpl always passes 0,
so this condition is redundant and 'parseFlags' can be dropped too.


+
+/* We are not storing copies of aliases. Don't free them. */
+if (!(data.aliases = virHashCreate(10, NULL)))
+goto cleanup;
+


Jan


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

Re: [libvirt] [PATCH v2 00/11] Never ending story of user supplied aliases

2017-10-22 Thread Ján Tomko

On Fri, Oct 20, 2017 at 04:52:10PM +0200, Michal Privoznik wrote:

v2 of:

https://www.redhat.com/archives/libvir-list/2017-October/msg00790.html

diff to v1:
- new patch 1/11 to address Pavel's findings
- reworked parsing so that the alias is set iff it follows the rules
- added some tests
- added news.xml entry

Michal Privoznik (11):
 qemu_alias: Be more tolerant if alias don't follow our format
 conf: Parse user supplied aliases
 conf: Validate user supplied aliases
 qemuDomainABIStabilityCheck: Check for memory aliases too
 qemuxml2argvdata: Drop device aliases
 qemuhotplugtest: Load active XML
 conf: Format alias even for inactive XMLs
 docs: Document user aliases
 qemu: Parse alias from inactive XMLs
 tests: Test user set aliases for qemu
 news: Document user aliases

docs/formatdomain.html.in  |  23 +++
docs/news.xml  |   9 ++
src/conf/domain_conf.c | 171 -
src/conf/domain_conf.h |   6 +
src/libvirt_private.syms   |   1 +
src/qemu/qemu_alias.c  |  22 +--
src/qemu/qemu_domain.c |  18 ++-
src/qemu/qemu_driver.c |   3 +
tests/qemuhotplugtest.c|   3 +-
.../qemuxml2argv-disk-cdrom-network-ftp.xml|   1 -
.../qemuxml2argv-disk-cdrom-network-ftps.xml   |   1 -
.../qemuxml2argv-disk-cdrom-network-http.xml   |   1 -
.../qemuxml2argv-disk-cdrom-network-https.xml  |   1 -
.../qemuxml2argv-disk-cdrom-network-tftp.xml   |   1 -
.../qemuxml2argv-usb-redir-filter.xml  |   1 -
.../qemuxml2argv-user-aliases.args |  71 +
.../qemuxml2argvdata/qemuxml2argv-user-aliases.xml | 140 +
tests/qemuxml2argvtest.c   |   5 +
.../qemuxml2xmlout-user-aliases.xml|   1 +
tests/qemuxml2xmltest.c|   2 +
20 files changed, 449 insertions(+), 32 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml
create mode 12 tests/qemuxml2xmloutdata/qemuxml2xmlout-user-aliases.xml



ACK series

Jan


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

[libvirt] [PATCH] Add output of local time when adding the option of "--pretty" for virsh domtime

2017-10-22 Thread ZhiPeng Lu
Add more human-friendly output of domain's system time.

Signed-off-by: ZhiPeng Lu 
Reviewed-by: Jiyun Fan 
---
 tools/virsh-domain-monitor.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 35d04b2..d9520ff 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -1384,17 +1384,22 @@ cmdDomTime(vshControl *ctl, const vshCmd *cmd)
 goto cleanup;
 
 if (pretty) {
-char timestr[100];
+char timestr[100], localtimestr[100];
 time_t cur_time = seconds;
-struct tm time_info;
+struct tm time_info, local_time_info;
 
 if (!gmtime_r(&cur_time, &time_info)) {
 vshError(ctl, _("Unable to format time"));
 goto cleanup;
 }
+if (!localtime_r(&cur_time, &local_time_info)) {
+vshError(ctl, _("Unable to format local time"));
+goto cleanup;
+}
 strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S", 
&time_info);
+strftime(localtimestr, sizeof(localtimestr), "%Y-%m-%d %H:%M:%S", 
&local_time_info);
 
-vshPrint(ctl, _("Time: %s"), timestr);
+vshPrint(ctl, _("Time: %s\n Local time: %s"), timestr, 
localtimestr);
 } else {
 vshPrint(ctl, _("Time: %lld"), seconds);
 }
-- 
1.8.3.1

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


[libvirt] [PATCH] qemu_domain: Error out eariler when adding an IDE controller to a q35-based vm

2017-10-22 Thread Lin Ma
Signed-off-by: Lin Ma 
---
 src/qemu/qemu_domain.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ece8ee7..120d31c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3975,10 +3975,18 @@ 
qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont,
 }
 break;
 
+case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
+if (qemuDomainIsQ35(def)) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+   _("IDE controllers are unsupported for q35 "
+ "machine type"));
+return -1;
+}
+break;
+
 case VIR_DOMAIN_CONTROLLER_TYPE_SATA:
 case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL:
 case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
-case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
 case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
 case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
 break;
-- 
2.9.2

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


Re: [libvirt] libvirt not wanting to read back its own interface XML

2017-10-22 Thread Marc Haber
Hi Guido,

I didn't mean to accuse Debian of doing a bad job with netcf.

On Sun, Oct 22, 2017 at 09:26:31AM +0200, Guido Günther wrote:
> On Thu, Oct 19, 2017 at 02:41:31PM +0200, Marc Haber wrote:
> > On Thu, Oct 19, 2017 at 01:37:45PM +0200, Michal Privoznik wrote:
> > > Aha! the thing is, you're using netcf backend while I'm using the udev
> > > one. This error message comes from netcf. It's a netcf's bug. CCing
> > > Laine who should know more.
> > 
> > Where can I read up about the different backends available? Is it a
> > compile-time setting or can I configure that on my system?
> > 
> > Actually, I'm doing the configuration outside of libvirt anyway (with
> > systemd-networkd), I just want the interface to be in virt-manager's
> > selection dropdown, so I don't care too much about netcf.
> 
> https://bugs.debian.org/cgi-bin/pkgreport.cgi?archive=0;dist=unstable;ordering=normal;repeatmerged=0;src=netcf
> 
> doesn't look that bad. Not following includes is troublesome (#875762) but
> shouldn't be too hard to fix. Can you file bugs for other issues you're
> seeing? This would make it simpler to decide whether we disable netcf
> support or fix the issues that are there.

It is just that I have configuring my networks in special ways for
nearly two decades, using the "manual" method of ifupdown way before it
was officially introduced into the Debian packages (#88948, sic!), and
am therefore used to other packages doing network configuration not
playing around pretty well on my systems.

And I have stopped using ifupdown entirely with jessie, and have
migrated over to systemd-networkd. My expertise with current ifupdown is
to limited to be of any use.

I would love to see systemd-networkd support for netcf, though.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

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

Re: [libvirt] libvirt not wanting to read back its own interface XML

2017-10-22 Thread Guido Günther
Hi Marc,
On Thu, Oct 19, 2017 at 02:41:31PM +0200, Marc Haber wrote:
> On Thu, Oct 19, 2017 at 01:37:45PM +0200, Michal Privoznik wrote:
> > Aha! the thing is, you're using netcf backend while I'm using the udev
> > one. This error message comes from netcf. It's a netcf's bug. CCing
> > Laine who should know more.
> 
> Where can I read up about the different backends available? Is it a
> compile-time setting or can I configure that on my system?
> 
> Actually, I'm doing the configuration outside of libvirt anyway (with
> systemd-networkd), I just want the interface to be in virt-manager's
> selection dropdown, so I don't care too much about netcf.

https://bugs.debian.org/cgi-bin/pkgreport.cgi?archive=0;dist=unstable;ordering=normal;repeatmerged=0;src=netcf

doesn't look that bad. Not following includes is troublesome (#875762) but
shouldn't be too hard to fix. Can you file bugs for other issues you're
seeing? This would make it simpler to decide whether we disable netcf
support or fix the issues that are there.
Cheers,
 -- Guido

> 
> Greetings
> Marc
> 
> -- 
> -
> Marc Haber | "I don't trust Computers. They | Mailadresse im Header
> Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
> Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 

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