Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new config hook #1577

Merged
merged 12 commits into from
Jan 17, 2025
Merged

Add new config hook #1577

merged 12 commits into from
Jan 17, 2025

Conversation

bensmrs
Copy link
Contributor

@bensmrs bensmrs commented Jan 16, 2025

Closes #1400

Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
@bensmrs bensmrs requested a review from stgraber as a code owner January 16, 2025 18:19
@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API labels Jan 16, 2025
@bensmrs
Copy link
Contributor Author

bensmrs commented Jan 16, 2025

And obviously I forgot to fix the tests :)

@bensmrs bensmrs force-pushed the qemu-scriptlet-config branch from 1159c52 to 1a431a4 Compare January 16, 2025 20:20
@bensmrs
Copy link
Contributor Author

bensmrs commented Jan 16, 2025

Phew that linter is very conservative!

Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
@bensmrs bensmrs force-pushed the qemu-scriptlet-config branch from 1a431a4 to a85a512 Compare January 16, 2025 21:04
@stgraber
Copy link
Member

Looks good and was pretty easy to review thanks to how the commits were split.

Only nit is around those marshal/unmarshal and temporary config type in the scriptlet package.
I think it'd be better to them be part of the cfg package, but if that's impractical, then they should at least mention qemu in their name so someone looking at what's in the scriptlet package doesn't get confused.

@bensmrs
Copy link
Contributor Author

bensmrs commented Jan 17, 2025

but if that's impractical

It’s not, but the values marshalConf give and unmarshalConf take are a bit… wonky.
I’m not a huge fan of map[string]any values wandering through code for anything other than serialization. Here, any means either string or []string, which are very different to type-assert and deal with.
Also I don’t see why anyone would use these functions anywhere else when we have nicely typed structs.

they should at least mention qemu in their name

qemuMarshalConf, marshalQemuConf, or marshalQEMUConf? I prefer the 3rd.

@stgraber
Copy link
Member

qemuMarshalConf, marshalQemuConf, or marshalQEMUConf? I prefer the 3rd.

Yeah, 3rd is fine with me.

Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
@bensmrs bensmrs force-pushed the qemu-scriptlet-config branch from a85a512 to be7d5f3 Compare January 17, 2025 21:19
@stgraber stgraber enabled auto-merge January 17, 2025 21:58
@stgraber stgraber merged commit 5220686 into lxc:main Jan 17, 2025
36 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 28, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [lxc/incus](https://github.com/lxc/incus) | minor | `v6.8.0` -> `v6.9.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>lxc/incus (lxc/incus)</summary>

### [`v6.9.0`](https://github.com/lxc/incus/releases/tag/v6.9.0): Incus 6.9

[Compare Source](lxc/incus@v6.8.0...v6.9.0)

#### What's Changed

-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#1506
-   Refactor scriptlet loader and improve checks by [@&#8203;bensmrs](https://github.com/bensmrs) in lxc/incus#1507
-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#1511
-   incusd/storage/drivers: Force blkdiscard and ignore errors by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1513
-   incusd/auth: fix FGA online data race by [@&#8203;breml](https://github.com/breml) in lxc/incus#1515
-   incusd/storage/drivers: Log on blkdiscard failure by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1517
-   Fix issue with live-migration between storage pools by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#1518
-   Add uplink addresses for OVN network by [@&#8203;winiciusallan](https://github.com/winiciusallan) in lxc/incus#1512
-   Add `--description` flag to create type CLI commands by [@&#8203;luissimas](https://github.com/luissimas) in lxc/incus#1498
-   client: Propagate HTTP TLS dialer to websocket by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1519
-   Fix QEMU scriptlet parameter name by [@&#8203;bensmrs](https://github.com/bensmrs) in lxc/incus#1524
-   Add shell.nix by [@&#8203;MadnessASAP](https://github.com/MadnessASAP) in lxc/incus#1526
-   client: add proxy host to skopoe inspect by [@&#8203;winiciusallan](https://github.com/winiciusallan) in lxc/incus#1525
-   incusd/cluster: Add missing error handling by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1528
-   incusd/instance/qemu: Fix QMP arguments typing by [@&#8203;bensmrs](https://github.com/bensmrs) in lxc/incus#1531
-   Encode mc alias for storage buckets to match allowed characters by [@&#8203;monkz](https://github.com/monkz) in lxc/incus#1535
-   doc: Contributing section restructuring by [@&#8203;bensmrs](https://github.com/bensmrs) in lxc/incus#1534
-   internal/server: allow creation of OVN network with no uplink by [@&#8203;winiciusallan](https://github.com/winiciusallan) in lxc/incus#1533
-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#1540
-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#1541
-   lxd-to-incus: Clear volatile.uuid from instances by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1546
-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#1548
-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#1550
-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#1551
-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#1553
-   Tweak Github Actions and add arm64 tests by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1555
-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#1556
-   incusd/networks: Tweak dnsmasq startup condition by [@&#8203;alex14641](https://github.com/alex14641) in lxc/incus#1544
-   Tweak namespace attach logic in forkproxy and forkfile by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1557
-   Expand block reset logic by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1560
-   Discard blocks on LVM resize by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1561
-   incusd/storage/lvm: Run ClearBlock on all new thick block volumes by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1565
-   Improve format flag by [@&#8203;breml](https://github.com/breml) in lxc/incus#1564
-   devcontainer: initial version by [@&#8203;breml](https://github.com/breml) in lxc/incus#1566
-   incusd/network/ovn: Skip remote peers when iterating peer networks by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1568
-   Fix discard logic on LVM resize and optimize image unpacking by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1569
-   incusd/main_cluster: Tweak to have help refer to correct command name by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1576
-   Docs: Fixed link to point to correct manpage. by [@&#8203;foxtrotcz](https://github.com/foxtrotcz) in lxc/incus#1581
-   incusd/device/disk: Better handle partitions by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1578
-   incusd/storage/drivers: Handle 4k sector sizes by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1585
-   lxd-to-incus: Be more lenient on database changes by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1582
-   incusd/dnsmasq: Don't put the project name in the DNS record by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1586
-   Remove virtfs-proxy-helper dependency by [@&#8203;bensmrs](https://github.com/bensmrs) in lxc/incus#1547
-   Add new `config` hook by [@&#8203;bensmrs](https://github.com/bensmrs) in lxc/incus#1577
-   github: Switch to Github's hosted arm64 runners by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1589
-   Support for ACLs for bridge NIC device when using nftables driver by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1587
-   doc: typo by [@&#8203;eebssk1](https://github.com/eebssk1) in lxc/incus#1591
-   Added unit for minimum ZFS blocksize by [@&#8203;Spitfireap](https://github.com/Spitfireap) in lxc/incus#1593
-   incus/file/pull: Port to SFTP by [@&#8203;HassanAlsamahi](https://github.com/HassanAlsamahi) in lxc/incus#1592
-   incusd/device/disk: Update correct mount options by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1594
-   doc: Force white background for swagger API by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1599
-   Implement a VM memory dump API by [@&#8203;SpiffyEight77](https://github.com/SpiffyEight77) in lxc/incus#1596
-   gomod: Update dependencies by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1600
-   incus/init: Add support for storage volumes in preseed init by [@&#8203;megheaiulian](https://github.com/megheaiulian) in lxc/incus#1595
-   incusd/instance/qemu: Fix device_id warning on 9.2.x by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1601
-   incus: Fix example description for debug dump-memory command by [@&#8203;SpiffyEight77](https://github.com/SpiffyEight77) in lxc/incus#1602

#### New Contributors

-   [@&#8203;winiciusallan](https://github.com/winiciusallan) made their first contribution in lxc/incus#1512
-   [@&#8203;luissimas](https://github.com/luissimas) made their first contribution in lxc/incus#1498
-   [@&#8203;MadnessASAP](https://github.com/MadnessASAP) made their first contribution in lxc/incus#1526
-   [@&#8203;monkz](https://github.com/monkz) made their first contribution in lxc/incus#1535
-   [@&#8203;alex14641](https://github.com/alex14641) made their first contribution in lxc/incus#1544
-   [@&#8203;foxtrotcz](https://github.com/foxtrotcz) made their first contribution in lxc/incus#1581
-   [@&#8203;eebssk1](https://github.com/eebssk1) made their first contribution in lxc/incus#1591
-   [@&#8203;Spitfireap](https://github.com/Spitfireap) made their first contribution in lxc/incus#1593
-   [@&#8203;megheaiulian](https://github.com/megheaiulian) made their first contribution in lxc/incus#1595

**Full Changelog**: lxc/incus@v6.8.0...v6.9.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMzcuMiIsInVwZGF0ZWRJblZlciI6IjM5LjEzNy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Development

Successfully merging this pull request may close these issues.

Allow QEMU scriptlets to read VM structs and edit QEMU config
2 participants