summaryrefslogtreecommitdiffstats
path: root/src/vmspawn (follow)
Commit message (Collapse)AuthorAgeFilesLines
* path-lookup: modernize runtime_directory() tooMike Yuan2024-10-061-3/+3
|
* path-lookup: deduplicate xdg_user_*() with sd_path_lookup()Mike Yuan2024-10-061-1/+1
| | | | While at it, place ret param at last.
* tree-wide: use strv_extend_strv_consume() where appropriateMike Yuan2024-09-211-7/+4
|
* tree-wide: make sigprocmask() changes more automaticLennart Poettering2024-09-131-1/+1
| | | | | | | | | | | | | This tries to get rid of most manual sigprocmask() changes, in favour of: 1. The SD_EVENT_SIGNAL_PROCMASK flag to sd_event_add_signal() 2. The sd_event_set_signal_exit() call for handling SIGTERM/SIGINT 3. Move masking of SIGWINCH into ptyfwd, out of nspawn/vmspawn/run And while we are at it get rid of a bunch of event source fields whose lifetime is bound to the sd_event object they belong to anyway, and make use of the "floating" event source feature of sd-event instead.
* vmspawn: fix duplicate logging on oomLennart Poettering2024-08-271-1/+1
|
* tree-wide: use isatty_safe() moreLennart Poettering2024-08-201-1/+2
|
* vmspawn: fix typoYu Watanabe2024-08-021-1/+1
| | | | Follow-up for 862c68a914ab4561d83875e58e05dcf65cb4a551.
* vmspawn: check overflow earlierYu Watanabe2024-08-011-3/+3
| | | | | Follow-up for 862c68a914ab4561d83875e58e05dcf65cb4a551. Fixes CID#1550749.
* vmspawn: make "-n" just workLennart Poettering2024-07-191-2/+2
| | | | | | | | The tap network device should be called "vt-", so that that the 80-vm-vt.network file we ship by default actually matches against it. Also, turn off any qemu callout stuff, networkd is smart enough to handle all this on its own, without ugly callouts.
* sd-varlink: make our internal Varlink API public as sd-varlink.[ch]Lennart Poettering2024-07-161-3/+4
| | | | | | | | | | It's time. sd-json was already done earlier in this cycle, let's now make sd-varlink public too. This is mostly just a search/replace job of epical proportions. I left some functions internal (mostly IDL handling), and I turned some static inline calls into regular calls.
* vmspawn: get rid of an unnecessary local variableLennart Poettering2024-07-121-7/+3
|
* vmspawn: rework how AF_VSOCK/SOCK_STREAM notifications are readLennart Poettering2024-07-121-42/+97
| | | | | | | | | Stream sockets are stream sockets, i.e. they won#t give us the full data right-away, we must buffer locally and read until we hit EOF. Hence do so. moreover, make sure to close the fd once we are done, otherwise the sender might block on us.
* vmspawn: define default machines for mips targetsHenry Chen2024-07-081-0/+2
| | | | | | | All mips variants of qemu-system default to malta. Signed-off-by: Henry Chen <henry.chen@oss.cipunited.com> Signed-off-by: Henry Chen <chenx97@aosc.io>
* Merge pull request #33370 from grawity/run-titleZbigniew Jędrzejewski-Szmek2024-06-281-0/+3
|\ | | | | run: add option to prevent the setting of terminal title
| * run: move condition inside set_window_title()Mantas Mikulėnas2024-06-251-2/+4
| |
| * nspawn, vmspawn: honor the new window title switchMantas Mikulėnas2024-06-251-1/+2
| |
* | Merge pull request #33042 from poettering/machined-unprivLuca Boccassi2024-06-243-6/+23
|\ \ | | | | | | machined: unprivileged machine registration
| * | vmspawn: by default, let machined register a cgroup for VMsLennart Poettering2024-06-213-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | This mimics what we do in nspawn: if registration is enabled we'll let machined allocate a scope unit for us. When --keep-unit is used we'll register without creating a new scope. This brings behaviour more inline with what nspawn does, exposing the same sets of options.
| * | machined: allow unprivileged registration of VMs/containersLennart Poettering2024-06-212-4/+2
| |/ | | | | | | | | | | Now that we have a concept of unprivileged VMs and containers, let's allow unprivileged clients to register with machined too – subject to Polkit permissions.
* / vmspawn: define QEMU_MACHINE_TYPE for loongarch64Robin Lee2024-06-241-1/+1
|/ | | | Use ["virt"](https://www.qemu.org/docs/master/system/loongarch/virt.html) as a commonly used generic platform on loongarch64.
* tree-wide: port over to new builder apisLennart Poettering2024-06-191-11/+11
|
* vmspawn: define QEMU_MACHINE_TYPE for riscvXeonacid2024-06-191-1/+1
| | | Use ["virt"](https://www.qemu.org/docs/master/system/target-riscv.html#board-specific-documentation) as a commonly used generic platform on riscv.
* various: move const ptr indicator to return valueZbigniew Jędrzejewski-Szmek2024-06-192-3/+3
|
* vmspawn: report "systemd-vmspawn" as "service" to machinedLennart Poettering2024-06-141-1/+1
| | | | | | | | The "service" field that one is supposed to pass to machine is supposed to indicate the implementation of the client, not the service unit the client runs in (which is typically even a scope unit, not a system unit). Hence fix that, and make it closely match what systemd-nspawn does.
* libsystemd: turn json.[ch] into a public APILennart Poettering2024-06-122-43/+46
| | | | | | | | | | | | | | | This is preparation for making our Varlink API a public API. Since our Varlink API is built on top of our JSON API we need to make that public first (it's a nice API, but JSON APIs there are already enough, this is purely about the Varlink angle). I made most of the json.h APIs public, and just placed them in sd-json.h. Sometimes I wasn't so sure however, since the underlying data structures would have to be made public too. If in doubt I didn#t risk it, and moved the relevant API to src/libsystemd/sd-json/json-util.h instead (without any sd_* symbol prefixes). This is mostly a giant search/replace patch.
* vmspawn: use openpt_allocate where appropriateMike Yuan2024-05-191-9/+2
|
* machined: return recognizable error when we try to register the same machine ↵Lennart Poettering2024-05-131-1/+0
| | | | name twice
* varlink: rename vsockCid → vSockCid fieldLennart Poettering2024-05-131-1/+1
|
* vmspawn: fix finding systemd-journal-remote binaryYu Watanabe2024-05-101-1/+9
| | | | | | Follow-up for 258d26940fb6bfa1b5b8acf03cc4a37f2657e4ac. Fixes https://github.com/systemd/systemd/pull/31218#discussion_r1596168449.
* vmspawn: trivial cleanups for start_systemd_journal_remote()Yu Watanabe2024-05-101-4/+5
| | | | | - prefix argument for storing result with 'ret_', - align arguments for strv_new().
* vmspawn: forward signals to VM PID 1 via D-BUS when availableSam Leonard2024-05-091-4/+132
| | | | | Allow to gracefully shutdown by initiating the operation from the guest
* vmspawn: register with io.systemd.Machine.RegisterSam Leonard2024-05-093-25/+80
| | | | | When available, use varlink to register the VM, so that we can talk over SSH to the guest. Enables 'machinectl shell' for vmspawn guests.
* vmspawn: add a dropin override to sshd-vsock@.serviceSam Leonard2024-05-091-0/+12
|
* vmspawn: indentationZbigniew Jędrzejewski-Szmek2024-05-082-19/+19
|
* nspawn, vmspawn, run0: add env var for turning off background tintingLennart Poettering2024-05-021-1/+1
| | | | | | | Some people are just sad, sad lost souls who don't like even the tiniest ray of color in their life. Let's add an env var knob for allowing them to turn the background tinting off, to drive the last bit of color from their life so that they can stay in their grey grey life.
* vmspawn: enable vmgenid for all VMsLennart Poettering2024-04-201-0/+18
| | | | | | | | | | This passes an ID derived from the vmgenid down to all VMs. This is useful to have an identifier for this VM generation id. We derive it from the invocation ID, if we have one, otherwise we randomize it. Eventually we should make use of the vmgenid changing to re-acquire MAC addresses, DHCP leases as such. Let's for now enable the VMM side of the concept as first step towards that.
* vmspawn: add env var that can extend the qemu cmdlineLennart Poettering2024-04-201-0/+12
| | | | | This is a bit hackish, but really useful sometimes to play around with some qemu switches.
* vmspawn: enable hyperv enlightenmentsLennart Poettering2024-04-201-1/+7
| | | | | | | THese are generally recommended (and libvirt/gnome-boxes default to them hence). They are mostly relevant for Windows, but I think it makes sense to enable them anyway for Linux too, simply to excercise #28001, and they shouldn't hurt.
* vmspawn: Fix shared memory checkDaan De Meyer2024-04-191-1/+1
| | | | We need the shared memory added if we're doing runtime mounts as well.
* vmspawn: generate predicatable TAP device names and MAC addressesSam Leonard2024-04-151-3/+50
|
* vmspawn: insert missing empty lineSam Leonard2024-04-151-0/+1
|
* vmspawn: sort headersSam Leonard2024-04-151-6/+6
|
* vmspawn: check firmware target architectureSam Leonard2024-04-121-28/+78
| | | | | Fixes issue #32026 by only finding firmwares which explicitly support the native architecture.
* vmspawn: add --discard-disk= to control handling of disk discard requestsSam Leonard2024-04-121-1/+11
| | | | | Fixes issue #32024, using --discard-disk=yes will enable handling of disk discarding requests, saving space for long running VMs as desired.
* vmspawn: update parse_boolean to parse_boolean_argumentSam Leonard2024-04-121-10/+4
|
* vmspawn: enabled free page reporting in qemu by defaultSam Leonard2024-04-111-1/+2
| | | | | Fixes issue #32025, I saw no reason not to enable this by default so I added it to the initial qemu cmdline.
* vmspawn: fix `sd_bus_message_append()` arguments and add missing error checkAntonio Alvarez Feijoo2024-04-091-1/+3
|
* vmspawn: fix error codeYu Watanabe2024-04-031-1/+1
|
* Merge pull request #31886 from DaanDeMeyer/logindMike Yuan2024-03-241-8/+5
|\ | | | | logind: Add fallback for when the PIDFDs= property is not available
| * tree-wide: Add allow_pidfd argument to bus_append_scope_pidref()Daan De Meyer2024-03-221-8/+5
| |