* Duplicated VM start and shutdown code
@ 2026-07-09 21:04 Demi Marie Obenour
2026-07-10 13:43 ` Alyssa Ross
0 siblings, 1 reply; 5+ messages in thread
From: Demi Marie Obenour @ 2026-07-09 21:04 UTC (permalink / raw)
To: Spectrum OS Development
[-- Attachment #1.1: Type: text/plain, Size: 293 bytes --]
I noticed that vm-import, run-appimage, and run-flatpak all have the
same code to start a VM, and run-flatpak and run-appimage both have
the same code to shut down a VM. Is this intentional, or should it
be replaced with common code?
--
Sincerely,
Demi Marie Obenour (she/her/hers)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Duplicated VM start and shutdown code
2026-07-09 21:04 Duplicated VM start and shutdown code Demi Marie Obenour
@ 2026-07-10 13:43 ` Alyssa Ross
2026-07-10 17:27 ` Demi Marie Obenour
0 siblings, 1 reply; 5+ messages in thread
From: Alyssa Ross @ 2026-07-10 13:43 UTC (permalink / raw)
To: Demi Marie Obenour; +Cc: Spectrum OS Development
[-- Attachment #1: Type: text/plain, Size: 926 bytes --]
Demi Marie Obenour <demiobenour@gmail.com> writes:
> I noticed that vm-import, run-appimage, and run-flatpak all have the
> same code to start a VM, and run-flatpak and run-appimage both have
> the same code to shut down a VM. Is this intentional, or should it
> be replaced with common code?
Yes, it probably should. But it is sort of intentional — sometimes I'm
not sure exactly which parts should be shared, so I leave code
duplicated for a while with the idea that it'll become more clear what
the common core should be over time. (It usually works out.) Without a
good understanding, it's easy to deduplicate too much, and end up with
something that isn't flexible enough down the line, and then it has to
be un-deduplicated again. Happy for you to try deduplicating it if you
think you have a good idea of where to draw that line, but otherwise
it's also fine for it to stay duplicated for now.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Duplicated VM start and shutdown code
2026-07-10 13:43 ` Alyssa Ross
@ 2026-07-10 17:27 ` Demi Marie Obenour
2026-07-13 9:02 ` Alyssa Ross
0 siblings, 1 reply; 5+ messages in thread
From: Demi Marie Obenour @ 2026-07-10 17:27 UTC (permalink / raw)
To: Alyssa Ross; +Cc: Spectrum OS Development
[-- Attachment #1.1: Type: text/plain, Size: 1259 bytes --]
On 7/10/26 09:43, Alyssa Ross wrote:
> Demi Marie Obenour <demiobenour@gmail.com> writes:
>
>> I noticed that vm-import, run-appimage, and run-flatpak all have the
>> same code to start a VM, and run-flatpak and run-appimage both have
>> the same code to shut down a VM. Is this intentional, or should it
>> be replaced with common code?
>
> Yes, it probably should. But it is sort of intentional — sometimes I'm
> not sure exactly which parts should be shared, so I leave code
> duplicated for a while with the idea that it'll become more clear what
> the common core should be over time. (It usually works out.) Without a
> good understanding, it's easy to deduplicate too much, and end up with
> something that isn't flexible enough down the line, and then it has to
> be un-deduplicated again. Happy for you to try deduplicating it if you
> think you have a good idea of where to draw that line, but otherwise
> it's also fine for it to stay duplicated for now.
The code that creates temporary files and per-VM users is the same for
vm-import, run-appimage, and run-flatpak. The code that tears down
instances and namespaces is the same for run-appimage and run-flatpak.
--
Sincerely,
Demi Marie Obenour (she/her/hers)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Duplicated VM start and shutdown code
2026-07-10 17:27 ` Demi Marie Obenour
@ 2026-07-13 9:02 ` Alyssa Ross
2026-07-13 14:44 ` Demi Marie Obenour
0 siblings, 1 reply; 5+ messages in thread
From: Alyssa Ross @ 2026-07-13 9:02 UTC (permalink / raw)
To: Demi Marie Obenour; +Cc: Spectrum OS Development
[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]
Demi Marie Obenour <demiobenour@gmail.com> writes:
> On 7/10/26 09:43, Alyssa Ross wrote:
>> Demi Marie Obenour <demiobenour@gmail.com> writes:
>>
>>> I noticed that vm-import, run-appimage, and run-flatpak all have the
>>> same code to start a VM, and run-flatpak and run-appimage both have
>>> the same code to shut down a VM. Is this intentional, or should it
>>> be replaced with common code?
>>
>> Yes, it probably should. But it is sort of intentional — sometimes I'm
>> not sure exactly which parts should be shared, so I leave code
>> duplicated for a while with the idea that it'll become more clear what
>> the common core should be over time. (It usually works out.) Without a
>> good understanding, it's easy to deduplicate too much, and end up with
>> something that isn't flexible enough down the line, and then it has to
>> be un-deduplicated again. Happy for you to try deduplicating it if you
>> think you have a good idea of where to draw that line, but otherwise
>> it's also fine for it to stay duplicated for now.
>
> The code that creates temporary files and per-VM users is the same for
> vm-import, run-appimage, and run-flatpak. The code that tears down
> instances and namespaces is the same for run-appimage and run-flatpak.
Right, but my point is that doesn't *ncessarily* mean that those
individual things would make sense as their own reusable components.
It might do, but it's not inferrable just from the duplication.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Duplicated VM start and shutdown code
2026-07-13 9:02 ` Alyssa Ross
@ 2026-07-13 14:44 ` Demi Marie Obenour
0 siblings, 0 replies; 5+ messages in thread
From: Demi Marie Obenour @ 2026-07-13 14:44 UTC (permalink / raw)
To: Alyssa Ross; +Cc: Spectrum OS Development
[-- Attachment #1.1: Type: text/plain, Size: 1735 bytes --]
On 7/13/26 05:02, Alyssa Ross wrote:
> Demi Marie Obenour <demiobenour@gmail.com> writes:
>
>> On 7/10/26 09:43, Alyssa Ross wrote:
>>> Demi Marie Obenour <demiobenour@gmail.com> writes:
>>>
>>>> I noticed that vm-import, run-appimage, and run-flatpak all have the
>>>> same code to start a VM, and run-flatpak and run-appimage both have
>>>> the same code to shut down a VM. Is this intentional, or should it
>>>> be replaced with common code?
>>>
>>> Yes, it probably should. But it is sort of intentional — sometimes I'm
>>> not sure exactly which parts should be shared, so I leave code
>>> duplicated for a while with the idea that it'll become more clear what
>>> the common core should be over time. (It usually works out.) Without a
>>> good understanding, it's easy to deduplicate too much, and end up with
>>> something that isn't flexible enough down the line, and then it has to
>>> be un-deduplicated again. Happy for you to try deduplicating it if you
>>> think you have a good idea of where to draw that line, but otherwise
>>> it's also fine for it to stay duplicated for now.
>>
>> The code that creates temporary files and per-VM users is the same for
>> vm-import, run-appimage, and run-flatpak. The code that tears down
>> instances and namespaces is the same for run-appimage and run-flatpak.
>
> Right, but my point is that doesn't *ncessarily* mean that those
> individual things would make sense as their own reusable components.
> It might do, but it's not inferrable just from the duplication.
The big advantage of deduplication is that it makes modification
much easier, as I found out when adding cgroup support.
--
Sincerely,
Demi Marie Obenour (she/her/hers)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-13 14:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09 21:04 Duplicated VM start and shutdown code Demi Marie Obenour
2026-07-10 13:43 ` Alyssa Ross
2026-07-10 17:27 ` Demi Marie Obenour
2026-07-13 9:02 ` Alyssa Ross
2026-07-13 14:44 ` Demi Marie Obenour
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).