[libvirt] [PATCH 0/3] vmx: add efi firmware attribute
by Pino Toscano
Use the recently added infrastructure for firmware autoselection, and
indicate which firmware is used by a VMware guest.
Pino Toscano (3):
vmx: convert firmware config for autoselection
vmx: write firmware back from autoselection
docs: document firmware attribute for VMware guests
docs/formatdomain.html.in | 5 ++++-
src/vmx/vmx.c | 20 ++++++++++++++++++++
tests/vmx2xmldata/vmx2xml-firmware-efi.vmx | 3 +++
tests/vmx2xmldata/vmx2xml-firmware-efi.xml | 18 ++++++++++++++++++
tests/vmx2xmltest.c | 2 ++
tests/xml2vmxdata/xml2vmx-firmware-efi.vmx | 11 +++++++++++
tests/xml2vmxdata/xml2vmx-firmware-efi.xml | 8 ++++++++
tests/xml2vmxtest.c | 2 ++
8 files changed, 68 insertions(+), 1 deletion(-)
create mode 100644 tests/vmx2xmldata/vmx2xml-firmware-efi.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-firmware-efi.xml
create mode 100644 tests/xml2vmxdata/xml2vmx-firmware-efi.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-firmware-efi.xml
--
2.20.1
5 years, 7 months
[libvirt] [PATCH] virErrorPreserveLast/virErrorRestore conversions
by Syed Humaid
As per the suggestions regarding the previous patch for virErrorPreserveLast
conversions, I have converted all instances to virErrorPreserveLast and
virErrorRestore.
Signed-off-by: Syed Humaid <syedhumaidbinharoon(a)gmail.com>
---
src/libvirt-domain.c | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index be5b1f6740..8eebb60a2e 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -2894,7 +2894,7 @@ virDomainMigrateVersion2(virDomainPtr domain,
_("domainMigratePrepare2 did not set uri"));
cancelled = 1;
/* Make sure Finish doesn't overwrite the error */
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
goto finish;
}
if (uri_out)
@@ -2909,7 +2909,7 @@ virDomainMigrateVersion2(virDomainPtr domain,
/* Perform failed. Make sure Finish doesn't overwrite the error */
if (ret < 0)
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
/* If Perform returns < 0, then we need to cancel the VM
* startup on the destination
@@ -2929,10 +2929,8 @@ virDomainMigrateVersion2(virDomainPtr domain,
VIR_ERROR(_("finish step ignored that migration was cancelled"));
done:
- if (orig_err) {
- virSetError(orig_err);
- virFreeError(orig_err);
- }
+ virErrorRestore(&orig_err);
+
VIR_FREE(uri_out);
VIR_FREE(cookie);
return ddomain;
@@ -3076,7 +3074,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
/* Begin already started a migration job so we need to cancel it by
* calling Confirm while making sure it doesn't overwrite the error
*/
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
goto confirm;
} else {
goto done;
@@ -3091,7 +3089,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
VIR_MIGRATE_PARAM_URI,
uri_out) < 0) {
cancelled = 1;
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
goto finish;
}
} else if (!uri &&
@@ -3100,7 +3098,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare3 did not set uri"));
cancelled = 1;
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
goto finish;
}
@@ -3136,7 +3134,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
/* Perform failed. Make sure Finish doesn't overwrite the error */
if (ret < 0) {
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
/* Perform failed so we don't need to call confirm to let source know
* about the failure.
*/
@@ -3222,7 +3220,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
* one we need to preserve it in case confirm3 overwrites
*/
if (!orig_err)
- orig_err = virSaveLastError();
+ virErrorPreserveLast(&orig_err);
confirm:
/*
@@ -3256,10 +3254,8 @@ virDomainMigrateVersion3Full(virDomainPtr domain,
}
done:
- if (orig_err) {
- virSetError(orig_err);
- virFreeError(orig_err);
- }
+ virErrorRestore(&orig_err);
+
VIR_FREE(dom_xml);
VIR_FREE(uri_out);
VIR_FREE(cookiein);
--
2.20.1
5 years, 7 months
[libvirt] [PATCH 00/12] tests: qemuxml2xml: add DO_TEST_CAPS*
by Cole Robinson
This series moves testInfoSetArgs and friends from qemuxml2argvtest.c
into testutilsqemu.c, so we can use them in qemuxml2xml and make
use of the CAPS handling. It will also make things easier to test
xml2xml failures for example if we wanted to.
Cole Robinson (12):
tests: qemuxml2xml: Break out testInfoSet*Paths
tests: qemuxml2xml: Add info->{in,out}file
tests: qemuxml2xml: Remove info->outActiveName
tests: qemuxml2argv: Add info->{in,out}file
tests: qemuxml2argv: add testInfoSetPaths
tests: qemuxml2argv: Rename testInfo* to testQemuInfo*
tests: Move testQemuInfo* to testutilsqemu
tests: add testQemuGetCapsLatest
tests: qemuxml2xml: Use struct testQemuInfo
tests: qemuxml2xml: Use testQemuInfoSetArgs
tests: qemuxml2xml: make GIC handling optional
tests: qemuxml2xml: Add DO_TEST_CAPS*
tests/qemuxml2argvdata/vhost-vsock.xml | 2 +-
tests/qemuxml2argvtest.c | 238 ++-----------
.../aarch64-os-firmware-efi.xml | 32 +-
tests/qemuxml2xmloutdata/os-firmware-bios.xml | 69 +++-
.../os-firmware-efi-secboot.xml | 69 +++-
tests/qemuxml2xmloutdata/os-firmware-efi.xml | 69 +++-
tests/qemuxml2xmltest.c | 313 ++++++++----------
tests/testutilsqemu.c | 181 ++++++++++
tests/testutilsqemu.h | 40 +++
9 files changed, 618 insertions(+), 395 deletions(-)
mode change 120000 => 100644 tests/qemuxml2xmloutdata/aarch64-os-firmware-efi.xml
mode change 120000 => 100644 tests/qemuxml2xmloutdata/os-firmware-bios.xml
mode change 120000 => 100644 tests/qemuxml2xmloutdata/os-firmware-efi-secboot.xml
mode change 120000 => 100644 tests/qemuxml2xmloutdata/os-firmware-efi.xml
--
2.21.0
5 years, 7 months
[libvirt] [PATCH] virSecurityDACRestoreChardevLabel: Restore UNIX sockets too
by Michal Privoznik
We're setting seclabels on unix sockets but never restoring them.
Surprisingly, we are in SELinux driver.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/security/security_dac.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 6f8ca8cd54..0adf71bed6 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -1457,13 +1457,25 @@ virSecurityDACRestoreChardevLabel(virSecurityManagerPtr mgr,
ret = 0;
break;
+ case VIR_DOMAIN_CHR_TYPE_UNIX:
+ if (!dev_source->data.nix.listen ||
+ (dev_source->data.nix.path &&
+ virFileExists(dev_source->data.nix.path))) {
+ /* Also label mode='bind' sockets if they exist,
+ * e.g. because they were created by libvirt
+ * and passed via FD */
+ if (virSecurityDACRestoreFileLabel(mgr, dev_source->data.nix.path) < 0)
+ goto done;
+ }
+ ret = 0;
+ break;
+
case VIR_DOMAIN_CHR_TYPE_NULL:
case VIR_DOMAIN_CHR_TYPE_VC:
case VIR_DOMAIN_CHR_TYPE_PTY:
case VIR_DOMAIN_CHR_TYPE_STDIO:
case VIR_DOMAIN_CHR_TYPE_UDP:
case VIR_DOMAIN_CHR_TYPE_TCP:
- case VIR_DOMAIN_CHR_TYPE_UNIX:
case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
case VIR_DOMAIN_CHR_TYPE_SPICEPORT:
case VIR_DOMAIN_CHR_TYPE_NMDM:
--
2.21.0
5 years, 7 months
[libvirt] Is qemu guestfwd working?
by Marc-André Lureau
Hi,
How is guestfwd working? I am testing with the following domain xml
snippet, which should let the guest connect to 10.0.2.1:4600
<channel type='unix'>
<source mode='connect' path='/tmp/guestfwd'/>
<target type='guestfwd' address='10.0.2.1' port='4600'/>
</channel>
If I have a domain with bridge networking, adding guestfwd isn't going
to work, unless I am missing something. Should libvirt prevent that?
But even if I use user networking, guestfwd will create a separate
netdev, which isn't connected to any peer (both at cold and hot plug
time)
How is it supposed to work?
thanks
--
Marc-André Lureau
5 years, 7 months
[libvirt] [PATCH v3] socket: allow wait=false for client socket
by Marc-André Lureau
Commit 767abe7 ("chardev: forbid 'wait' option with client sockets")
is a bit too strict. Current libvirt always set wait=false, and will
thus fail to add client chardev.
Make the code more permissive, allowing wait=false with client socket
chardevs. Deprecate usage of 'wait' with client sockets.
Fixes: 767abe7f49e8be14d29da5db3527817b5d696a52
Cc: Daniel P. Berrangé <berrange(a)redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
chardev/char-socket.c | 10 +++++++---
qemu-deprecated.texi | 5 +++++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 3916505d67..ebc1adb83e 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -1263,9 +1263,13 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock,
return false;
}
if (sock->has_wait) {
- error_setg(errp, "%s",
- "'wait' option is incompatible with "
- "socket in client connect mode");
+ warn_report("'wait' option is deprecated with "
+ "socket in client connect mode");
+ if (sock->wait) {
+ error_setg(errp, "%s",
+ "'wait' option is incompatible with "
+ "socket in client connect mode");
+ }
return false;
}
}
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 2219386769..842e71b11d 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -105,6 +105,11 @@ details.
The ``query-events'' command has been superseded by the more powerful
and accurate ``query-qmp-schema'' command.
+@subsection chardev client socket with 'wait' option (since 4.0)
+
+Character devices creating sockets in client mode should not specify
+the 'wait' field, which is only applicable to sockets in server mode
+
@section Human Monitor Protocol (HMP) commands
@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1)
--
2.21.0.313.ge35b8cb8e2
5 years, 7 months
[libvirt] [PATCH] tools: Reduce table width in virsh(1)
by Andrea Bolognani
The table included in the sample output for 'list --title' is
unnecessarily wide, which causes man to complain:
warning [p 8, 0.5i]: can't break line
Make the table narrower.
Spotted by Lintian (manpage-has-errors-from-man tag).
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
tools/virsh.pod | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index bb52de3eed..3196636825 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -545,10 +545,10 @@ I<--table> output.
Example:
B<virsh> list --title
- Id Name State Title
- --------------------------------------------------------------------------
- 0 Domain-0 running Mailserver 1
- 2 fedora paused
+ Id Name State Title
+ -------------------------------------------
+ 0 Domain-0 running Mailserver 1
+ 2 fedora paused
=item B<freecell> [{ [I<--cellno>] B<cellno> | I<--all> }]
--
2.20.1
5 years, 7 months
[libvirt] [PATCH] tools: Fix grammar
by Andrea Bolognani
Apparently "allow(s) to frobnicate" is not correct English, and
either "allow(s) one to frobnicate" or "allow(s) frobnicating"
should be used instead.
Spotted by Lintian (spelling-error-in-{binary,manpage} tags).
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
tools/virsh-domain.c | 3 ++-
tools/virsh.pod | 20 ++++++++++----------
tools/virt-admin.pod | 4 ++--
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index d99b9afda9..da57d96d1a 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -8313,7 +8313,8 @@ static const vshCmdInfo info_desc[] = {
.data = N_("show or set domain's description or title")
},
{.name = "desc",
- .data = N_("Allows to show or modify description or title of a domain.")
+ .data = N_("Allows setting or modifying the description or title of "
+ "a domain.")
},
{.name = NULL}
};
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 3196636825..afc1684db0 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -778,7 +778,7 @@ effect on the next boot.
New description or title message]
Show or modify description and title of a domain. These values are user
-fields that allow to store arbitrary textual data to allow easy
+fields that allow storing arbitrary textual data to allow easy
identification of domains. Title should be short, although it's not enforced.
(See also B<metadata> that works with XML based domain metadata.)
@@ -1303,7 +1303,7 @@ within a certain range. Specifying I<buf-size> will control how much data can
be simultaneously in-flight during the copy; larger values use more memory but
may allow faster completion (the default value is usually correct).
-I<--transient-job> allows to specify that the user does not require the job to
+I<--transient-job> allows specifying that the user does not require the job to
be recovered if the VM crashes or is turned off before the job completes. This
flag removes the restriction of copy jobs to transient domains if that
restriction is applied by the hypervisor.
@@ -1450,9 +1450,9 @@ bytes/s. Specifying a negative value is interpreted as an unsigned long
value or essentially unlimited. The hypervisor can choose whether to
reject the value or convert it to the maximum value allowed. Optionally a
scaled positive number may be used as bandwidth (see B<NOTES> above). Using
-I<--bytes> with a scaled value allows to use finer granularity. A scaled value
-used without I<--bytes> will be rounded down to MiB/s. Note that the
-I<--bytes> may be unsupported by the hypervisor.
+I<--bytes> with a scaled value permits a finer granularity to be selected.
+A scaled value used without I<--bytes> will be rounded down to MiB/s. Note
+that the I<--bytes> may be unsupported by the hypervisor.
=item B<domblkthreshold> I<domain> I<dev> I<threshold>
@@ -1876,7 +1876,7 @@ stats.
[I<--edit>] [I<uri>] [I<key>] [I<set>] [I<--remove>]
Show or modify custom XML metadata of a domain. The metadata is a user
-defined XML that allows to store arbitrary XML data in the domain definition.
+defined XML that allows storing arbitrary XML data in the domain definition.
Multiple separate custom metadata pieces can be stored in the domain XML.
The pieces are identified by a private XML namespace provided via the
I<uri> argument. (See also B<desc> that works with textual metadata of
@@ -2327,8 +2327,8 @@ either parameter is the same as not specifying that parameter.
=item B<screenshot> I<domain> [I<imagefilepath>] [I<--screen> B<screenID>]
Takes a screenshot of a current domain console and stores it into a file.
-Optionally, if hypervisor supports more displays for a domain, I<screenID>
-allows to specify which screen will be captured. It is the sequential number
+Optionally, if the hypervisor supports more displays for a domain, I<screenID>
+allows specifying which screen will be captured. It is the sequential number
of screen. In case of multiple graphics cards, heads are enumerated before
devices, e.g. having two graphics cards, both with four heads, screen ID 5
addresses the second head on the second card.
@@ -3392,8 +3392,8 @@ expected.
Change media of CDROM or floppy drive. I<path> can be the fully-qualified path
or the unique target name (<target dev='hdc'>) of the disk device. I<source>
-specifies the path of the media to be inserted or updated. Flag I<--block>
-allows to set the backing type in case a block device is used as media for the
+specifies the path of the media to be inserted or updated. The I<--block> flag
+allows setting the backing type in case a block device is used as media for the
CDROM or floppy drive instead of a file.
I<--eject> indicates the media will be ejected.
diff --git a/tools/virt-admin.pod b/tools/virt-admin.pod
index f06ee9247a..1ea6defa0e 100644
--- a/tools/virt-admin.pod
+++ b/tools/virt-admin.pod
@@ -149,8 +149,8 @@ libvirtd:///system is used.
=head1 DAEMON COMMANDS
-The following commands allow to monitor the daemon's state as well as directly
-change its internal configuration.
+The following commands allow one to monitor the daemon's state as well as
+directly change its internal configuration.
=over 4
--
2.20.1
5 years, 7 months
[libvirt] vcpupin reports bogus vcpu affinities
by Allen, John
For pinned vcpus, vcpupin will report inaccurate affinity values on machines
with high core counts (256 cores in my case). The problem is produced as
follows:
$ virsh vcpupin myguest 0 4
$ virsh vcpupin myguest 0
VCPU CPU Affinity
---------------------------
0 4,192,194,196-197
Running taskset on the qemu threads shows the correct affinity, so this seems
to be a reporting problem. Strangely, the value "192" is significant. If I pin
a cpu greater than 192, the problem no longer appears.
I believe the cause of the problem in my case is that in this case in
src/conf/domain_conf.c:virDomainDefGetVcpuPinInfoHelper:
...
if (vcpu && vcpu->cpumask)
bitmap = vcpu->cpumask;
...
vcpu->cpumask is "shortened" in that it is only long enough to contain the last
set bit in the mask. However, when we go to copy the mask to the buffer that is
returned, we use the masklen passed to the function which is the "full"
masklen with a bit for each cpu. So it seems virBitmapToDataBuf copies some
extra data past the end of the bitmask. Why the "192" value is always set and I
typically see similar bogus bits set is still unknown.
What is the function meant to assume in this case? Is it sane to assume that
the bitmask is the full length of the buffer here and it's the responsibility
of the setter of vcpu->cpumask to provide the length of the bitmap we're
expecting? Or should we assume that we may receive a shortened bitmask here and
expand the bitmask before copying to the buffer?
-John
5 years, 7 months