[libvirt] [PATCH v2 0/4] qemu: Add support for -device hda-output (disable line-in)
by Filip Alac
Add support for hda 'output' codec for ich6 and ich9 sound devices,
which allow us to disable line-in for guest.
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1126641
v1:
https://www.redhat.com/archives/libvir-list/2018-May/msg01311.html
v2:
- Split patch into series of patches
- Add description of feature in docs/news.xml
- Improve the documentation in docs/formatdomain.html.in
- Fixes coding standard errors/inconsistencies
Filip Alac (4):
Add 'output' codec in docs, conf and xml2xmltest
qemu: Extend qemu_capabilities with 'hda-output'
qemu: Extend qemu_command with 'hda-output'
docs: news: Describe the 'output' codec
docs/formatdomain.html.in | 15 ++++++++++++---
docs/news.xml | 8 ++++++++
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 5 ++++-
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 +
.../qemucapabilitiesdata/caps_2.10.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_2.12.0.aarch64.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.aarch64.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 +
.../migration-in-params-in.xml | 1 +
.../migration-out-nbd-in.xml | 1 +
.../migration-out-nbd-out.xml | 1 +
.../migration-out-params-in.xml | 1 +
tests/qemustatusxml2xmldata/modern-in.xml | 1 +
tests/qemuxml2argvdata/sound-device.args | 2 ++
tests/qemuxml2argvdata/sound-device.xml | 2 ++
tests/qemuxml2argvtest.c | 1 +
tests/qemuxml2xmloutdata/sound-device.xml | 2 ++
36 files changed, 62 insertions(+), 5 deletions(-)
--
2.17.0
6 years, 6 months
[libvirt] [PATCH 00/12][v2] Introduce network-backed loader & nvram.
by Prerna Saxena
Libvirt domain XML today only allows local filepaths that can be
used to specify a loader element or its matching NVRAM disk.
Given that Vms may themselves move across hypervisor hosts, it should be
possible to allocate loaders/NVRAM disks on network storage for
uninterrupted access.
This series extends the firmware loader & NVRAM disks to be hosted over
network-backed disks, for high availability.
It achieves this by embedding virStorageSource elements for loader &
nvram into _virDomainLoaderDef, as discussed in
https://www.redhat.com/archives/libvir-list/2018-March/msg01721.html.
Currently, the source type is annotated by introducing a new attribute "backing" for both
'loader' and 'nvram' elements. Hence, a sample XML with new annotation looks like this:
<loader readonly='yes' type='pflash' backing='file'>
<source file='/usr/share/OVMF/OVMF_CODE.fd'/>
</loader>
<nvram backing='network'> <source protocol='iscsi' name='iqn.2013-07.com.example:iscsi-nopool/0'>
<host name='example.com' port='6000'/>
</source>
References:
----------
v0 / Proposal: https://www.redhat.com/archives/libvir-list/2018-March/msg01721.html.
v1 : https://www.redhat.com/archives/libvir-list/2018-April/msg02024.html
Changelog:
---------
Changes since v1:
1. Split up the patch into smaller units.
2. Added doc snippet & tests.
3. Changed the formatting code in patch 4 to format a domain's XML in
the style that was read.
I found that encryption seems to be a property of the storage volume.
I didnt include that in this series since it does not use backing type
as volume. Will include that later once the basic network support
patches get done.
Looking forward to feedback,
Prerna
Prerna Saxena (12):
Schema: Introduce XML schema for network-backed loader and nvram
elements.
Loader: Add a more elaborate definition.
Parse domain XML to generate virDomainLoaderDef & virDomainNvramDef.
Format the loader source appropriately.
Plumb the loader source into generation of QEMU command line.
Fix the domain def inference logic to correctly account for
network-backed pflash devices.
Bhyve: Fix command line generation to correctly pick up local loader
path.
virt-aa-helper: Adjust references to loader & nvram elements to
correctly parse the virStorageSource types.
Vbox: Adjust references to 'loader' and 'nvram' elements given that
these are now represented by virStorageSourcePtr.
Xen: Adjust all references to loader & nvram elements given that they
are now backed by virStorageSourcePtr
Test: Add a test snippet to evaluate command line generation for
loader/nvram specified via virStorageSource
Documentation: Add a blurb for the newly added XML snippets for loader
and nvram.
docs/formatdomain.html.in | 36 ++++-
docs/schemas/domaincommon.rng | 108 ++++++++++---
src/bhyve/bhyve_command.c | 6 +-
src/conf/domain_conf.c | 215 +++++++++++++++++++++++--
src/conf/domain_conf.h | 11 +-
src/qemu/qemu_cgroup.c | 13 +-
src/qemu/qemu_command.c | 21 ++-
src/qemu/qemu_domain.c | 31 ++--
src/qemu/qemu_driver.c | 7 +-
src/qemu/qemu_parse_command.c | 30 +++-
src/qemu/qemu_process.c | 42 +++--
src/security/security_dac.c | 6 +-
src/security/security_selinux.c | 6 +-
src/security/virt-aa-helper.c | 14 +-
src/vbox/vbox_common.c | 11 +-
src/xenapi/xenapi_driver.c | 4 +-
src/xenconfig/xen_sxpr.c | 19 ++-
src/xenconfig/xen_xm.c | 9 +-
tests/qemuxml2argvdata/bios-nvram-network.args | 31 ++++
tests/qemuxml2argvdata/bios-nvram-network.xml | 42 +++++
tests/qemuxml2argvtest.c | 1 +
21 files changed, 562 insertions(+), 101 deletions(-)
create mode 100644 tests/qemuxml2argvdata/bios-nvram-network.args
create mode 100644 tests/qemuxml2argvdata/bios-nvram-network.xml
--
1.8.1.2
6 years, 6 months
[libvirt] Fwd: Abandoning php-virt-control project
by Michal Novotny
>On Mon, May 21, 2018 at 11:05:13AM +0200, Michal Novotny wrote:
>> Hi Dan,
>> thanks and I completely understand. I was funding the domain name from my
>> own resources for several years already. If somebody is interested in
>> taking over the domain it would be great however if nobody is interested
>> the domain will expire and cease to exist. As already said I'm willing to
>> prolong the domain by 1 years till June 27 2019 but it would be nice if
>> somebody can take over the domain ownership and the funding. As far as I
>> know the project php-virt-control.org is basically an alias for the same
>> server hosting libvirt.org so just the domain cease to exist but the git
>> will still be available at [1].
>
> Yes, that's correct the git will always be available there, and it also
> gets auto-mirrored to both github and gitlab, so essentially it will
> exist forever.
>
Ok, I'm glad to hear that :-)
>> Is it worth it prolonging the domain by 1 year as mentioned above or
should
>> I let the domain expire if nobody is interested in taking it over
>> considering the fact it will still remain on the server?
> I'm terrible at making decisions like this - I still keep renewing domains
> for personal project's I've long since abandoned, because I hate the idea
> of domain squatters grabbing them and extorting money :-(
>
> Since I've not seen anyone actively sending patches for php-virt-control,
> I fear you're unlikely to see anyone volunteer to take the domain name.
> I guess you've got a month still you can wait though for anyone to take
> interest until you need to decide.
You are most likely right about that. Maybe it' s better to let the domain
expire in one month if nobody takes it over because the project will still
exist on the libvirt.org site. That said I won't prolong the domain name
anymore and I'll let it expire if nobody is interested in taking over the
domain.
Regards,
Michal
>
>
> 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
:|
6 years, 6 months
[libvirt] Abandoning php-virt-control project
by Michal Novotny
Hi,
since I'm pretty busy last few months and I didn't do any commit to the
php-virt-control project [1] for a pretty long time it's time to hand over
this project to somebody that is interested in continuing the project so
please if anyone is interested please tell me.
It's essentially the PHP binding to the libvirt virtualization API so you
can check the php-virt-control website however I no longer have access to
the site and I think Dan P. Berrange (CC'ed) owns this server so he can
grant access to the server hosting the project.
It would be a pitty if this project dies entirely when I'm no longer having
any time for the project as I've been receiving many replies of people
liking the project.
Also I'm the owner of the domain ([1]) and it expires on June 27 2018.
Although I'm willing to prolong the domain by 1 year (till June 27 2019) it
would be nice if I can also hand over the domain to somebody else.
Please tell me if you're interested in taking over the project and/or the
domain so we could faciliate the change (usually by domain ownership
transfer done by link going to my mailbox).
Thanks,
Michal
[1] http://php-virt-control.org/
6 years, 6 months
[libvirt] [PATCH 0/8] Fix some issues with rng grammar for output XML's
by John Ferlan
The storagevol, capability, and nodedev output grammar files had
some issues. Details noted in each patch.
John Ferlan (8):
schema: Add physical sizing grammer for storagevol grammar
schema: Remove xenmigr from host migrate transport capability
schema,tests: Use vpxmigr for host migrate transport capability
schema: Add rdma for host migrate transport capability
schema: Add vzmigr for host migrate transport capability
schema: Add microcode to capability grammar
schema: Fix capability grammar for pagesElem
schema: Add missing block data for nodedev
docs/schemas/capability.rng | 42 +++++++++++++++++++++++++++++-------------
docs/schemas/nodedev.rng | 13 +++++++++++++
docs/schemas/storagevol.rng | 5 +++++
tests/vmx2xmltest.c | 2 +-
4 files changed, 48 insertions(+), 14 deletions(-)
--
2.14.3
6 years, 6 months
[libvirt] [PATCH] spec: Fix build without QEMU
by Jiri Denemark
libvirt_qemu_probes.stp is only generated when QEMU driver is enabled.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
libvirt.spec.in | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 9ea5e6b32a..0e4a84c98c 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1412,8 +1412,11 @@ mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} libvirt-docs
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \
$RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes-64.stp
+
+ %if %{with_qemu}
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
$RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes-64.stp
+ %endif
%endif
%check
@@ -1994,8 +1997,10 @@ exit 0
%{_bindir}/virt-host-validate
%{_datadir}/systemtap/tapset/libvirt_probes*.stp
-%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
%{_datadir}/systemtap/tapset/libvirt_functions.stp
+%if %{with_qemu}
+%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
+%endif
%if %{with_bash_completion}
%{_datadir}/bash-completion/completions/virsh
--
2.17.0
6 years, 6 months
[libvirt] [PATCH] Remove type_sep parameter from qemuBuildHostNetStr
by Ján Tomko
The last caller not passing a comma was removed by:
commit ad8a7c4f8599bd58608500a72cdfec18a6bf2318
Author: Ján Tomko <jtomko(a)redhat.com>
CommitDate: 2018-04-12 17:17:16 +0200
qemu: deprecate QEMU_CAPS_NETDEV
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_command.c | 28 +++++++++++-----------------
src/qemu/qemu_command.h | 1 -
src/qemu/qemu_hotplug.c | 2 +-
3 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f3724a766b..9da2d609e8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3546,7 +3546,6 @@ qemuBuildNicDevStr(virDomainDefPtr def,
char *
qemuBuildHostNetStr(virDomainNetDefPtr net,
virQEMUDriverPtr driver,
- char type_sep,
int vlan,
char **tapfd,
size_t tapfdSize,
@@ -3578,7 +3577,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
case VIR_DOMAIN_NET_TYPE_NETWORK:
case VIR_DOMAIN_NET_TYPE_DIRECT:
case VIR_DOMAIN_NET_TYPE_ETHERNET:
- virBufferAsprintf(&buf, "tap%c", type_sep);
+ virBufferAddLit(&buf, "tap,");
/* for one tapfd 'fd=' shall be used,
* for more than one 'fds=' is the right choice */
if (tapfdSize == 1) {
@@ -3596,30 +3595,26 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
break;
case VIR_DOMAIN_NET_TYPE_CLIENT:
- virBufferAsprintf(&buf, "socket%cconnect=%s:%d,",
- type_sep,
+ virBufferAsprintf(&buf, "socket,connect=%s:%d,",
net->data.socket.address,
net->data.socket.port);
break;
case VIR_DOMAIN_NET_TYPE_SERVER:
- virBufferAsprintf(&buf, "socket%clisten=%s:%d,",
- type_sep,
+ virBufferAsprintf(&buf, "socket,listen=%s:%d,",
net->data.socket.address ? net->data.socket.address
: "",
net->data.socket.port);
break;
case VIR_DOMAIN_NET_TYPE_MCAST:
- virBufferAsprintf(&buf, "socket%cmcast=%s:%d,",
- type_sep,
+ virBufferAsprintf(&buf, "socket,mcast=%s:%d,",
net->data.socket.address,
net->data.socket.port);
break;
case VIR_DOMAIN_NET_TYPE_UDP:
- virBufferAsprintf(&buf, "socket%cudp=%s:%d,localaddr=%s:%d,",
- type_sep,
+ virBufferAsprintf(&buf, "socket,udp=%s:%d,localaddr=%s:%d,",
net->data.socket.address,
net->data.socket.port,
net->data.socket.localaddr,
@@ -3627,7 +3622,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
break;
case VIR_DOMAIN_NET_TYPE_USER:
- virBufferAsprintf(&buf, "user%c", type_sep);
+ virBufferAddLit(&buf, "user,");
for (i = 0; i < net->guestIP.nips; i++) {
const virNetDevIPAddr *ip = net->guestIP.ips[i];
const char *prefix = "";
@@ -3649,12 +3644,11 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
break;
case VIR_DOMAIN_NET_TYPE_INTERNAL:
- virBufferAsprintf(&buf, "user%c", type_sep);
+ virBufferAddLit(&buf, "user,");
break;
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
- virBufferAsprintf(&buf, "vhost-user%cchardev=char%s,",
- type_sep,
+ virBufferAsprintf(&buf, "vhost-user,chardev=char%s,",
net->info.alias);
if (net->driver.virtio.queues > 1)
virBufferAsprintf(&buf, "queues=%u,",
@@ -8086,7 +8080,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
}
if (!(netdev = qemuBuildHostNetStr(net, driver,
- ',', -1,
+ -1,
NULL, 0, NULL, 0)))
goto error;
@@ -8387,7 +8381,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
if (qemuDomainSupportsNicdev(def, net)) {
if (!(host = qemuBuildHostNetStr(net, driver,
- ',', vlan,
+ vlan,
tapfdName, tapfdSize,
vhostfdName, vhostfdSize)))
goto cleanup;
@@ -8403,7 +8397,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
virCommandAddArgList(cmd, "-net", nic, NULL);
if (!(host = qemuBuildHostNetStr(net, driver,
- ',', vlan,
+ vlan,
tapfdName, tapfdSize,
vhostfdName, vhostfdSize)))
goto cleanup;
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 28bc33558b..bbbf152660 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -80,7 +80,6 @@ qemuBuildChrDeviceStr(char **deviceStr,
/* With vlan == -1, use netdev syntax, else old hostnet */
char *qemuBuildHostNetStr(virDomainNetDefPtr net,
virQEMUDriverPtr driver,
- char type_sep,
int vlan,
char **tapfd,
size_t tapfdSize,
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 1933a966e5..b35594be5f 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1120,7 +1120,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
}
if (!(netstr = qemuBuildHostNetStr(net, driver,
- ',', -1,
+ -1,
tapfdName, tapfdSize,
vhostfdName, vhostfdSize)))
goto cleanup;
--
2.16.1
6 years, 6 months
[libvirt] [PATCH] qemu: include kernel version in QEMU log file
by Daniel P. Berrangé
We currently print the libvirt and qemu version strings into the
per-guest logfile. It would be useful to know what kernel is running
too, so add that.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_process.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5b73a61962..174d932ae7 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -32,6 +32,8 @@
# include <sys/cpuset.h>
#endif
+#include <sys/utsname.h>
+
#include "qemu_process.h"
#include "qemu_processpriv.h"
#include "qemu_alias.h"
@@ -4283,17 +4285,21 @@ qemuLogOperation(virDomainObjPtr vm,
int qemuVersion = virQEMUCapsGetVersion(priv->qemuCaps);
const char *package = virQEMUCapsGetPackage(priv->qemuCaps);
char *hostname = virGetHostname();
+ struct utsname uts;
+
+ uname(&uts);
if ((timestamp = virTimeStringNow()) == NULL)
goto cleanup;
if (qemuDomainLogContextWrite(logCtxt,
- "%s: %s %s, qemu version: %d.%d.%d%s, hostname: %s\n",
+ "%s: %s %s, qemu version: %d.%d.%d%s, kernel: %s, hostname: %s\n",
timestamp, msg, VIR_LOG_VERSION_STRING,
(qemuVersion / 1000000) % 1000,
(qemuVersion / 1000) % 1000,
qemuVersion % 1000,
package ? package : "",
+ uts.release,
hostname ? hostname : "") < 0)
goto cleanup;
--
2.17.0
6 years, 6 months
[libvirt] [PATCH] set default seccompSandbox as 0 for qemu
by zhenwei pi
start qemu fail : qemu-system-x86_64: -sandbox on,obsolete=deny,
elevateprivileges=deny,spawn=deny,resourcecontrol=deny:
seccomp support is disabled
libvirt version : 4.3
qemu version : 2.12
reproducer : recompile qemu with ./configure --disable-seccomp, or
remove libseccomp package.
with default seccompSandbox -1, libvirt try to get config from qemu
cmdline. if qemu disables seccomp (or misses seccomp package), qemu
still reports sandbox help message. libvirt mistakens about qemu real
capability.
set default seccompSandbox as 0 in code, and still get user conf
from qemu.conf. if user wants to enable seccomp, he should check
qemu firstly, then use the right qemu.conf.
Signed-off-by: zhenwei pi <zhenwei.pi(a)youruncloud.com>
---
src/qemu/qemu_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 277ab83..d17b4b1 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -313,7 +313,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
cfg->keepAliveInterval = 5;
cfg->keepAliveCount = 5;
- cfg->seccompSandbox = -1;
+ cfg->seccompSandbox = 0;
cfg->logTimestamp = true;
cfg->glusterDebugLevel = 4;
--
2.7.4
6 years, 6 months
[libvirt] [PATCH v1] Loop through all resolved addresses in virNetSocketNewListenTCP
by Olaf Hering
Currently virNetSocketNewListenTCP bails out early under the following
conditions:
- the hostname resolves to at least one IPv4 and at least one IPv6
address
- the local interfaces have that one IPv4 address assigned, but not any
of the IPv6 addresses
- the local interfaces have just IPv6 link-local addresses
In this case the resolver returns not only the IPv4 addreses but also
IPv6. Binding the IPv6 address will obviously fail. But this terminates
the entire loop, even if binding to IPv4 succeeded.
To fix this error, just keep going and loop through all returned
addresses. In case none of the attempts to bind to some address
succeeded, try to report the appropriate error.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
src/rpc/virnetsocket.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 7087abec9c..0ee5e3604f 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -382,11 +382,8 @@ int virNetSocketNewListenTCP(const char *nodename,
#endif
if (bind(fd, runp->ai_addr, runp->ai_addrlen) < 0) {
- if (errno != EADDRINUSE) {
- virReportSystemError(errno, "%s", _("Unable to bind to port"));
- goto error;
- }
- addrInUse = true;
+ if (errno == EADDRINUSE)
+ addrInUse = true;
VIR_FORCE_CLOSE(fd);
runp = runp->ai_next;
continue;
@@ -409,14 +406,14 @@ int virNetSocketNewListenTCP(const char *nodename,
fd = -1;
}
- if (nsocks == 0 && familyNotSupported) {
- virReportSystemError(EAFNOSUPPORT, "%s", _("Unable to bind to port"));
- goto error;
- }
-
- if (nsocks == 0 &&
- addrInUse) {
- virReportSystemError(EADDRINUSE, "%s", _("Unable to bind to port"));
+ if (nsocks == 0) {
+ if (familyNotSupported)
+ errno = EAFNOSUPPORT;
+ else if(addrInUse)
+ errno = EADDRINUSE;
+ else
+ errno = EDESTADDRREQ;
+ virReportSystemError(errno, "%s", _("Unable to bind to port"));
goto error;
}
6 years, 6 months