[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner
- To: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
- From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Date: Mon, 13 Nov 2023 13:02:22 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S0Bsvp0tx3SsNLe9WoHGxEV0h1Mr9my0t6sIA3cMthw=; b=BZgdk4xPs5178q3sqr4NJD5jPbNtE9NVBzSTpuaxrhClcr+GZy2MXZGvZ3QSkyO5oOlV5dOhsEOvRZLU7cKmhqHdimuzAldbdsWfTuCeBYKA7CvKfB6av6M5a4LudZM1/nT8zVU53BEL3wDgiZi+M8g1TXfWpB0PQ5CQ6WgPF6PprhzbpO+u9XUBIwAao6lMC9T6Wlowz+Hb0IcWdwh1eKKuGgLwDSgYQSU4MALVUbq+mFWOg45YpcST2ZyXP61wPFRz6/ezZ6bYOBqm9PBTiTSMXOlodBTN1blsNFMncDFTvmO5bY25DUek4KoxiBQLjLKdnRjr5zoyZI132R/78g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gkHRNeN+tO0UfriVYDlDqK5KbfR7ev/4T6NApol17koTz7KINxTR8FkhJiJp3cH8BywL+ComU6RGD4XCHvDDc9xF+q5jjoB9aGiAfxAvjynH2yEbRQWefnHzYfXi0HEnOQ0BkL1Li9me8n2juOw5GinW1FxNLXiA6pMcbNOiDgNAkb/NYsahs+FlK5akWGggmVc0Qn7cnQvf8kJ71KTk0g8JlS6x7bJEIgMxw4sEcBxbtxL0Y/pQG9VIc1rVay93NoERjnQrjxBcdv9kMHnsKTSFZPRfNuDLcr3KeT6MoDSw6Mtil84hd+eNRihDXxxzj8fCSq8S+CPSjT9etMQPLw==
- Cc: "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, "open list:X86 Xen CPUs" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 13 Nov 2023 13:02:46 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHaFBZoS99E/RofVU6d/7dbafCRirB09L6AgAI+uwCAAQc9AA==
- Thread-topic: [PATCH v1 3/7] xen: xenstore: add possibility to preserve owner
Hi David,
David Woodhouse <dwmw2@xxxxxxxxxxxxx> 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
|