[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner
|
From: |
Volodymyr Babchuk |
|
Subject: |
Re: [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner |
|
Date: |
Mon, 13 Nov 2023 13:02:22 +0000 |
|
User-agent: |
mu4e 1.10.7; emacs 29.1 |
Hi David,
David Woodhouse <dwmw2@infradead.org> writes:
> [[S/MIME Signed Part:Undecided]]
> On Sat, 2023-11-11 at 11:01 +0000, David Woodhouse wrote:
>>
>> > --- a/hw/xen/xen-operations.c
>> > +++ b/hw/xen/xen-operations.c
>> > @@ -300,6 +300,18 @@ static bool libxenstore_create(struct qemu_xs_handle
>> > *h, xs_transaction_t t,
>> > return false;
>> > }
>> >
>> > + if (owner == XS_PRESERVE_OWNER) {
>> > + struct xs_permissions *tmp;
>> > + unsigned int num;
>> > +
>> > + tmp = xs_get_permissions(h->xsh, 0, path, &num);
>> > + if (tmp == NULL) {
>> > + return false;
>> > + }
>> > + perms_list[0].id = tmp[0].id;
>> > + free(tmp);
>> > + }
>> > +
>>
>> Don't see what saves you from someone else changing it at this point on
>> true Xen though. Which is why I'd prefer XenStore to do it natively.
>
> I suppose maybe you could do it in a transaction *if* the transaction_t
> you're passed in isn't already XBT_NULL?
Yes, I need to pass "t" to xs_get_permissions(), of course.
> One might argue that the mkdir+set_perms in libxenstore_create() ought
> to have been within the same transaction *anyway*?
Yes, all operations should be performed inside one transaction.
--
WBR, Volodymyr
- [PATCH v1 2/7] xen-bus: Do not destroy frontend/backend directories, (continued)
- [PATCH v1 2/7] xen-bus: Do not destroy frontend/backend directories, Volodymyr Babchuk, 2023/11/10
- [PATCH v1 4/7] xen_pvdev: Do not assume Dom0 when creating a directrory, Volodymyr Babchuk, 2023/11/10
- [PATCH v1 5/7] xen-bus: Set offline if backend's state is XenbusStateClosed, Volodymyr Babchuk, 2023/11/10
- [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner, Volodymyr Babchuk, 2023/11/10
- Re: [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner, Paul Durrant, 2023/11/12