All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [PATCH v3 16/17] tools/xenstore: let check_store() check the accounting data
Date: Wed, 18 Jan 2023 09:35:57 +0000	[thread overview]
Message-ID: <449dae4d-c19c-87be-88ef-aa3ff79f1a23@xen.org> (raw)
In-Reply-To: <c541fcd7-a829-f757-c949-1b4a089ac6c3@suse.com>

Hi Juergen,

On 18/01/2023 06:23, Juergen Gross wrote:
> On 17.01.23 23:36, Julien Grall wrote:
>> Hi Juergen,
>>
>> On 17/01/2023 09:11, Juergen Gross wrote:
>>> Today check_store() is only testing the correctness of the node tree.
>>>
>>> Add verification of the accounting data (number of nodes)  and correct
>>
>> NIT: one too many space before 'and'.
>>
>>> the data if it is wrong.
>>>
>>> Do the initial check_store() call only after Xenstore entries of a
>>> live update have been read.
>>
>> Can you clarify whether this is needed for the rest of the patch, or 
>> simply a nice thing to have in general?
> 
> I'll add: "This is wanted to make sure the accounting data is correct after
> a live update."

Fine with me.

> 
>>
>>>
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>> ---
>>>   tools/xenstore/xenstored_core.c   | 62 ++++++++++++++++------
>>>   tools/xenstore/xenstored_domain.c | 86 +++++++++++++++++++++++++++++++
>>>   tools/xenstore/xenstored_domain.h |  4 ++
>>>   3 files changed, 137 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/tools/xenstore/xenstored_core.c 
>>> b/tools/xenstore/xenstored_core.c
>>> index 3099077a86..e201f14053 100644
>>> --- a/tools/xenstore/xenstored_core.c
>>> +++ b/tools/xenstore/xenstored_core.c
>>> @@ -2389,8 +2389,6 @@ void setup_structure(bool live_update)
>>>           manual_node("@introduceDomain", NULL);
>>>           domain_nbentry_fix(dom0_domid, 5, true);
>>>       }
>>> -
>>> -    check_store();
>>>   }
>>>   static unsigned int hash_from_key_fn(void *k)
>>> @@ -2433,20 +2431,28 @@ int remember_string(struct hashtable *hash, 
>>> const char *str)
>>>    * As we go, we record each node in the given reachable hashtable.  
>>> These
>>>    * entries will be used later in clean_store.
>>>    */
>>> +
>>> +struct check_store_data {
>>> +    struct hashtable *reachable;
>>> +    struct hashtable *domains;
>>> +};
>>> +
>>>   static int check_store_step(const void *ctx, struct connection *conn,
>>>                   struct node *node, void *arg)
>>>   {
>>> -    struct hashtable *reachable = arg;
>>> +    struct check_store_data *data = arg;
>>> -    if (hashtable_search(reachable, (void *)node->name)) {
>>> +    if (hashtable_search(data->reachable, (void *)node->name)) {
>>
>> IIUC the cast is only necessary because hashtable_search() expects a 
>> non-const value. I can't think for a reason for the key to be 
>> non-const. So I will look to send a follow-up patch.
> 
> It is possible, but nasty, due to talloc_free() not taking a const pointer.

I am not sure I understand your reasoning. Looking at 
hashtable_search(), I don't see a call to talloc_free().

Anyway, this is not directly related to this patch. So I will have a 
look separately.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2023-01-18  9:36 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17  9:11 [PATCH v3 00/17] tools/xenstore: do some cleanup and fixes Juergen Gross
2023-01-17  9:11 ` [PATCH v3 01/17] tools/xenstore: let talloc_free() preserve errno Juergen Gross
2023-01-17 13:56   ` Julien Grall
2023-01-17  9:11 ` [PATCH v3 02/17] tools/xenstore: remove all watches when a domain has stopped Juergen Gross
2023-01-17  9:11 ` [PATCH v3 03/17] tools/xenstore: add hashlist for finding struct domain by domid Juergen Gross
2023-01-17  9:11 ` [PATCH v3 04/17] tools/xenstore: introduce dummy nodes for special watch paths Juergen Gross
2023-01-17 14:02   ` Julien Grall
2023-01-17 15:50     ` Juergen Gross
2023-01-17  9:11 ` [PATCH v3 05/17] tools/xenstore: replace watch->relative_path with a prefix length Juergen Gross
2023-01-17 14:04   ` Julien Grall
2023-01-17  9:11 ` [PATCH v3 06/17] tools/xenstore: move changed domain handling Juergen Gross
2023-01-17 14:06   ` Julien Grall
2023-01-17  9:11 ` [PATCH v3 07/17] tools/xenstore: change per-domain node accounting interface Juergen Gross
2023-01-18  7:31   ` Juergen Gross
2023-01-17  9:11 ` [PATCH v3 08/17] tools/xenstore: don't allow creating too many nodes in a transaction Juergen Gross
2023-01-17 14:08   ` Julien Grall
2023-01-17 15:51     ` Juergen Gross
2023-01-17  9:11 ` [PATCH v3 09/17] tools/xenstore: replace literal domid 0 with dom0_domid Juergen Gross
2023-01-17  9:11 ` [PATCH v3 10/17] tools/xenstore: make domain_is_unprivileged() an inline function Juergen Gross
2023-01-17  9:11 ` [PATCH v3 11/17] tools/xenstore: let chk_domain_generation() return a bool Juergen Gross
2023-01-17  9:11 ` [PATCH v3 12/17] tools/xenstore: don't let hashtable_remove() return the removed value Juergen Gross
2023-01-17 22:03   ` Julien Grall
2023-01-18  6:17     ` Juergen Gross
2023-01-18  9:27       ` Julien Grall
2023-01-17  9:11 ` [PATCH v3 13/17] tools/xenstore: switch hashtable to use the talloc framework Juergen Gross
2023-01-18  9:30   ` Julien Grall
2023-01-17  9:11 ` [PATCH v3 14/17] tools/xenstore: make log macro globally available Juergen Gross
2023-01-17  9:11 ` [PATCH v3 15/17] tools/xenstore: introduce trace classes Juergen Gross
2023-01-17 22:15   ` Julien Grall
2023-01-18  6:18     ` Juergen Gross
2023-01-17  9:11 ` [PATCH v3 16/17] tools/xenstore: let check_store() check the accounting data Juergen Gross
2023-01-17 22:36   ` Julien Grall
2023-01-18  6:23     ` Juergen Gross
2023-01-18  9:35       ` Julien Grall [this message]
2023-01-18  9:37         ` Juergen Gross
2023-01-17  9:11 ` [PATCH v3 17/17] tools/xenstore: make output of "xenstore-control help" more pretty Juergen Gross
2023-01-17 22:39   ` Julien Grall
2023-01-17  9:37 ` [PATCH v3 00/17] tools/xenstore: do some cleanup and fixes Jan Beulich
2023-01-17  9:50   ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=449dae4d-c19c-87be-88ef-aa3ff79f1a23@xen.org \
    --to=julien@xen.org \
    --cc=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.