IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
This wires up the guest.convert_to_vnc function to command line,
and documents it.
There's one suboption `qemu-vdagent=on|off`, defaulting to `off`
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Wire up guest.convert_to_q35 to the CLI. We add one suboptions,
`num_pcie_root_ports=X`, matching the pre-existing
`--controller num_pcie_root_ports=X` option
Nothing fancy here. See man page docs for details
Signed-off-by: Cole Robinson <crobinso@redhat.com>
We can make `--xml` fit the common xml cli option paradigm, which
less us drop a whole bunch of special handling in virt-xml
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Adjust cli.py `run_parser` and similar functions to take the
parservalue directly, rather than passing in the whole `options`
structure.
This makes it easier to reason about what the virt-xml action
functions are actually working with.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This adds an Action class which is a container for (most) of the
data we need to perform a virt-xml operation. Basically an instance
of the class represents a pairing like
--edit 1 --disk path=/foo or
--add-device --network wibble,model=virtio
etc
This is a functional no-op, but it moves the code closer to
an architecture that will allow us to perform multiple actions
with a single virt-xml command.
While doing this, we centralize most of the cli validation that is
scattered around, since it's now easier to do it in one place.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Move the validation functions out from amongst the functional XML
editing code, and into their own section. We will be adding more
code alongside in future patches.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This reverts b34ae0d0c8 and
1fef5d8661.
Playing with this some more I found some deeper problems. For example
```console
[:~/src/virt-manager] (main) $ ./virt-xml test-for-virtxml --connect test://`pwd`/tests/data/testdriver/testsuite.xml --print-diff --edit 1 --video model=FOO --edit 2 --sound model=BAR
--- Original XML
+++ Altered XML
@@ -180,14 +180,14 @@
<graphics type="vnc" port="-1" autoport="yes">
<listen type="address"/>
</graphics>
- <sound model="sb16"/>
+ <sound model="BAR"/>
<sound model="es1370"/>
<sound model="ich6"/>
<video>
<model type="vmvga" vram="16384" heads="1" primary="yes"/>
</video>
<video>
- <model type="cirrus" vram="16384" heads="3"/>
+ <model type="FOO" vram="16384" heads="3"/>
</video>
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
```
There's other weirdness too, though it's mostly strange plays on previous weird behavior
* `--edit --video model=vga --edit --sound model=ich9 --video model=qxl` works
* `--add-device --sound model=foo --video model=bar` was previously rejected but now works
* `--remove-device --video model=vmvga --sound model=sb16` was previously rejected by now works
Fixing all this is not trivial. So I think we need to revert and go back to the drawing board.
We are about to change the some defaults around os handling. Let's
start recommending the nicer named --osinfo more, since new error
messages are going to promote it a bit as well
Signed-off-by: Cole Robinson <crobinso@redhat.com>
The canonical tool for this is `osinfo-query os`, which we still
reference in the man pages and in the list output.
However, we are about to make missing --os-variant fatal for common
usage, and I don't want to force users to install an extra tool just
to figure out what an acceptable --os-variant value is.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
For example, if both hotplugging and defining a new NIC, where we
generate the mac address, we need to use the initial generated device
XML for both operations, and not generate different MAC addresses
for each stage.
Resolves: https://github.com/virt-manager/virt-manager/issues/305
Signed-off-by: Cole Robinson <crobinso@redhat.com>
The libvirt test driver doesn't support hotplug. Add an env variable
to ignore failure, so we can get better test coverage here
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Fix a regression introduced by commit 71f034d6b where
format string expects kwarg "domain", but "vm" is passed instead.
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Make use of the new helper for showing a standard error message for two
conflicting cli options. This also catches one untranslatable message.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Do not use the action string (which is an identifer) as replaced
placeholder in messages for device hotplug/hotunplug/update.
Instead, use complete strings for all the actions, and also for all the
usages (confirmation message, success message, error message).
Since the action is the same for all the devices, create the messages
outside the iteration to avoid translating them more than once.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This adds the following --os-variant suboptions
* name=, short-id=
* id=
* detect=on|off
Functionally this does not change behavior, just adds explicit
sub options for behavior we already support
Signed-off-by: Cole Robinson <crobinso@redhat.com>
The --xml option allows users to request raw XML edits to virt-install
or virt-xml generated XML. This gives users a bit of a workaround
incase we don't have proper support for some XML property. The --xml
option can gain more features in the future if it makes sense, like
setting XML namespaces for example.
Basic usage is like: virt-install --xml ./@foo=bar ...
Which will change the generated <domain> XML to have
<domain foo='bar' ...
virt-xml works similarly. It can only be combined with --edit currently.
This only works with xpaths rooted against the entire document.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This is a quirk of libvirt that the first <device> is usually a
logical duplicate of the first <serial> device. Adjust virt-xml to
understand this quirk and remove both devices at the same time,
like we already do in virt-manager
https://bugzilla.redhat.com/show_bug.cgi?id=1685541
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Do not split the error messages and the error details, but rather use a
single string with proper placeholders. This avoids string puzzles.
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This layout is closer to what most python modules have nowadays.
It also simplifies testing and static analysis setup.
Keep virt-* wrappers locally, for ease of running these commands
from a git checkout.
Adjust the wrapper binaries we install on via packaging to be
pure python, which makes things like running gdb easier.
Signed-off-by: Cole Robinson <crobinso@redhat.com>